summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-15 12:24:06 -0700
committerJeremy Allison <jra@samba.org>2010-03-15 14:49:26 -0700
commit33bd9b4bb901d08c3c9479bef0a748bb7f5f5fa7 (patch)
tree5de67b6204021498b51fa7f7ea5c5757733d547b
parentb32ce075f8b5a3a2ab0a72ffed16924cda90f423 (diff)
downloadsamba-33bd9b4bb901d08c3c9479bef0a748bb7f5f5fa7.tar.gz
samba-33bd9b4bb901d08c3c9479bef0a748bb7f5f5fa7.tar.bz2
samba-33bd9b4bb901d08c3c9479bef0a748bb7f5f5fa7.zip
Remove reference to conn->admin_user in preparation for removal.
We use (uid_t)0 here not sec_initial_uid() as make test uses a single user context. I will revisit this when all the uid check changes are complete. Jeremy.
-rw-r--r--source3/smbd/dir.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index b1e9734681..69c5d7534a 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1127,11 +1127,12 @@ static bool user_can_read_file(connection_struct *conn,
struct smb_filename *smb_fname)
{
/*
- * If user is a member of the Admin group
- * we never hide files from them.
+ * Never hide files from the root user.
+ * We use (uid_t)0 here not sec_initial_uid()
+ * as make test uses a single user context.
*/
- if (conn->admin_user) {
+ if (get_current_uid(conn) == (uid_t)0) {
return True;
}
@@ -1149,11 +1150,12 @@ static bool user_can_write_file(connection_struct *conn,
const struct smb_filename *smb_fname)
{
/*
- * If user is a member of the Admin group
- * we never hide files from them.
+ * Never hide files from the root user.
+ * We use (uid_t)0 here not sec_initial_uid()
+ * as make test uses a single user context.
*/
- if (conn->admin_user) {
+ if (get_current_uid(conn) == (uid_t)0) {
return True;
}
@@ -1176,12 +1178,14 @@ static bool file_is_special(connection_struct *conn,
const struct smb_filename *smb_fname)
{
/*
- * If user is a member of the Admin group
- * we never hide files from them.
+ * Never hide files from the root user.
+ * We use (uid_t)0 here not sec_initial_uid()
+ * as make test uses a single user context.
*/
- if (conn->admin_user)
+ if (get_current_uid(conn) == (uid_t)0) {
return False;
+ }
SMB_ASSERT(VALID_STAT(smb_fname->st));