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 /* Yves Gaige <yvesg@hptnodur.grenoble.hp.com> requested this set this 	     */
9 /* to a maximum of 8 if old smb clients break because of long printer names. */
10 #define MAXPRINTERLEN 15
11 
12 /* max number of SMB1 directory handles */
13 /* As this now uses the bitmap code this can be
14    quite large. */
15 #define MAX_DIRECTORY_HANDLES 2048
16 
17 /* maximum number of file caches per smbd */
18 #define MAX_WRITE_CACHES 10
19 
20 /*
21  * Fudgefactor required for open tdb's, etc.
22  */
23 
24 #ifndef MAX_OPEN_FUDGEFACTOR
25 #define MAX_OPEN_FUDGEFACTOR 40
26 #endif
27 
28 /*
29  * Minimum number of open files needed for Windows7 to
30  * work correctly. A little conservative but better that
31  * than run out of fd's.
32  */
33 
34 #ifndef MIN_OPEN_FILES_WINDOWS
35 #define MIN_OPEN_FILES_WINDOWS 16384
36 #endif
37 
38 /*
39  * Default number of maximum open files per smbd. This is
40  * also limited by the maximum available file descriptors
41  * per process and can also be set in smb.conf as "max open files"
prelude_linked_object_del(prelude_linked_object_t * obj)42  * in the [global] section.
43  */
44 
45 #ifndef MAX_OPEN_FILES
46 #define MAX_OPEN_FILES (MIN_OPEN_FILES_WINDOWS + MAX_OPEN_FUDGEFACTOR)
47 #endif
48 
49 #define WORDMAX 0xFFFF
50 
51 /* the maximum password length before we declare a likely attack */
52 #define MAX_PASS_LEN 200
53 
54 /* separators for lists */
55 #define LIST_SEP " \t,;\n\r"
56 
57 /* wchar separators for lists */
58 #define LIST_SEP_W wchar_list_sep
59 
60 /* this is where browse lists are kept in the lock dir */
61 #define SERVER_LIST "browse.dat"
62 
63 /* shall filenames with illegal chars in them get mangled in long
64    filename listings? */
65 #define MANGLE_LONG_FILENAMES
66 
67 /* define this if you want to stop spoofing with .. and soft links
68    NOTE: This also slows down the server considerably */
69 #define REDUCE_PATHS
70 
71 /* the size of the directory cache */
72 #define DIRCACHESIZE 20
73 
74 /* what default type of filesystem do we want this to show up as in a
75    NT file manager window? */
76 #define FSTYPE_STRING "NTFS"
77 
78 /* user to test password server with as invalid in security=server mode. */
79 #ifndef INVALID_USER_PREFIX
80 #define INVALID_USER_PREFIX "sambatest"
81 #endif
82 
83 /* the default pager to use for the client "more" command. Users can
84    override this with the PAGER environment variable */
85 #ifndef PAGER
86 #define PAGER "more"
87 #endif
88 
89 /* the size of the uid cache used to reduce valid user checks */
90 #define VUID_CACHE_SIZE 32
91 
92 /* the following control timings of various actions. Don't change
93    them unless you know what you are doing. These are all in seconds */
94 #define SMBD_RELOAD_CHECK (180)
95 #define IDLE_CLOSED_TIMEOUT (60)
96 #define SMBD_SELECT_TIMEOUT (60)
97 #define NMBD_SELECT_LOOP (10)
98 #define BROWSE_INTERVAL (60)
99 #define REGISTRATION_INTERVAL (10*60)
100 #define NMBD_INETD_TIMEOUT (120)
101 #define NMBD_MAX_TTL (24*60*60)
102 #define LPQ_LOCK_TIMEOUT (5)
103 #define NMBD_INTERFACES_RELOAD (120)
104 #define NMBD_UNEXPECTED_TIMEOUT (15)
105 #define SMBD_HOUSEKEEPING_INTERVAL SMBD_SELECT_TIMEOUT
106 
107 /* the following are in milliseconds */
108 #define LOCK_RETRY_TIMEOUT (100)
109 
110 /* do you want to dump core (carefully!) when an internal error is
111    encountered? Samba will be careful to make the core file only
112    accessible to root */
113 #define DUMP_CORE 1
114 
115 /* shall we support browse requests via a FIFO to nmbd? */
116 #define ENABLE_FIFO 1
117 
118 /* how long (in miliseconds) to wait for a socket connect to happen */
119 #define LONG_CONNECT_TIMEOUT 30000
120 #define SHORT_CONNECT_TIMEOUT 5000
121 
122 /* the default netbios keepalive timeout */
123 #define DEFAULT_KEEPALIVE 300
124 
125 /* the directory to sit in when idle */
126 /* #define IDLE_DIR "/" */
127 
128 /* Timout (in seconds) to wait for an oplock break
129    message to return from the client. */
130 
131 #define OPLOCK_BREAK_TIMEOUT 30
132 
133 /* Timout (in seconds) to add to the oplock break timeout
134    to wait for the smbd to smbd message to return. */
135 
136 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
137 
138 /* the read preciction code has been disabled until some problems with
139    it are worked out */
140 #define USE_READ_PREDICTION 0
141 
142 /* Minimum length of allowed password when changing UNIX password. */
143 #define MINPASSWDLENGTH 5
144 
145 /* the maximum age in seconds of a password. Should be a lp_ parameter */
146 #define MAX_PASSWORD_AGE (21*24*60*60)
147 
148 /* shall we deny oplocks to clients that get timeouts? */
149 #define FASCIST_OPLOCK_BACKOFF 1
150 
151 /* this enables the "rabbit pellet" fix for SMBwritebraw */
152 #define RABBIT_PELLET_FIX 1
153 
154 /* Max number of open RPC pipes. */
155 #define MAX_OPEN_PIPES 2048
156 
157 /* Tuning for server auth mutex. */
158 #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */
159 #define NUM_CLI_AUTH_CONNECT_RETRIES 3
160 /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */
161 #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)
162 /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */
163 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
164 
165 /* size of listen() backlog in smbd */
166 #if defined (FREEBSD)
167 #define SMBD_LISTEN_BACKLOG -1
168 #else
169 #define SMBD_LISTEN_BACKLOG 50
170 #endif
171 
172 /* size of listen() default backlog */
173 #if defined (FREEBSD)
174 #define DEFAULT_LISTEN_BACKLOG -1
175 #else
176 #define DEFAULT_LISTEN_BACKLOG 5
177 #endif
178 
179 /* Number of microseconds to wait before a sharing violation. */
180 #define SHARING_VIOLATION_USEC_WAIT 950000
181 
182 /* Number of microseconds to wait before a updating the write time (2 secs). */
183 #define WRITE_TIME_UPDATE_USEC_DELAY 2000000
184 
185 #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
186 
187 /* tdb hash size for the open database. */
188 #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007
189 
190 /* Characters we disallow in sharenames. */
191 #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
192 
193 /* Seconds between connection attempts to a remote server. */
194 #define FAILED_CONNECTION_CACHE_TIMEOUT (LONG_CONNECT_TIMEOUT * 2 / 1000)
195 
196 /* Default hash size for the winbindd cache. */
197 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
198 
199 /* Windows minimum lock resolution timeout in ms */
200 #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
201 
202 /* Maximum size of RPC data we will accept for one call. */
203 #define MAX_RPC_DATA_SIZE (15*1024*1024)
204 
205 /* A guestimate of how many domains winbindd will be contacting */
206 #ifndef WINBIND_MAX_DOMAINS_HINT
207 #define WINBIND_MAX_DOMAINS_HINT 10
208 #endif
209 #endif
210