From 093bc5f2b33ebf90e04bc17e51b1695b1b932bf2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Jun 2008 11:39:31 +0200 Subject: [PATCH] Remove the reference to current_user from file_access.c conn holds the current user info --- source/smbd/file_access.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/smbd/file_access.c b/source/smbd/file_access.c index 71f3291b9ba..f72d6d12922 100644 --- a/source/smbd/file_access.c +++ b/source/smbd/file_access.c @@ -20,8 +20,6 @@ #include "includes.h" -extern struct current_user current_user; - #undef DBGC_CLASS #define DBGC_CLASS DBGC_ACLS @@ -44,7 +42,7 @@ bool can_access_file_acl(struct connection_struct *conn, return false; } - result = se_access_check(secdesc, current_user.nt_user_token, + result = se_access_check(secdesc, conn->server_info->ptok, access_mask, &access_granted, &status); TALLOC_FREE(secdesc); return result; @@ -81,13 +79,13 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname) if (!S_ISDIR(sbuf.st_mode)) { return False; } - if (current_user.ut.uid == 0 || conn->admin_user) { + if (conn->server_info->uid == 0 || conn->admin_user) { /* I'm sorry sir, I didn't know you were root... */ return True; } /* Check primary owner write access. */ - if (current_user.ut.uid == sbuf.st_uid) { + if (conn->server_info->uid == sbuf.st_uid) { return (sbuf.st_mode & S_IWUSR) ? True : False; } @@ -108,7 +106,7 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname) * for bug #3348. Don't assume owning sticky bit * directory means write access allowed. */ - if (current_user.ut.uid != sbuf_file.st_uid) { + if (conn->server_info->uid != sbuf_file.st_uid) { return False; } } @@ -137,7 +135,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT DEBUG(10,("can_access_file_data: requesting 0x%x on file %s\n", (unsigned int)access_mask, fname )); - if (current_user.ut.uid == 0 || conn->admin_user) { + if (conn->server_info->uid == 0 || conn->admin_user) { /* I'm sorry sir, I didn't know you were root... */ return True; } @@ -150,7 +148,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT } /* Check primary owner access. */ - if (current_user.ut.uid == psbuf->st_uid) { + if (conn->server_info->uid == psbuf->st_uid) { switch (access_mask) { case FILE_READ_DATA: return (psbuf->st_mode & S_IRUSR) ? True : False; -- 2.11.4.GIT