6c9a8c3055c86340ef9529ec7daae2bf4c3fb02b
[metze/samba/wip.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
143 /* the following are in milliseconds */
144 #define LOCK_RETRY_TIMEOUT (100)
145
146 /* do you want to dump core (carefully!) when an internal error is
147    encountered? Samba will be careful to make the core file only
148    accessible to root */
149 #define DUMP_CORE 1
150
151 /* shall we support browse requests via a FIFO to nmbd? */
152 #define ENABLE_FIFO 1
153
154 /* how long (in miliseconds) to wait for a socket connect to happen */
155 #define LONG_CONNECT_TIMEOUT 30000
156 #define SHORT_CONNECT_TIMEOUT 5000
157
158 /* the default netbios keepalive timeout */
159 #define DEFAULT_KEEPALIVE 300
160
161 /* the directory to sit in when idle */
162 /* #define IDLE_DIR "/" */
163
164 /* Timout (in seconds) to wait for an oplock break
165    message to return from the client. */
166
167 #define OPLOCK_BREAK_TIMEOUT 30
168
169 /* Timout (in seconds) to add to the oplock break timeout
170    to wait for the smbd to smbd message to return. */
171
172 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
173
174 /* the read preciction code has been disabled until some problems with
175    it are worked out */
176 #define USE_READ_PREDICTION 0
177
178 /*
179  * Default passwd chat script.
180  */
181
182 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
183
184 /* Minimum length of allowed password when changing UNIX password. */
185 #define MINPASSWDLENGTH 5
186
187 /* maximum ID number used for session control. This cannot be larger
188    than 62*62 for the current code */
189 #define MAX_SESSION_ID 3000
190
191 /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal
192    name. This can be in one of two forms:  The first for systems not using
193    utmp (and therefore not constrained as to length or the need for a number
194    < 3000 or so) and the second for systems with this 'well behaved terminal
195    like name' constraint.
196 */
197
198 #ifndef SESSION_TEMPLATE
199 /* Paramaters are 'pid' and 'vuid' */
200 #define SESSION_TEMPLATE "smb/%lu/%d"
201 #endif
202
203 #ifndef SESSION_UTMP_TEMPLATE
204 #define SESSION_UTMP_TEMPLATE "smb/%d"
205 #endif
206
207 /* the maximum age in seconds of a password. Should be a lp_ parameter */
208 #define MAX_PASSWORD_AGE (21*24*60*60)
209
210 /* Default allocation roundup. */
211 #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
212
213 /* shall we deny oplocks to clients that get timeouts? */
214 #define FASCIST_OPLOCK_BACKOFF 1
215
216 /* this enables the "rabbit pellet" fix for SMBwritebraw */
217 #define RABBIT_PELLET_FIX 1
218
219 /* Max number of jobs per print queue. */
220 #define PRINT_MAX_JOBID 10000
221
222 /* Max number of open RPC pipes. */
223 #define MAX_OPEN_PIPES 2048
224
225 /* Tuning for server auth mutex. */
226 #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */
227 #define NUM_CLI_AUTH_CONNECT_RETRIES 3
228 /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */
229 #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)
230 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
231 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
232
233 /* Buffer size to use when printing backtraces */
234 #define BACKTRACE_STACK_SIZE 64
235
236 /* size of listen() backlog in smbd */
237 #define SMBD_LISTEN_BACKLOG 50
238
239 /* Number of microseconds to wait before a sharing violation. */
240 #define SHARING_VIOLATION_USEC_WAIT 950000
241
242 /* Number of microseconds to wait before a updating the write time (2 secs). */
243 #define WRITE_TIME_UPDATE_USEC_DELAY 2000000
244
245 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
246
247 /* tdb hash size for the open database. */
248 #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
249
250 /* Characters we disallow in sharenames. */
251 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
252
253 /* Seconds between connection attempts to a remote server. */
254 #define FAILED_CONNECTION_CACHE_TIMEOUT 30
255
256 /* Default hash size for the winbindd cache. */
257 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
258
259 /* Windows minimum lock resolution timeout in ms */
260 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
261
262 /* Maximum size of RPC data we will accept for one call. */
263 #define MAX_RPC_DATA_SIZE (15*1024*1024)
264
265 #define CLIENT_NDR_PADDING_SIZE 8
266 #define SERVER_NDR_PADDING_SIZE 8
267
268 #endif