From: Jeremy Allison Date: Sun, 25 Aug 2013 01:44:28 +0000 (-0700) Subject: Revert "Fix the erroneous masking of chmod requests via the UNIX extensions." X-Git-Tag: talloc-2.1.0~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84b8bddd7d6845f389444e57d2029f2a954dfcd5;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index bafd3f76dd2..e7c0da1c20b 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;