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