s3:libads/kerberos_proto.h: add GPL/Copyright header (cherry picked from commit 6bf32...
[Samba.git] / source3 / modules / onefs_config.h
blobf0f48e63794efcf959b20544ad701ed9bf07ec2c
1 /*
2 * Unix SMB/CIFS implementation.
3 * OneFS vfs module configuration and defaults
5 * Copyright (C) Steven Danneman, 2008
6 * Copyright (C) Tim Prouty, 2009
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #ifndef _ONEFS_CONFIG_H
23 #define _ONEFS_CONFIG_H
25 /**
26 * Specifies when ACLs presented to Windows should be canonicalized
27 * into the ordering which Explorer expects.
29 enum onefs_acl_wire_format
31 ACL_FORMAT_RAW, /**< Never canonicalize */
32 ACL_FORMAT_WINDOWS_SD, /**< Only canonicalize synthetic ACLs */
33 ACL_FORMAT_ALWAYS /**< Always canonicalize */
36 #define PARM_ONEFS_TYPE "onefs"
37 #define PARM_ACL_WIRE_FORMAT "acl wire format"
38 #define PARM_ACL_WIRE_FORMAT_DEFAULT ACL_FORMAT_WINDOWS_SD
39 #define PARM_ALLOW_EXECUTE_ALWAYS "allow execute always"
40 #define PARM_ALLOW_EXECUTE_ALWAYS_DEFAULT false
41 #define PARM_ATIME_NOW "atime now files"
42 #define PARM_ATIME_NOW_DEFAULT NULL
43 #define PARM_ATIME_STATIC "atime static files"
44 #define PARM_ATIME_STATIC_DEFAULT NULL
45 #define PARM_ATIME_SLOP "atime now slop"
46 #define PARM_ATIME_SLOP_DEFAULT 0
47 #define PARM_ATOMIC_SENDFILE "atomic sendfile"
48 #define PARM_ATOMIC_SENDFILE_DEFAULT true
49 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL "creator owner gets full control"
50 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL_DEFAULT true
51 #define PARM_CTIME_NOW "ctime now files"
52 #define PARM_CTIME_NOW_DEFAULT NULL
53 #define PARM_CTIME_SLOP "ctime now slop"
54 #define PARM_CTIME_SLOP_DEFAULT 0
55 #define PARM_DOT_SNAP_CHILD_ACCESSIBLE "dot snap child accessible"
56 #define PARM_DOT_SNAP_CHILD_ACCESSIBLE_DEFAULT true
57 #define PARM_DOT_SNAP_CHILD_VISIBLE "dot snap child visible"
58 #define PARM_DOT_SNAP_CHILD_VISIBLE_DEFAULT false
59 #define PARM_DOT_SNAP_ROOT_ACCESSIBLE "dot snap root accessible"
60 #define PARM_DOT_SNAP_ROOT_ACCESSIBLE_DEFAULT true
61 #define PARM_DOT_SNAP_ROOT_VISIBLE "dot snap root visible"
62 #define PARM_DOT_SNAP_ROOT_VISIBLE_DEFAULT true
63 #define PARM_DOT_SNAP_TILDE "dot snap tilde"
64 #define PARM_DOT_SNAP_TILDE_DEFAULT true
65 #define PARM_IGNORE_SACLS "ignore sacls"
66 #define PARM_IGNORE_SACLS_DEFAULT false
67 #define PARM_IGNORE_STREAMS "ignore streams"
68 #define PARM_IGNORE_STREAMS_DEFAULT false
69 #define PARM_MTIME_NOW "mtime now files"
70 #define PARM_MTIME_NOW_DEFAULT NULL
71 #define PARM_MTIME_STATIC "mtime static files"
72 #define PARM_MTIME_STATIC_DEFAULT NULL
73 #define PARM_MTIME_SLOP "mtime now slop"
74 #define PARM_MTIME_SLOP_DEFAULT 0
75 #define PARM_USE_READDIRPLUS "use readdirplus"
76 #define PARM_USE_READDIRPLUS_DEFAULT true
77 #define PARM_SENDFILE_LARGE_READS "sendfile large reads"
78 #define PARM_SENDFILE_LARGE_READS_DEFAULT false
79 #define PARM_SENDFILE_SAFE "sendfile safe"
80 #define PARM_SENDFILE_SAFE_DEFAULT true
81 #define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE "simple file sharing compatibility mode"
82 #define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE_DEFAULT false
83 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE "unmappable sids deny everyone"
84 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE_DEFAULT false
85 #define PARM_UNMAPPABLE_SIDS_IGNORE "ignore unmappable sids"
86 #define PARM_UNMAPPABLE_SIDS_IGNORE_DEFAULT false
87 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST "unmappable sids ignore list"
88 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST_DEFAULT NULL
90 #define IS_CTIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
91 (cfg)->ctime_now_list,(conn)->case_sensitive))
92 #define IS_MTIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
93 (cfg)->mtime_now_list,(conn)->case_sensitive))
94 #define IS_ATIME_NOW_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
95 (cfg)->atime_now_list,(conn)->case_sensitive))
96 #define IS_MTIME_STATIC_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
97 (cfg)->mtime_static_list,(conn)->case_sensitive))
98 #define IS_ATIME_STATIC_PATH(conn,cfg,path) ((conn) && is_in_path((path),\
99 (cfg)->atime_static_list,(conn)->case_sensitive))
102 * Store some commonly evaluated parameters to avoid loadparm pain.
105 #define ONEFS_VFS_CONFIG_INITIALIZED 0x00010000
107 #define ONEFS_VFS_CONFIG_FAKETIMESTAMPS 0x00000001
109 struct onefs_vfs_share_config
111 uint32_t init_flags;
113 /* data for fake timestamps */
114 int atime_slop;
115 int ctime_slop;
116 int mtime_slop;
118 /* Per-share list of files to fake the create time for. */
119 name_compare_entry *ctime_now_list;
121 /* Per-share list of files to fake the modification time for. */
122 name_compare_entry *mtime_now_list;
124 /* Per-share list of files to fake the access time for. */
125 name_compare_entry *atime_now_list;
127 /* Per-share list of files to fake the modification time for. */
128 name_compare_entry *mtime_static_list;
130 /* The access time will equal the create time. */
131 /* The modification time will equal the create time.*/
133 /* Per-share list of files to fake the access time for. */
134 name_compare_entry *atime_static_list;
137 struct onefs_vfs_global_config
139 uint32_t init_flags;
141 /* Snapshot options */
142 bool dot_snap_child_accessible;
143 bool dot_snap_child_visible;
144 bool dot_snap_root_accessible;
145 bool dot_snap_root_visible;
146 bool dot_snap_tilde;
149 int onefs_load_config(connection_struct *conn);
151 bool onefs_get_config(int snum, int config_type,
152 struct onefs_vfs_share_config *cfg);
154 void onefs_sys_config_enc(void);
156 void onefs_sys_config_snap_opt(struct onefs_vfs_global_config *global_config);
158 void onefs_sys_config_tilde(struct onefs_vfs_global_config *global_config);
160 #endif /* _ONEFS_CONFIG_H */