summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
* s3: Abstract access to sessionid.tdb, similar to conn_tdb.cVolker Lendecke2010-03-014-72/+18
|
* s3: Add connections_forall_read()Volker Lendecke2010-03-011-3/+2
| | | | | | In a cluster, this makes a large difference: For r/w traverse, we have to do a fetch_locked on every record which for most users of connections_forall is just overkill.
* s3: Remove unused "mypid" from count_current_connections() stateVolker Lendecke2010-03-011-2/+0
|
* s3: Use talloc_tos() in yield_connection()Volker Lendecke2010-02-281-1/+2
|
* s3: Remove unused count_all_current_connections()Volker Lendecke2010-02-281-9/+0
|
* Fix up debug info on smb2_rename code.Jeremy Allison2010-02-251-9/+3
| | | | Jeremy.
* Implement rename/move in SMB2 from Windows7.Jeremy Allison2010-02-252-1/+111
| | | | Jeremy.
* Make conn_close_all() safe to call from SMB2 sessions (fix crash bug).Jeremy Allison2010-02-242-10/+23
| | | | | | | | Ensure we don't call close_cnum() with SMB2, also talloc_move the compat_conn pointer from the NULL context onto the tcon context in SMB2 as it's conceptually owned by that pointer. Jeremy.
* Change the credential handling so that we start with maxmux creds,Jeremy Allison2010-02-241-7/+10
| | | | | | | | and then return to the client the number of credits per operation that they asked for. This is a more sensible algorithm than just blindly returning "20" on every reply, although we will probably still need more changes to this going forward. Jeremy.
* s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke2010-02-232-2/+2
|
* Fix bug #7155 - valgrind Conditional jump or move depends on uninitialised ↵Jeremy Allison2010-02-181-0/+1
| | | | | | | | | | value(s) error when "mangling method = hash" The charset array allocated in init_chartest() is allocated by MALLOC, but only some elements of it being set after allocation. Fix is to memset to zero after allocation. Jeremy.
* Fix bug #7154 - mangling method = hash can crash storing a name not ↵Jeremy Allison2010-02-181-3/+5
| | | | | | | | | containing a '.' Fix use of uninitialized variable. This can lead to crashes if mangling = hash processes names with no '.'. Jeremy.
* Fix bug #6557 - Do not work VFS full_auditJeremy Allison2010-02-171-51/+34
| | | | | | | | | | | Re-arrange the operations order so SMB_VFS_CONNECT is done first as root (to allow modules to correctly initialize themselves). Reviewed modules to check if they needed CONNECT invoked as a user (which we previously did) and it turns out any of them that cared needed root permissions anyway. Jeremy.
* s3: Fix bug 7139Volker Lendecke2010-02-171-2/+32
| | | | | To provide the user with the same SID when doing Kerberos logins, attempt to do a make_server_info_sam instead of a make_server_info_pw.
* s3-smbd: convert lanman and notify code to TYPESAFE_QSORT()Andrew Tridgell2010-02-142-12/+4
|
* s3: Fix a C++ warningVolker Lendecke2010-02-131-1/+1
|
* Use sec_initial_uid() in the places where being root doesn't matter,Jeremy Allison2010-02-121-1/+1
| | | | | | and 0 in the places where it does. Jeremy
* Simplify the logic in make_connection_snum(), and make it match Windows ↵Jeremy Allison2010-02-121-41/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | behavior. Cause all exit paths to go through one place, where all cleanup is done. change_to_root_user() for pathname operations that should succeed if the path exists, even if the connecting user has no access. For example, a share can now be defined with a path of /root/only/access (where /root/only/access is a directory path with all components only accessible to root e.g. root owned, permissions 700 on every component). Non-root users will now correctly connect, but get ACCESS_DENIED on all activities (which matches Windows behavior). Previously, non-root users would get NT_STATUS_BAD_NETWORK_NAME on doing a TConX to this share, even though it's a perfectly valid share path (just not accessible to them). This change was inspired by the research I did for bug #7126, which was reported by bepi@adria.it. As this is a change in a core function, I'm proposing to leave this only in master for 3.6.0, not back-port to any existing releases. This should give us enough time to decide if this is the way we want this to behave (as Windows) or if we prefer the previous behavior. Jeremy.
* s3/smbd: change locking behavior when "lock spin time = 0".Steven Danneman2010-02-122-7/+16
| | | | | | | | | | | | | | | | | | | | | The "lock spin time" parameter mimics the following Windows setting which by default is 250ms in Windows and 200ms in Samba. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\LockViolationDelay When a client sends repeated, non-blocking, contending BRL requests to a Windows server, after the first Windows starts treating these requests as timed blocking locks with the above timeout. As an efficiency, I've changed the behavior when this setting is 0, to skip this logic and treat all requests as non-blocking locks. This gives the smbd server behavior similar to the 3.0 release with the do_spin_lock() implementation. I've also changed the blocking lock parameter in the call from push_blocking_lock_request() to true as all requests made in this path are blocking by definition.
* Remove #if SOFTLINK_OPTIMIZATION code.Jeremy Allison2010-02-121-17/+0
| | | | | | This hasn't been turned on or been capable of doing so for many years now. Makes this jumbo function smaller... Jeremy.
* Revert "Fix bug #7126 - [SMBD] With access denied error smbd return wrong ↵Jeremy Allison2010-02-121-16/+9
| | | | | | | | | | | NT_STATUS_OBJECT_PATH_INVALID error" This reverts commit 2fdd8b10c6abadd27c579e772c0482214d2363a5. This fix is incorrect. The original code works as desired, I made a mistake here. Jeremy.
* Fix bug #7126 - [SMBD] With access denied error smbd return wrong ↵Jeremy Allison2010-02-121-9/+16
| | | | | | | | | | | | NT_STATUS_OBJECT_PATH_INVALID error As tridge's comment says, we should be ignoring ACCESS_DENIED on the share path in a TconX call, instead allowing the mount and having individual SMB calls fail (as Windows does). The original code erroneously caught SMB_VFS_STAT != 0 and errored out on that. Jeremy.
* s3: notify_onelevel does not use seqnums, so don't open asking for itVolker Lendecke2010-02-121-1/+1
|
* Remove the code replaced by widelinks warning.Jeremy Allison2010-02-111-7/+0
| | | | Jeremy.
* Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from ↵Jeremy Allison2010-02-113-6/+7
| | | | | | | | Volker. Create widelinks_warning(int snum) to cover the message needed in make_connection. Jeremy.
* Final part of jumbo patch for bug #7104 - "wide links" and "unix extensions" ↵Jeremy Allison2010-02-111-0/+12
| | | | | | | | | | | are incompatible. Volker pointed out that the preexec scripts get passed the conn->connectpath as a parameter, so call canonicalize_connect_path() both *before* and after the preexec scripts. Ignore errors on the call before the preexec scripts, as the path may not exist until created by the preexec scripts. Jeremy.
* Introduce lp_safe_widelinks()Simo Sorce2010-02-113-5/+7
| | | | | This way we avoid any chance that a configuration reload may turn back on wide links when unix extensions are enabled.
* Fine changes to previous fix for bug #7104 - "wide links" and "unix ↵Jeremy Allison2010-02-111-20/+18
| | | | | | | | | | extensions" are incompatible. Make sure we match the previous allow widelinks behavior, in that non-root preexec scripts can create share directories for a share definition. Jeremy
* Suplementary patch for bug #7104 - "wide links" and "unix extensions" are ↵Jeremy Allison2010-02-111-27/+28
| | | | | | | | | | | | | | | | | | | | | incompatible. Bug reported by Ralf Zimmermann <r.zimmermann@siegnetz.de>. Reproduced by jra. If the target directory of a share doesn't exist, but is designed to be created by a "root preexec" script call, then the widelinks check is done too early - thus preventing the user from connecting to the share. Fix is to re-arrange the order of checks in make_connection_snum() to always do the following order of operations: (1). Turn off wide links if unix extensions = yes. (2). Call any root preexec scripts. (3). Canonicalize the share path to remove any symlinks (ie. end up with the realpath in the connection_struct). Jeremy.
* s3-smbd: update to use new DLIST macrosAndrew Tridgell2010-02-102-6/+5
| | | | (cherry picked from commit 365b408c458c848a818637d9b36a0423aeb1ba54)
* Fix bug #7122 - Reading a large browselist fails (server returns invalid ↵Jeremy Allison2010-02-092-3/+6
| | | | | | | | | | | | | | values in subsequent SMBtrans replies) There are two problems: 1). The server is off-by-one in the end of buffer space test. 2). The server returns 0 in the totaldata (smb_vwv1) and totalparams (smb_vwv0) fields in the second and subsequent SMBtrans replies. This patch fixes both. Jeremy.
* s3:smbd: use StrCaseCmp() instead of strcasecmpStefan Metzmacher2010-02-091-4/+3
| | | | metze
* s3:smbd: Fix really ugly bool vs. int bug!!!Stefan Metzmacher2010-02-091-2/+2
| | | | | | | | A comparison function for qsort needs to return an 'int'! Otherwise you'll get random results depending on the compiler and the architecture... metze
* s3:smbd: implement api_RNetServerEnum3Stefan Metzmacher2010-02-081-1/+212
| | | | | | This is needed to support large browse lists. metze
* s3:smbd: add/improve some DEBUG messages in api_RNetServerEnum2()Stefan Metzmacher2010-02-081-4/+6
| | | | metze
* s3:smbd: rename api_RNetServerEnum => api_RNetServerEnum2Stefan Metzmacher2010-02-081-3/+3
| | | | metze
* Fix trailing whitespace errors I added (sorry).Jeremy Allison2010-02-052-5/+5
| | | | Jeremy.
* s3-smbd: add a rate limited cleanup of brl, connections and locking dbAndrew Tridgell2010-02-051-6/+42
| | | | | | | | | | | On unclean shutdown we can end up with stale entries in the brlock, connections and locking db. Previously we would do the cleanup on every unclean exit, but that can cause smbd to be completely unavailable for several minutes when a large number of child smbd processes exit. This adds a rate limited cleanup of the databases, with the default that cleanup happens at most every 20s
* s3-brlock: we don't need these MSG_SMB_UNLOCK calls nowAndrew Tridgell2010-02-051-2/+0
| | | | These have been replaced with the min timeout in blocking.c
* s3-brlock: add a minimim retry time for pending blocking locksAndrew Tridgell2010-02-051-0/+20
| | | | | | | | | | | | | | | | | When we are waiting on a pending byte range lock, another smbd might exit uncleanly, and therefore not notify us of the removal of the lock, and thus not trigger the lock to be retried. We coped with this up to now by adding a message_send_all() in the SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to all smbd processes. That would generate O(N^2) work when a large number of clients disconnected at once (such as on a network outage), which could leave the whole system unusable for a very long time (many minutes, or even longer). By adding a minimum re-check time for pending byte range locks we avoid this problem by ensuring that pending locks are retried at a more regular interval.
* Remove now unused variable.Jeremy Allison2010-02-051-1/+0
| | | | Jeremy.
* Fix bug 7104 - "wide links" and "unix extensions" are incompatible.Jeremy Allison2010-02-053-37/+9
| | | | | | | | | | | | | | | Change parameter "wide links" to default to "no". Ensure "wide links = no" if "unix extensions = yes" on a share. Fix man pages to refect this. Remove "within share" checks for a UNIX symlink set - even if widelinks = no. The server will not follow that link anyway. Correct DEBUG message in check_reduced_name() to add missing "\n" so it's really clear when a path is being denied as it's outside the enclosing share path. Jeremy.
* Add debug to make it clear when EA dosmode set is invoked.Jeremy Allison2010-02-011-0/+5
| | | | Jeremy.
* Fix bug #7084 - Create time on directories not stored properly in an EA in ↵Jeremy Allison2010-02-011-7/+0
| | | | | | | | | | new create time code. Remove erroneous optimisation that caused no EA to be set if calculated btime matched st_ex btime, and calculated DOS attribute matched existing file attribute. Jeremy.
* Arg. Got the sense of the test reversed to fix bug #7080 - Quota only shown ↵Jeremy Allison2010-02-011-1/+1
| | | | | | when logged as root.. Doh ! Jeremy.
* Fix bug #7080 - Quota only shown when logged as root.Jeremy Allison2010-02-011-1/+1
| | | | | | | | | | | conn->server_info->utok.uid == 0 isn't the correct check to see if we're root anymore. As rpc_samr_nt.c does, the correct check is : geteuid() == sec_initial_uid() Jeremy.
* s3/smbd: Fix string buffer overflow causing heap corruptionSteven Danneman2010-01-301-1/+2
| | | | | | | | | | | | | The destname malloc size was not taking into account the 1 extra byte needed if a string without a leading '/' was passed in and that slash was added. This would cause the '\0' byte to be written past the end of the malloced destname string and corrupt whatever heap memory was there. This problem would be hit if a share name was given in smb.conf without a leading '/' and if it was the exact size of the allocated STRDUP memory which in some implementations of malloc is a power of 2.
* Fix bug #7067 - Linux asynchronous IO (aio) can cause smbd to fail to ↵Jeremy Allison2010-01-261-0/+8
| | | | | | | | | respond to a read or write. Only works on Linux kernels 2.6.26 and above. Grants CAP_KILL capability to allow Linux threads under different euids to send signals to each other. Jeremy.
* Correct fix for unused variable return from ndr_decode. Use it :-).Jeremy Allison2010-01-251-0/+8
| | | | Jeremy.
* Revert "s3: remove unused Variable"Jeremy Allison2010-01-251-0/+4
| | | | | | | | | This reverts commit 9536d94d5478b63fc05047964b40d8786a7246c4. Bjorn, your change removed the ndr_decoding of the dos attribute. Not a good idea :-). Jeremy.