From 434d26acfe3bea62217b5ceaafc8b7b9cbe6e914 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 19 Jun 1997 00:18:23 +0000 Subject: loadparm.c: Added "force create mode" and "force directory mode" params. proto.h: Added lp_force_create_mode() and lp_force_dir_mode(). server.c: Fixed application of mode bits to be regular across files and directories. smb.h: Removed unused CREATE_MODE macro. Jeremy (jallison@whistle.com) (This used to be commit 2c928212500e1de27550d9fccb0939fd2e450515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/smbd/server.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index c808eac06a..203bdb8da8 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -130,8 +130,12 @@ void killkids(void) dos archive is represented in unix by the user's execute bit dos system is represented in unix by the group's execute bit dos hidden is represented in unix by the other's execute bit + Then apply create mask, + then add force bits. base permission for directories: dos directory is represented in unix by unix's dir bit and the exec bit + Then apply create mask, + then add force bits. ****************************************************************************/ mode_t unix_mode(int cnum,int dosmode) { @@ -144,7 +148,10 @@ mode_t unix_mode(int cnum,int dosmode) /* We never make directories read only for the owner as under DOS a user can always create a file in a read-only directory. */ result |= (S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH | S_IWUSR); + /* Apply directory mask */ result &= lp_dir_mode(SNUM(cnum)); + /* Add in force bits */ + result |= lp_force_dir_mode(SNUM(cnum)); } else { if (MAP_ARCHIVE(cnum) && IS_DOS_ARCHIVE(dosmode)) result |= S_IXUSR; @@ -155,7 +162,10 @@ mode_t unix_mode(int cnum,int dosmode) if (MAP_HIDDEN(cnum) && IS_DOS_HIDDEN(dosmode)) result |= S_IXOTH; - result &= CREATE_MODE(cnum); + /* Apply mode mask */ + result &= lp_create_mode(SNUM(cnum)); + /* Add in force bits */ + result |= lp_force_create_mode(SNUM(cnum)); } return(result); } -- cgit