diff options
author | Simo Sorce <idra@samba.org> | 2002-07-29 09:44:29 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2002-07-29 09:44:29 +0000 |
commit | 8c85675b075404a333c8cc3d653b949e33ddc6a8 (patch) | |
tree | a86e15bfeda65805c2d973645648c867c3fc4bee /source3 | |
parent | 3a99ab6aa546b3cf67fdece29e46dec5c9817271 (diff) | |
download | samba-8c85675b075404a333c8cc3d653b949e33ddc6a8.tar.gz samba-8c85675b075404a333c8cc3d653b949e33ddc6a8.tar.bz2 samba-8c85675b075404a333c8cc3d653b949e33ddc6a8.zip |
as suggested by Alexander Oswald <oswald@is.haw-hamburg.de>
hide only unwriteable files and not dirs with this one.
may be a hide unwriteable dirs param will follow.
(This used to be commit 161dd6d963ea1c11891278af2483c925e508767e)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/param/loadparm.c | 8 | ||||
-rw-r--r-- | source3/smbd/dir.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 64542cd153..bb97d72d34 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -339,7 +339,7 @@ typedef struct BOOL bCaseMangle; BOOL bHideDotFiles; BOOL bHideUnReadable; - BOOL bHideUnWriteable; + BOOL bHideUnWriteableFiles; BOOL bBrowseable; BOOL bAvailable; BOOL bRead_only; @@ -458,7 +458,7 @@ static service sDefault = { False, /* case mangle */ True, /* bHideDotFiles */ False, /* bHideUnReadable */ - False, /* bHideUnable */ + False, /* bHideUnWriteableFiles */ True, /* bBrowseable */ True, /* bAvailable */ True, /* bRead_only */ @@ -877,7 +877,7 @@ static struct parm_struct parm_table[] = { {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide unwriteable", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, @@ -1667,7 +1667,7 @@ FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve) FN_LOCAL_BOOL(lp_casemangle, bCaseMangle) FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles) FN_LOCAL_BOOL(lp_hideunreadable, bHideUnReadable) -FN_LOCAL_BOOL(lp_hideunwriteable, bHideUnWriteable) +FN_LOCAL_BOOL(lp_hideunwriteable_files, bHideUnWriteableFiles) FN_LOCAL_BOOL(lp_browseable, bBrowseable) FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 01e3063b67..1a18476b75 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -722,7 +722,8 @@ static BOOL user_can_read_file(connection_struct *conn, char *name) } /******************************************************************* -check to see if a user can write a file. This is only approximate, +check to see if a user can write a file (and only files, we do not +check dirs on this one). This is only approximate, it is used as part of the "hide unwriteable" option. Don't use it for anything security sensitive ********************************************************************/ @@ -756,8 +757,7 @@ static BOOL user_can_write_file(connection_struct *conn, char *name) /* Pseudo-open the file (note - no fd's created). */ if(S_ISDIR(ste.st_mode)) - fsp = open_directory(conn, name, &ste, 0, SET_DENY_MODE(DENY_NONE), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), - unix_mode(conn, aDIR, name), &smb_action); + return True; else fsp = open_file_shared1(conn, name, &ste, FILE_WRITE_ATTRIBUTES, SET_DENY_MODE(DENY_NONE), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, 0, &access_mode, &smb_action); @@ -838,7 +838,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) } /* Honour _hide unwriteable_ option */ - if (normal_entry && conn && lp_hideunwriteable(SNUM(conn))) { + if (normal_entry && conn && lp_hideunwriteable_files(SNUM(conn))) { char *entry; int ret=0; |