summaryrefslogtreecommitdiffstats
path: root/source3/smbd/service.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove the bool admin_user from conn struct. We no longer look at this to ↵Jeremy Allison2010-03-151-1/+0
| | | | | | make access decisions. Jeremy.
* s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke2010-02-231-1/+1
|
* 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 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.
* 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.
* 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-111-4/+5
| | | | | | | | 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-111-3/+5
| | | | | 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.
* Fix bug 7104 - "wide links" and "unix extensions" are incompatible.Jeremy Allison2010-02-051-0/+8
| | | | | | | | | | | | | | | 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.
* 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.
* streamline some log levels for invalid servicenamesChristian Ambach2009-12-061-1/+1
| | | | | | | | | | | | I don't think we need to log the fact that a user gave a wrong sharename in Explorer with the highest log level. The level of this was not very consistent: service.c: DEBUG(3,("find_service() failed to find service %s\n", service)); service.c: DEBUG(0,("%s (%s) couldn't find service %s\n", smb2_tcon.c: DEBUG(1,("smbd_smb2_tree_connect: couldn't find service %s\n", This changes the last two to 3 as the first one. Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
* Fix for CVE-2009-2813.Jeremy Allison2009-10-011-1/+5
| | | | | | | | | | | | | | | =========================================================== == Subject: Misconfigured /etc/passwd file may share folders unexpectedly == == CVE ID#: CVE-2009-2813 == == Versions: All versions of Samba later than 3.0.11 == == Summary: If a user in /etc/passwd is misconfigured to have == an empty home directory then connecting to the home == share of this user will use the root of the filesystem == as the home directory. ===========================================================
* Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison2009-08-241-18/+1
| | | | | | | | Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
* Log debug message when hires timestamps are available on theJeremy Allison2009-08-211-0/+4
| | | | | share. Jeremy.
* Fix bug 6529 - Offline files conflict with Vista and Office 2003Jeremy Allison2009-08-211-0/+13
| | | | | | | | On filesystems that can't store less than one second timestamps, round the incoming timestamp set requests so the client can't discover that a time set request has been truncated by the filesystem. Needs backporting to 3.4, 3.3, 3.2 and (even) 3.0. Jeremy
* s3:smbd: remove dirptr and dirpath from connection_structStefan Metzmacher2009-08-071-2/+0
| | | | | | | They're both only used in the context of a function, so we can make them stack variables. metze
* s3:smbd: add a smbd_server_connection pointer to connection_structStefan Metzmacher2009-08-071-17/+16
| | | | | | | This can be NULL for faked connection structs used in the rpc server or printing code. metze
* do not log chdir with level 0 if reason is access deniedChristian Ambach2009-07-211-2/+2
| | | | | | | | | | | | | this changes the level of logs caused by users trying to access shares or subdirectories for which they do not have access to in the ACL this can fill up the samba log even with log level 0 and is more an expected kind of logs that IMHO should not be logged with such a high level. All other errors while chdir() will still be logged with level 0 Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
* Revert this commit :Jeremy Allison2009-07-141-80/+0
| | | | | | | | | | | s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect. For now. This is a feature request and I think we need to design it a little differently so as not to touch core change_to_user() code. Jeremy.
* s3: Make smbd aware of permission change of usershare. Since usershare are ↵Bo Yang2009-07-151-0/+80
| | | | relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect.
* s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty2009-06-241-6/+12
| | | | | | | | | | | | | This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
* s3:smbd: make make_connection_snum() non staticStefan Metzmacher2009-06-031-2/+1
| | | | metze
* s3:smbd: move tcon specific globals to struct smbd_server_connectionStefan Metzmacher2009-06-031-18/+19
| | | | metze
* s3:smbd: move more session specific globals to struct smbd_server_connectionStefan Metzmacher2009-06-031-17/+25
| | | | metze
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
* Increase debug level of "create_connection_server_info failed" messageVolker Lendecke2009-05-041-1/+1
| | | | | I don't think we should unconditionally send every refused connection attempt to a share to syslog, that's where all debug level 0 messages end up.
* s3:smbd/service: switch load_registry_service/shares to use loadparm routinesMichael Adam2009-04-291-70/+3
| | | | | | | | | | | instead of reading the registry directly with tdb and activating the configure options by hand. This eliminates the need for repeating checks done in loadparm. For instance it disables registry shares without path in the server as is the case with text based shares. Michael
* s3:smbd: use new simplified snb_signing code in the serverStefan Metzmacher2009-03-231-1/+1
| | | | | | | | | We keep the seqnum/mid mapping in the smb_request structure. This also moves one global variable into the smbd_server_connection struct. metze
* Fix bug #6155 - "force group" is no longer working as expected.Jeremy Allison2009-03-031-0/+8
| | | | | | | We need to store the "force group" uid separately from the conn->server_info token as we need to apply it separately also. Volker PLEASE CHECK ! Jeremy.
* s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher2009-01-081-2/+1
| | | | | | The goal is to move all this variables into a big context structure. metze
* smbd: prevent access to root filesystem when connecting with empty service nameMichael Adam2009-01-051-0/+4
| | | | | | | | This only applies to a setup with "registry shares = yes" Michael (cherry picked from commit 288fa94ac7cfdf7457b5098c33fc840bed3d5410) (cherry picked from commit e85526b184e66f86b7faa9d0a37288a09c12c19e)
* Remove unused make_connection_with_chdir()Volker Lendecke2008-11-241-32/+0
|
* Remove smb_np_structVolker Lendecke2008-10-131-4/+3
|
* Fix a debug messageVolker Lendecke2008-06-261-1/+1
| | | | (This used to be commit 8dd94d448bc5ad067024c56c6ef498bc88a396b2)
* Wrap the unix token info in a unix_user_token in auth_serversupplied_infoVolker Lendecke2008-06-191-6/+6
| | | | | No functional change, this is a preparation for more current_user ref removal (This used to be commit dcaedf345e62ab74ea87f0a3fa1e3199c75c5445)
* Re-enable the evil "aio write behind" parameter.Jeremy Allison2008-05-261-0/+2
| | | | | Jeremy. (This used to be commit 5d22ca00bcdf49dcb35468400ac8cc3c57808d0d)
* Remove some references to get_current_username() and current_user_infoVolker Lendecke2008-05-251-10/+10
| | | | (This used to be commit 344d69f95e217d16213eaa6b53141af6ab459708)
* Remove the reference to current_user_info from share_access.cVolker Lendecke2008-05-251-0/+1
| | | | | This required to pass around the domain a bit (This used to be commit 17b0db20d28d1b737c5e86b78106657e8ca5ce9c)
* Remove "user" from connection_structVolker Lendecke2008-05-101-10/+15
| | | | (This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5)
* Remove the unix token info from connection_structVolker Lendecke2008-05-101-7/+10
| | | | (This used to be commit 2834dacc8d49f77fe55fb5d7e3eb2dda431d1d3d)
* Replace nt_user_token with server_info in connection_structVolker Lendecke2008-05-101-24/+4
| | | | (This used to be commit a3738aef59e97d4533010b048534d937d36c0950)
* find_forced_group can directly change the token in server_infoVolker Lendecke2008-05-101-72/+16
| | | | | | Now that we have a token that is correctly set up with gids already, this saves manual translation of the SIDs to GIDs. (This used to be commit 6136a6d9d7301c65f37e2bf485681138cddd8bd2)
* Add an error return in find_forced_group()Volker Lendecke2008-05-101-0/+5
| | | | (This used to be commit 93ce0705c14f222bda3e6204f4b54ba1893f33e1)