summaryrefslogtreecommitdiff
path: root/source3/smbd/uid.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-08-04 23:45:34 +0000
committerJeremy Allison <jra@samba.org>1998-08-04 23:45:34 +0000
commit3aeadef40b92d031036a50042bbf8fbe60d0954a (patch)
treea4f5fc93a24eb997cf3e67d2fe54ebb817031be8 /source3/smbd/uid.c
parentc0c057c0dfc43c47b2d340e26026136cf001ff0a (diff)
downloadsamba-3aeadef40b92d031036a50042bbf8fbe60d0954a.tar.gz
samba-3aeadef40b92d031036a50042bbf8fbe60d0954a.tar.bz2
samba-3aeadef40b92d031036a50042bbf8fbe60d0954a.zip
nttrans.c: Fix change_notify. Queue processing code wasn't changing to
the correct directory before doing the stat. Doh ! uid.c: Fix for performance in security=share mode. Invalid vuid meant that in security=share mode Samba was always doing the become_user/ undebome_user pairs for *every* smb. This code fixes it, but tridge should review for security implications. Jeremy. (This used to be commit c3663379fdcec487feea2e5d848ee012ee6c6baf)
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r--source3/smbd/uid.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index 82ff7ee7ce..9e669c301b 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -216,7 +216,18 @@ BOOL become_user(connection_struct *conn, int cnum, uint16 vuid)
int snum,gid;
int uid;
- if ((current_user.cnum == cnum) && (vuser != 0) && (current_user.vuid == vuid) &&
+ /*
+ * We need a separate check in security=share mode due to vuid
+ * always being UID_FIELD_INVALID. If we don't do this then
+ * in share mode security we are *always* changing uid's between
+ * SMB's - this hurts performance - Badly.
+ */
+
+ if((lp_security() == SEC_SHARE) && (current_user.cnum == cnum) &&
+ (current_user.uid == conn->uid)) {
+ DEBUG(4,("Skipping become_user - already user\n"));
+ return(True);
+ } else if ((current_user.cnum == cnum) && (vuser != 0) && (current_user.vuid == vuid) &&
(current_user.uid == vuser->uid)) {
DEBUG(4,("Skipping become_user - already user\n"));
return(True);