From 84b8bddd7d6845f389444e57d2029f2a954dfcd5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 24 Aug 2013 18:44:28 -0700 Subject: Revert "Fix the erroneous masking of chmod requests via the UNIX extensions." Pushed from the wrong branch - this is the version without Simo's review changes. Apologies to all and I'll re-submit in less of a haste after the weekend. This reverts commit f124d6fbcd0a03bbd95d69477c144f475546de66. Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104 --- source3/smbd/trans2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index bafd3f76dd..e7c0da1c20 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1392,15 +1392,20 @@ static NTSTATUS unix_perms_from_wire( connection_struct *conn, ret |= ((perms & UNIX_SET_UID ) ? S_ISUID : 0); #endif - if (ptype == PERM_NEW_FILE) { + switch (ptype) { + case PERM_NEW_FILE: + case PERM_EXISTING_FILE: /* Apply mode mask */ ret &= lp_create_mask(SNUM(conn)); /* Add in force bits */ ret |= lp_force_create_mode(SNUM(conn)); - } else if (ptype == PERM_NEW_DIR) { + break; + case PERM_NEW_DIR: + case PERM_EXISTING_DIR: ret &= lp_dir_mask(SNUM(conn)); /* Add in force bits */ ret |= lp_force_dir_mode(SNUM(conn)); + break; } *ret_perms = ret; -- cgit