| 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 | /* | 
|---|
| 46 | * Fudgefactor required for open tdb's, etc. | 
|---|
| 47 | */ | 
|---|
| 48 |  | 
|---|
| 49 | #ifndef MAX_OPEN_FUDGEFACTOR | 
|---|
| 50 | #define MAX_OPEN_FUDGEFACTOR 20 | 
|---|
| 51 | #endif | 
|---|
| 52 |  | 
|---|
| 53 | /* | 
|---|
| 54 | * Minimum number of open files needed for Windows7 to | 
|---|
| 55 | * work correctly. A little conservative but better that | 
|---|
| 56 | * than run out of fd's. | 
|---|
| 57 | */ | 
|---|
| 58 |  | 
|---|
| 59 | #ifndef MIN_OPEN_FILES_WINDOWS | 
|---|
| 60 | #define MIN_OPEN_FILES_WINDOWS 16384 | 
|---|
| 61 | #endif | 
|---|
| 62 |  | 
|---|
| 63 | /* | 
|---|
| 64 | * Default number of maximum open files per smbd. This is | 
|---|
| 65 | * also limited by the maximum available file descriptors | 
|---|
| 66 | * per process and can also be set in smb.conf as "max open files" | 
|---|
| 67 | * in the [global] section. | 
|---|
| 68 | */ | 
|---|
| 69 |  | 
|---|
| 70 | #ifndef MAX_OPEN_FILES | 
|---|
| 71 | #define MAX_OPEN_FILES (MIN_OPEN_FILES_WINDOWS + MAX_OPEN_FUDGEFACTOR) | 
|---|
| 72 | #endif | 
|---|
| 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 VUID_CACHE_SIZE 32 | 
|---|
| 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 NMBD_SELECT_LOOP (10) | 
|---|
| 130 | #define BROWSE_INTERVAL (60) | 
|---|
| 131 | #define REGISTRATION_INTERVAL (10*60) | 
|---|
| 132 | #define NMBD_INETD_TIMEOUT (120) | 
|---|
| 133 | #define NMBD_MAX_TTL (24*60*60) | 
|---|
| 134 | #define LPQ_LOCK_TIMEOUT (5) | 
|---|
| 135 | #define NMBD_INTERFACES_RELOAD (120) | 
|---|
| 136 | #define NMBD_UNEXPECTED_TIMEOUT (15) | 
|---|
| 137 | #define SMBD_HOUSEKEEPING_INTERVAL SMBD_SELECT_TIMEOUT | 
|---|
| 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 | /* | 
|---|
| 175 | * Default passwd chat script. | 
|---|
| 176 | */ | 
|---|
| 177 |  | 
|---|
| 178 | #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*" | 
|---|
| 179 |  | 
|---|
| 180 | /* Minimum length of allowed password when changing UNIX password. */ | 
|---|
| 181 | #define MINPASSWDLENGTH 5 | 
|---|
| 182 |  | 
|---|
| 183 | /* maximum ID number used for session control. This cannot be larger | 
|---|
| 184 | than 62*62 for the current code */ | 
|---|
| 185 | #define MAX_SESSION_ID 3000 | 
|---|
| 186 |  | 
|---|
| 187 | /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal | 
|---|
| 188 | name. This can be in one of two forms:  The first for systems not using | 
|---|
| 189 | utmp (and therefore not constrained as to length or the need for a number | 
|---|
| 190 | < 3000 or so) and the second for systems with this 'well behaved terminal | 
|---|
| 191 | like name' constraint. | 
|---|
| 192 | */ | 
|---|
| 193 |  | 
|---|
| 194 | #ifndef SESSION_TEMPLATE | 
|---|
| 195 | /* Paramaters are 'pid' and 'vuid' */ | 
|---|
| 196 | #define SESSION_TEMPLATE "smb/%lu/%d" | 
|---|
| 197 | #endif | 
|---|
| 198 |  | 
|---|
| 199 | #ifndef SESSION_UTMP_TEMPLATE | 
|---|
| 200 | #define SESSION_UTMP_TEMPLATE "smb/%d" | 
|---|
| 201 | #endif | 
|---|
| 202 |  | 
|---|
| 203 | /* the maximum age in seconds of a password. Should be a lp_ parameter */ | 
|---|
| 204 | #define MAX_PASSWORD_AGE (21*24*60*60) | 
|---|
| 205 |  | 
|---|
| 206 | /* Default allocation roundup. */ | 
|---|
| 207 | #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000 | 
|---|
| 208 |  | 
|---|
| 209 | /* shall we deny oplocks to clients that get timeouts? */ | 
|---|
| 210 | #define FASCIST_OPLOCK_BACKOFF 1 | 
|---|
| 211 |  | 
|---|
| 212 | /* this enables the "rabbit pellet" fix for SMBwritebraw */ | 
|---|
| 213 | #define RABBIT_PELLET_FIX 1 | 
|---|
| 214 |  | 
|---|
| 215 | /* Max number of jobs per print queue. */ | 
|---|
| 216 | #define PRINT_MAX_JOBID 10000 | 
|---|
| 217 |  | 
|---|
| 218 | /* Max number of open RPC pipes. */ | 
|---|
| 219 | #define MAX_OPEN_PIPES 2048 | 
|---|
| 220 |  | 
|---|
| 221 | /* Tuning for server auth mutex. */ | 
|---|
| 222 | #define CLI_AUTH_TIMEOUT 5000 /* In milli-seconds. */ | 
|---|
| 223 | #define NUM_CLI_AUTH_CONNECT_RETRIES 3 | 
|---|
| 224 | /* Number in seconds to wait for the mutex. This must be less than 30 seconds. */ | 
|---|
| 225 | #define SERVER_MUTEX_WAIT_TIME ( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5) | 
|---|
| 226 | /* Number in seconds for winbindd to wait for the mutex. Make this 2 * smbd wait time. */ | 
|---|
| 227 | #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2) | 
|---|
| 228 |  | 
|---|
| 229 | /* Buffer size to use when printing backtraces */ | 
|---|
| 230 | #define BACKTRACE_STACK_SIZE 64 | 
|---|
| 231 |  | 
|---|
| 232 | /* size of listen() backlog in smbd */ | 
|---|
| 233 | #define SMBD_LISTEN_BACKLOG 50 | 
|---|
| 234 |  | 
|---|
| 235 | /* Number of microseconds to wait before a sharing violation. */ | 
|---|
| 236 | #define SHARING_VIOLATION_USEC_WAIT 950000 | 
|---|
| 237 |  | 
|---|
| 238 | /* Number of microseconds to wait before a updating the write time (2 secs). */ | 
|---|
| 239 | #define WRITE_TIME_UPDATE_USEC_DELAY 2000000 | 
|---|
| 240 |  | 
|---|
| 241 | #define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */ | 
|---|
| 242 |  | 
|---|
| 243 | /* tdb hash size for the open database. */ | 
|---|
| 244 | #define SMB_OPEN_DATABASE_TDB_HASH_SIZE 10007 | 
|---|
| 245 |  | 
|---|
| 246 | /* Characters we disallow in sharenames. */ | 
|---|
| 247 | #define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\"," | 
|---|
| 248 |  | 
|---|
| 249 | /* Seconds between connection attempts to a remote server. */ | 
|---|
| 250 | #define FAILED_CONNECTION_CACHE_TIMEOUT 30 | 
|---|
| 251 |  | 
|---|
| 252 | /* Default hash size for the winbindd cache. */ | 
|---|
| 253 | #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000 | 
|---|
| 254 |  | 
|---|
| 255 | /* Windows minimum lock resolution timeout in ms */ | 
|---|
| 256 | #define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200 | 
|---|
| 257 |  | 
|---|
| 258 | /* Maximum size of RPC data we will accept for one call. */ | 
|---|
| 259 | #define MAX_RPC_DATA_SIZE (15*1024*1024) | 
|---|
| 260 |  | 
|---|
| 261 | #define CLIENT_NDR_PADDING_SIZE 8 | 
|---|
| 262 | #define SERVER_NDR_PADDING_SIZE 8 | 
|---|
| 263 |  | 
|---|
| 264 | #define DEFAULT_SMB2_MAX_READ (64*1024) | 
|---|
| 265 | #define DEFAULT_SMB2_MAX_WRITE (64*1024) | 
|---|
| 266 | #define DEFAULT_SMB2_MAX_TRANSACT (64*1024) | 
|---|
| 267 | #define DEFAULT_SMB2_MAX_CREDITS 8192 | 
|---|
| 268 |  | 
|---|
| 269 | #endif | 
|---|