summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-06-15 11:39:31 +0200
committerVolker Lendecke <vl@samba.org>2008-06-15 11:39:31 +0200
commit704c99f34022170d613e17262c842cd8989049ee (patch)
treeca4c6c3d94aadd8287fa22887ec2afc727fe08fa
parent3fde7f5979fdf3f72df330a0c6977f677cca8a30 (diff)
downloadsamba-704c99f34022170d613e17262c842cd8989049ee.tar.gz
samba-704c99f34022170d613e17262c842cd8989049ee.tar.bz2
samba-704c99f34022170d613e17262c842cd8989049ee.zip
Remove the reference to current_user from file_access.c
conn holds the current user info (This used to be commit 093bc5f2b33ebf90e04bc17e51b1695b1b932bf2)
-rw-r--r--source3/smbd/file_access.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index 71f3291b9b..f72d6d1292 100644
--- a/source3/smbd/file_access.c
+++ b/source3/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;