This split the mangling code up to allow for the possibility of multiple
[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 /* 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  * Default number of maximum open files per smbd. This is
61  * also limited by the maximum available file descriptors
62  * per process and can also be set in smb.conf as "max open files"
63  * in the [global] section.
64  */
65
66 #ifndef MAX_OPEN_FILES
67 #define MAX_OPEN_FILES 10000
68 #endif
69  
70 /* the max number of simultanous connections to the server by all clients */
71 /* zero means no limit. */
72 #define MAXSTATUS 0
73
74 #define WORDMAX 0xFFFF
75
76 /* the maximum password length before we declare a likely attack */
77 #define MAX_PASS_LEN 200
78
79 /* separators for lists */
80 #define LIST_SEP " \t,;:\n\r"
81
82 /* wchar separators for lists */
83 #define LIST_SEP_W wchar_list_sep
84
85 /* this is where browse lists are kept in the lock dir */
86 #define SERVER_LIST "browse.dat"
87
88 /* shall filenames with illegal chars in them get mangled in long
89    filename listings? */
90 #define MANGLE_LONG_FILENAMES 
91
92 /* define this if you want to stop spoofing with .. and soft links
93    NOTE: This also slows down the server considerably */
94 #define REDUCE_PATHS
95
96 /* the size of the directory cache */
97 #define DIRCACHESIZE 20
98
99 /* what default type of filesystem do we want this to show up as in a
100    NT file manager window? */
101 #define FSTYPE_STRING "NTFS"
102
103 /* the default guest account - normally set in the Makefile or smb.conf */
104 #ifndef GUEST_ACCOUNT
105 #define GUEST_ACCOUNT "nobody"
106 #endif
107
108 /* user to test password server with as invalid in security=server mode. */
109 #ifndef INVALID_USER_PREFIX
110 #define INVALID_USER_PREFIX "sambatest"
111 #endif
112
113 /* the default pager to use for the client "more" command. Users can
114    override this with the PAGER environment variable */
115 #ifndef PAGER
116 #define PAGER "more"
117 #endif
118
119 /* the size of the uid cache used to reduce valid user checks */
120 #define UID_CACHE_SIZE 4
121
122 /* the following control timings of various actions. Don't change 
123    them unless you know what you are doing. These are all in seconds */
124 #define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
125 #define SMBD_RELOAD_CHECK (180)
126 #define IDLE_CLOSED_TIMEOUT (60)
127 #define DPTR_IDLE_TIMEOUT (120)
128 #define SMBD_SELECT_TIMEOUT (60)
129 #define SMBD_SELECT_TIMEOUT_WITH_PENDING_LOCKS (10)
130 #define NMBD_SELECT_LOOP (10)
131 #define BROWSE_INTERVAL (60)
132 #define REGISTRATION_INTERVAL (10*60)
133 #define NMBD_INETD_TIMEOUT (120)
134 #define NMBD_MAX_TTL (24*60*60)
135 #define LPQ_LOCK_TIMEOUT (5)
136 #define NMBD_INTERFACES_RELOAD (120)
137 #define NMBD_UNEXPECTED_TIMEOUT (15)
138
139 /* the following are in milliseconds */
140 #define LOCK_RETRY_TIMEOUT (100)
141
142 /* do you want to dump core (carefully!) when an internal error is
143    encountered? Samba will be careful to make the core file only
144    accessible to root */
145 #define DUMP_CORE 1
146
147 /* shall we support browse requests via a FIFO to nmbd? */
148 #define ENABLE_FIFO 1
149
150 /* how long (in miliseconds) to wait for a socket connect to happen */
151 #define LONG_CONNECT_TIMEOUT 30000
152 #define SHORT_CONNECT_TIMEOUT 5000
153
154 /* the default netbios keepalive timeout */
155 #define DEFAULT_KEEPALIVE 300
156
157 /* the directory to sit in when idle */
158 /* #define IDLE_DIR "/" */
159
160 /* Timout (in seconds) to wait for an oplock break
161    message to return from the client. */
162
163 #define OPLOCK_BREAK_TIMEOUT 30
164
165 /* Timout (in seconds) to add to the oplock break timeout
166    to wait for the smbd to smbd message to return. */
167
168 #define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2
169
170 /* the read preciction code has been disabled until some problems with
171    it are worked out */
172 #define USE_READ_PREDICTION 0
173
174 /* name of directory that netatalk uses to store macintosh resource forks */
175 #define APPLEDOUBLE ".AppleDouble/"
176
177 /*
178  * Default passwd chat script.
179  */
180
181 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
182
183 /* Minimum length of allowed password when changing UNIX password. */
184 #define MINPASSWDLENGTH 5
185
186 /* maximum ID number used for session control. This cannot be larger
187    than 62*62 for the current code */
188 #define MAX_SESSION_ID 3000
189
190 #ifndef SESSION_TEMPLATE
191 #define SESSION_TEMPLATE "smb/%d"
192 #endif
193
194 /* the maximum age in seconds of a password. Should be a lp_ parameter */
195 #define MAX_PASSWORD_AGE (21*24*60*60)
196
197 /* Allocation roundup. */
198 #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
199
200 /* shall we deny oplocks to clients that get timeouts? */
201 #define FASCIST_OPLOCK_BACKOFF 1
202
203 /* this enables the "rabbit pellet" fix for SMBwritebraw */
204 #define RABBIT_PELLET_FIX 1
205
206 #endif