bb738407574de2169152570feec8e3d7863c7068
[abartlet/samba.git/.git] / source3 / include / local.h
1 /* Copyright (C) 1995-1998 Samba-Team */
2 /* Copyright (C) 1998 John H Terpstra <jht@aquasoft.com.au> */
3
4 /* local definitions for file server */
5 #ifndef _LOCAL_H
6 #define _LOCAL_H
7
8 /* The default workgroup - usually overridden in smb.conf */
9 #ifndef WORKGROUP
10 #define WORKGROUP "WORKGROUP"
11 #endif
12
13 /* This defines the section name in the configuration file that will contain */
14 /* global parameters - that is, parameters relating to the whole server, not */
15 /* just services. This name is then reserved, and may not be used as a       */
16 /* a service name. It will default to "global" if not defined here.          */
17 #define GLOBAL_NAME "global"
18 #define GLOBAL_NAME2 "globals"
19
20 /* This defines the section name in the configuration file that will
21    refer to the special "homes" service */
22 #define HOMES_NAME "homes"
23
24 /* This defines the section name in the configuration file that will
25    refer to the special "printers" service */
26 #define PRINTERS_NAME "printers"
27
28 /* Yves Gaige <yvesg@hptnodur.grenoble.hp.com> requested this set this       */
29 /* to a maximum of 8 if old smb clients break because of long printer names. */
30 #define MAXPRINTERLEN 15
31
32 /* max number of directories open at once */
33 /* note that with the new directory code this no longer requires a
34    file handle per directory, but large numbers do use more memory */
35 #define MAX_OPEN_DIRECTORIES 256
36
37 /* max number of directory handles */
38 /* As this now uses the bitmap code this can be
39    quite large. */
40 #define MAX_DIRECTORY_HANDLES 2048
41
42 /* maximum number of file caches per smbd */
43 #define MAX_WRITE_CACHES 10
44
45 /* define what facility to use for syslog */
46 #ifndef SYSLOG_FACILITY
47 #define SYSLOG_FACILITY LOG_DAEMON
48 #endif
49
50 /*
51  * Fudgefactor required for open tdb's, etc.
52  */
53
54 #ifndef MAX_OPEN_FUDGEFACTOR
55 #define MAX_OPEN_FUDGEFACTOR 20
56 #endif
57
58 /*
59  * Minimum number of open files needed for Windows7 to
60  * work correctly. A little conservative but better that
61  * than run out of fd's.
62  */
63
64 #ifndef MIN_OPEN_FILES_WINDOWS
65 #define MIN_OPEN_FILES_WINDOWS 16384
66 #endif
67
68 /*
69  * Default number of maximum open files per smbd. This is
70  * also limited by the maximum available file descriptors
71  * per process and can also be set in smb.conf as "max open files"
72  * in the [global] section.
73  */
74
75 #ifndef MAX_OPEN_FILES
76 #define MAX_OPEN_FILES (MIN_OPEN_FILES_WINDOWS + MAX_OPEN_FUDGEFACTOR)
77 #endif
78
79 #define WORDMAX 0xFFFF
80
81 /* the maximum password length before we declare a likely attack */
82 #define MAX_PASS_LEN 200
83
84 /* separators for lists */
85 #define LIST_SEP " \t,;\n\r"
86
87 /* wchar separators for lists */
88 #define LIST_SEP_W wchar_list_sep
89
90 /* this is where browse lists are kept in the lock dir */
91 #define SERVER_LIST "browse.dat"
92
93 /* shall filenames with illegal chars in them get mangled in long
94    filename listings? */
95 #define MANGLE_LONG_FILENAMES 
96
97 /* define this if you want to stop spoofing with .. and soft links
98    NOTE: This also slows down the server considerably */
99 #define REDUCE_PATHS
100
101 /* the size of the directory cache */
102 #define DIRCACHESIZE 20
103
104 /* what default type of filesystem do we want this to show up as in a
105    NT file manager window? */
106 #define FSTYPE_STRING "NTFS"
107
108 /* the default guest account - normally set in the Makefile or smb.conf */
109 #ifndef GUEST_ACCOUNT
110 #define GUEST_ACCOUNT "nobody"
111 #endif
112
113 /* user to test password server with as invalid in security=server mode. */
114 #ifndef INVALID_USER_PREFIX
115 #define INVALID_USER_PREFIX "sambatest"
116 #endif
117
118 /* the default pager to use for the client "more" command. Users can
119    override this with the PAGER environment variable */
120 #ifndef PAGER
121 #define PAGER "more"
122 #endif
123
124 /* the size of the uid cache used to reduce valid user checks */
125 #define VUID_CACHE_SIZE 32
126
127 /* the following control timings of various actions. Don't change 
128    them unless you know what you are doing. These are all in seconds */
129 #define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
130 #define SMBD_RELOAD_CHECK (180)
131 #define IDLE_CLOSED_TIMEOUT (60)
132 #define DPTR_IDLE_TIMEOUT (120)
133 #define SMBD_SELECT_TIMEOUT (60)
134 #define NMBD_SELECT_LOOP (10)
135 #define BROWSE_INTERVAL (60)
136 #define REGISTRATION_INTERVAL (10*60)
137 #define NMBD_INETD_TIMEOUT (120)
138 #define NMBD_MAX_TTL (24*60*60)
139 #define LPQ_LOCK_TIMEOUT (5)
140 #define NMBD_INTERFACES_RELOAD (120)
141 #define NMBD_UNEXPECTED_TIMEOUT (15)
142 #define SMBD_HOUSEKEEPING_INTERVAL SMBD_SELECT_TIMEOUT
143
144 /* the following are in milliseconds */
145 #define LOCK_RETRY_TIMEOUT (100)
146
147 /* do you want to dump core (carefully!) when an internal error is
148    encountered? Samba will be careful to make the core file only
149    accessible to root */
150 #define DUMP_CORE 1
151
152 /* shall we support browse requests via a FIFO to nmbd? */
153 #define ENABLE_FIFO 1
154
155 /* how long (in miliseconds) to wait for a socket connect to happen */
156 #define LONG_CONNECT_TIMEOUT 30000
157 #define SHORT_CONNECT_TIMEOUT 5000
158
159 /* the default netbios keepalive timeout */
160 #define DEFAULT_KEEPALIVE 300
161
162 /* the directory to sit in when idle */
163 /* #define IDLE_DIR "/" */
164
165 /* Timout (in seconds) to wait for an oplock break
166    message to return from the client. */
167
168 #define OPLOCK_BREAK_TIMEOUT 30
169
170 /* Timout (in seconds) to add to the oplock break timeout
171    to wait for the smbd to smbd message to return. */
172
173 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
174
175 /* the read preciction code has been disabled until some problems with
176    it are worked out */
177 #define USE_READ_PREDICTION 0
178
179 /*
180  * Default passwd chat script.
181  */
182
183 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
184
185 /* Minimum length of allowed password when changing UNIX password. */
186 #define MINPASSWDLENGTH 5
187
188 /* maximum ID number used for session control. This cannot be larger
189    than 62*62 for the current code */
190 #define MAX_SESSION_ID 3000
191
192 /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal
193    name. This can be in one of two forms:  The first for systems not using
194    utmp (and therefore not constrained as to length or the need for a number
195    < 3000 or so) and the second for systems with this 'well behaved terminal
196    like name' constraint.
197 */
198
199 #ifndef SESSION_TEMPLATE
200 /* Paramaters are 'pid' and 'vuid' */
201 #define SESSION_TEMPLATE "smb/%lu/%d"
202 #endif
203
204 #ifndef SESSION_UTMP_TEMPLATE
205 #define SESSION_UTMP_TEMPLATE "smb/%d"
206 #endif
207
208 /* the maximum age in seconds of a password. Should be a lp_ parameter */
209 #define MAX_PASSWORD_AGE (21*24*60*60)
210
211 /* Default allocation roundup. */
212 #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
213
214 /* shall we deny oplocks to clients that get timeouts? */
215 #define FASCIST_OPLOCK_BACKOFF 1
216
217 /* this enables the "rabbit pellet" fix for SMBwritebraw */
218 #define RABBIT_PELLET_FIX 1
219
220 /* Max number of jobs per print queue. */
221 #define PRINT_MAX_JOBID 10000
222
223 /* Max number of open RPC pipes. */
224 #define MAX_OPEN_PIPES 2048
225
226 /* Tuning for server auth mutex. */
227 #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */
228 #define NUM_CLI_AUTH_CONNECT_RETRIES 3
229 /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */
230 #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)
231 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
232 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
233
234 /* Buffer size to use when printing backtraces */
235 #define BACKTRACE_STACK_SIZE 64
236
237 /* size of listen() backlog in smbd */
238 #define SMBD_LISTEN_BACKLOG 50
239
240 /* Number of microseconds to wait before a sharing violation. */
241 #define SHARING_VIOLATION_USEC_WAIT 950000
242
243 /* Number of microseconds to wait before a updating the write time (2 secs). */
244 #define WRITE_TIME_UPDATE_USEC_DELAY 2000000
245
246 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
247
248 /* tdb hash size for the open database. */
249 #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
250
251 /* Characters we disallow in sharenames. */
252 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
253
254 /* Seconds between connection attempts to a remote server. */
255 #define FAILED_CONNECTION_CACHE_TIMEOUT 30
256
257 /* Default hash size for the winbindd cache. */
258 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
259
260 /* Windows minimum lock resolution timeout in ms */
261 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
262
263 /* Maximum size of RPC data we will accept for one call. */
264 #define MAX_RPC_DATA_SIZE (15*1024*1024)
265
266 #define CLIENT_NDR_PADDING_SIZE 8
267 #define SERVER_NDR_PADDING_SIZE 8
268
269 #define DEFAULT_SMB2_MAX_READ (1024*1024)
270 #define DEFAULT_SMB2_MAX_WRITE (1024*1024)
271 #define DEFAULT_SMB2_MAX_TRANSACT (1024*1024)
272 #define DEFAULT_SMB2_MAX_CREDITS 128
273 #define DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR 2
274
275 #endif