From 0a771a4f0be14070613d252717c1b4707270f5dc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 28 Aug 2002 17:01:17 +0000 Subject: fix file_is_special test, was wrong. (This used to be commit 850d6573aedea6499b2f2fe9d1426083aebd9fd1) --- source3/smbd/dir.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 0e68d89aa7..bdcb4b0461 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -775,9 +775,17 @@ static BOOL user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_ static BOOL file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst) { + /* + * If user is a member of the Admin group + * we never hide files from them. + */ + + if (conn->admin_user) + return True; + /* If we can't stat it does not show it */ if (!VALID_STAT(*pst) && (vfs_stat(conn, name, pst) != 0)) - return False; + return True; if (S_ISREG(pst->st_mode) || S_ISDIR(pst->st_mode) || S_ISLNK(pst->st_mode)) return False; @@ -868,7 +876,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) if (entry || asprintf(&entry, "%s/%s/%s", conn->origpath, name, n) > 0) { ret = file_is_special(conn, entry, &st); } - if (!ret) { + if (ret) { SAFE_FREE(entry); continue; } -- cgit