summaryrefslogtreecommitdiff
path: root/source3/include/local.h
AgeCommit message (Collapse)AuthorFilesLines
2026-01-07lib: Remove a few unused #definesVolker Lendecke1-32/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2023-07-05s3:include: Fix code spellingAndreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Jul 5 07:32:15 UTC 2023 on atb-devel-224
2022-12-19smbd/locking: make use of the same tdb hash_size and flags for all SMB ↵Stefan Metzmacher1-2/+6
related tdb's It's good to have a consistent set of hash_size/flags for all aspects of an open file handle. Currently we're using 4 databases: smbXsrv_open_global.tdb, leases.tdb, locking.tdb and brlock.tdb. While at it also crank up the hashsize if the smbXsrv_tcon and smbXsrv_session TDBs. The default TDB hash size is insanely small and disk space is cheap these days, by going with the much larger hash size we get O(1) lookup instead of O(n) for moderate to large loads with a few thousand objects. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Dec 19 16:40:15 UTC 2022 on sn-devel-184
2020-07-08s3:includes: change OPLOCK_BREAK_TIMEOUT from 30 to 35 secondsStefan Metzmacher1-1/+1
This is what windows is using for normal oplock and lease breaks. Note that windows uses higher values for persistent handles, they use 60 seconds for oplocks and 180 seconds for leases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2019-07-09s3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.Jeremy Allison1-1/+1
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09s3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.Jeremy Allison1-5/+0
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09s3: smbd: Remove unused DPTR_IDLE_TIMEOUT.Jeremy Allison1-1/+0
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-07param: change default of "allocation roundup size" to 0Björn Jacke1-3/+0
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-05-01smbd: Move deadtime default to parameter definition and man pageChristof Schmitt1-1/+0
The code has a default of one week (10080 minutes) if the parameter is set to 0. Make this the public default of the parameter, instead of hiding it in the code. This change also has the code match the documentation that setting this parameter to 0 disables the check. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-04-11lib/util: Move log_stack_trace() to common codeAndrew Bartlett1-3/+0
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-15winbindd: set file descriptor limit according to configurationUri Simchoni1-0/+4
Set the winbindd process file descriptor limit according to the values that affect it in the configuration: - Maximum number of clients - Number of outgoing connections per domain BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397 Signed-off-by: Uri Simchoni <urisimchoni@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2015-06-23s3:include: remove used unused {CLIENT,SERVER}_NDR_PADDING_SIZEStefan Metzmacher1-3/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11061 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-12param: move SMB2 defaults to lib/param and use in loadparm_initGarming Sam1-5/+0
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-10s3: increase default fudge factor for max open files from 20 to 40Garming Sam1-1/+1
Tests show that Samba's smbd uses 38 open files at startup. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-01-28lib/param: Move GUEST_ACCOUNT define to a common headerAndrew Bartlett1-5/+0
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2012-10-19s3:smbd: use session_global_id as session number for pam and utmpGregor Beck1-20/+0
Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-29s3:smb2_server: remove unused and confusing ↵Stefan Metzmacher1-1/+0
DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR metze
2012-06-06s3:smbd: change user_struct->vuid to uint64_tStefan Metzmacher1-1/+1
Only sconn->smb1.sessions.next_vuid remains as uint16_t, so that we do not generate larger values yet. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Jun 6 12:07:33 CEST 2012 on sn-devel-104
2012-03-09s3:smb2_server increase defaults for read/write/trans sizes to 1MBChristian Ambach1-3/+3
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-11-15s3-winbind: Increase the negative cache entry timout.Andreas Schneider1-1/+1
The timout for the cache entry of a negative connection should be the double of a connect timeout (which is 30 seconds).
2011-10-13Another part of the fix for Bug 8473 - smb2_find uses a hard coded max reply ↵Jeremy Allison1-3/+3
size of 0x10000 instead of smb2_max_trans. Change the defaults and the documentation to reflect the 64k limit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Oct 13 12:22:23 CEST 2011 on sn-devel-104
2011-07-29First part of bugfix for bug #8335 - file copy aborts with ↵Jeremy Allison1-1/+1
smb2_validate_message_id: bad message_id Set default max credits to 8192 now this has been documented in the SMB2 spec.
2011-06-29param: Merge param headers into lib/param/loadparm.hAndrew Bartlett1-29/+0
This defines a common table format, so we can in future define a common table. Andrew Bartlett
2011-03-01lib/util: new merged debug systemAndrew Bartlett1-5/+0
This is the s3 debug system, with a number of changes to tidy it up for common use. The debug class system is simplified by the removal of the ISSET table, the system no longer attempts to cope with assignment of DEBUGLEVEL, and the full class table is always available (rather than just DEBUGLEVEL_CLASS[DBCG_ALL]) from startup. It is also no longer confusingly described as a hack, but as the initial table. Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Mar 1 04:32:12 CET 2011 on sn-devel-104
2011-01-07s3-printing: Initiate pcap reload from parent smbdDavid Disseldorp1-0/+1
Since commit 7022554, smbds share a printcap cache (printer_list.tdb), therefore ordering of events between smbd processes is important when updating printcap cache information. Consider the following two process example: 1) smbd1 receives HUP or printcap cache time expiry 2) smbd1 checks whether pcap needs refresh, it does 3) smbd1 marks pcap as refreshed 4) smbd1 forks child1 to obtain cups printer info 5) smbd2 receives HUP or printcap cache time expiry 6) smbd2 checks whether pcap needs refresh, it does not (due to step 3) 7) smbd2 reloads printer shares prior to child1 completion (stale pcap) 8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1 9) smbd1 reloads printer shares based on new pcap information In this case both smbd1 and smbd2 are reliant on the pcap update performed on child1 completion. The prior commit "reload shares after pcap cache fill" ensures that smbd1 only reloads printer shares following pcap update, however smbd2 continues to present shares based on stale pcap data. This commit addresses the above problem by driving pcap cache and printer share updates from the parent smbd process. 1) smbd0 (parent) receives a HUP or printcap cache time expiry 2) smbd0 forks child0 to obtain cups printer info 3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0 4) smbd0 reloads printer shares 5) smbd0 notifies child smbds of pcap update via message_send_all() 6) child smbds read fresh pcap data and reload printer shares This architecture has the additional advantage that only a single process (the parent smbd) requests printer information from the printcap backend. Use time_mono in housekeeping functions As suggested by Björn Jacke.
2010-12-21My algorithm for determining whan an incoming sequence number can be allowed ↵Jeremy Allison1-0/+1
is incorrect. (I based it on the text in MS-SMB2, silly me :-). Fix it so incoming sequence numbers can range over the entire allowable bitmap range. This fixes a repeatable disconnect against Win7. Jeremy.
2010-12-10Add a SMB2 crediting algorithm, by default the same as Windows. Defaults to ↵Jeremy Allison1-0/+5
128 credits. Jeremy.
2010-10-24s3:include: move MAX_DEBUG_LEVEL from local.h to debug.hStefan Metzmacher1-9/+0
metze
2010-09-14Allows changing the maximum number of simultaneous clients in winbindd ↵Pierre Carrier1-3/+0
through an smb.conf option. Signed-off-by: Jeremy Allison <jra@samba.org>
2010-02-17Fix bug #7146 - Samba miss-parses authenticated RPC packets.Jeremy Allison1-0/+3
Parts of the Samba RPC client and server code misinterpret authenticated packets. DCE authenticated packets actually look like this : +--------------------------+ |header | | ... frag_len (packet len)| | ... auth_len | +--------------------------+ | | | Data payload | ... .... | | +--------------------------+ | | | auth_pad_len bytes | +--------------------------+ | | | Auth footer | | auth_pad_len value | +--------------------------+ | | | Auth payload | | (auth_len bytes long) | +--------------------------+ That's right. The pad bytes come *before* the footer specifying how many pad bytes there are. In order to read this you must seek to the end of the packet and subtract the auth_len (in the packet header) and the auth footer length (a known value). The client and server code gets this right (mostly) in 3.0.x -> 3.4.x so long as the pad alignment is on an 8 byte boundary (there are some special cases in the code for this). Tridge discovered there are some (DRS replication) cases where on 64-bit machines where the pad alignment is on a 16-byte boundary. This breaks the existing S3 hand-optimized rpc code. This patch removes all the special cases in client and server code, and allows the pad alignment for generated packets to be specified by changing a constant in include/local.h (this doesn't affect received packets, the new code always handles them correctly whatever pad alignment is used). This patch also works correctly with rpcclient using sign+seal from the 3.4.x and 3.3.x builds (testing with 3.0.x and 3.2.x to follow) so even as a server it should still work with older libsmbclient and winbindd code. Jeremy
2009-12-16Final part of the fix for 6837 - "Too many open files" when trying to access ↵Jeremy Allison1-12/+12
large number of files Win7 needs a min of 16k file handles to work against a server. Jeremy.
2009-12-02Fix bug #6837 - "Too many open files" when trying to access large number of ↵Jeremy Allison1-1/+19
files from Windows 7. Original patch by me fixed up with the correct open files number by jmaggard10@hotmail.com. Jeremy.
2009-02-13Parameterize in local.h the MAX_RPC_DATA_SIZE, and ensureJeremy Allison1-0/+3
that "offered" read from the rpc packet in spoolss is under that size. Tidyup from analysis from Veracode. Jeremy.
2008-04-07smbd: make it possible to change the write time delay for testingStefan Metzmacher1-0/+3
metze (This used to be commit df8c100c2b53575a0d425a2daf52e2d59904746a)
2007-10-10r17107: Make the 200 ms timeout value tunable in local.h...Jeremy Allison1-0/+3
Might need to be a parameter ? Jeremy. (This used to be commit 98d8d9399bb287319578daaf2a2fb42f3c48f858)
2007-10-10r14763: Add a new tuning parameter, open files database hash size,Jeremy Allison1-1/+1
this allows us to experiment with ensuring the tdb hash size for our open files and locking db are appropriately sized. Make the hash size larger by default (10007 instead of 1049) and make the locking db hash size the same as the open file db hash size. Jeremy. (This used to be commit e7225f7e813423c3e2a94af6a9d7ce8a1b50a166)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-0/+9
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r11435: Allow the hash size of the tdb open (locking) databaseJeremy Allison1-0/+3
to be set in local.h. Change from the default (131) to another prime (1049). Should this be an smb.conf tunable parameter based on the number of open file descriptors available ? If so what scaling factor ? More tests to follow. Jeremy. (This used to be commit 6a902ec49ffea5d0ca0308d5ff51584cece41043)
2007-10-10r5636: Re-add the allocation size - parameterized by share asJeremy Allison1-0/+3
"allocation roundup size", by default set as 1Mb. From advice by BlueArc about Windows client behaviour. VC++ people can set this to zero to turn it off. Jeremy. (This used to be commit 833ca101772bfab65dbd79eb64f63464177f144e)
2007-10-10r5548: Stop lying about allocation sizes to Windows clients. It was a niceJeremy Allison1-3/+0
idea, and aparently improved performance in some circumstances, but it breaks the VC++ compiler :-(. Not cool. Fix bug #2146. Jeremy. (This used to be commit b9f147634df0126320ffe3b9a23068e76f6c1681)
2007-10-10r1325: Always use GetTimeOfDay() (wrapper). Ensure ldap replicationJeremy Allison1-0/+2
sleep time is not more than 5 seconds. Should fix issue reported by Chris Garrigues <cwg@deepeddy.com>. Jeremy. (This used to be commit fbc06831d3a7e8645409158ee1ae1f9f192913a7)
2007-10-10r1085: Now it's had some proper user testing, merge in the deferred open ↵Jeremy Allison1-0/+3
fix. I'm still doing more testing, but it fixes a behaviour that we've been wrong on ever since the start of Samba. Jeremy. (This used to be commit 894cc6d16296b934c112786eec896846156aee5d)
2003-10-29parameterise the listen backlog in smbd and make it larger by default. A ↵Andrew Tridgell1-0/+3
backlog of 5 is way too small these days. (This used to be commit bbb92d2b0ea6bc10c71bed62924bfc95c11172a5)
2003-04-14Backport my backtrace patch from HEADJelmer Vernooij1-0/+4
(This used to be commit 66fcf6b4938a87e5ded7c7e5830a6a54e4439544)
2003-02-28*Excellent* patch from Michael Steffens <michael_steffens@hp.com> to limitJeremy Allison1-0/+2
the unix domain sockets used by winbindd (also solves FD_SETSIZE problem in winbindd to boot !). Adds a "last_access" field to winbindd connections, and will close the oldest idle connection once the number of open connections goes over WINBINDD_MAX_SIMULTANEOUS_CLIENTS (defined in local.h as 200 currently). Jeremy. (This used to be commit 7a586552a3aeb4a26495f0965af4bd027456a011)
2003-02-15Remove obsolete file lib/netatalk.c - We now have a vfs moduleJelmer Vernooij1-3/+0
(This used to be commit fcc7a197b1ec85f9492e335a824317a904b0c919)
2003-01-16Fixed up mutex protection around winbindd logon code. Sync with APP-HEAD.Jeremy Allison1-0/+8
Jeremy. (This used to be commit daf179bcd6297b525bfc644efb154734723f4d58)
2002-10-22Fix for systems that allow more than 65536 open files per process.Jeremy Allison1-0/+3
Jeremy. (This used to be commit 947a56ce00e552e8b8d2ed64435eabde6225f044)
2002-10-04Add a timeout to tdb_lock_bystring(). Ensure we never have more thanJeremy Allison1-0/+3
MAX_PRINT_JOBS in a queue. Jeremy. (This used to be commit 9fe3c0b90d4bff2217e3cb5a34b4683ca314c06e)
2002-09-25sync'ing up for 3.0alpha20 releaseGerald Carter1-6/+1
(This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139)