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