smbd: Use wire_perms_to_unix in unix_perms_from_wire
authorVolker Lendecke <vl@samba.org>
Fri, 9 Nov 2018 06:55:40 +0000 (07:55 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 13 Nov 2018 03:10:54 +0000 (04:10 +0100)
Same code, less lines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 13 04:10:54 CET 2018 on sn-devel-144

source3/smbd/trans2.c

index 0003c3682e3cce33866d30dbc94159ed130c755d..6ec319ce870784045c6caa028a2f904e63e760a4 100644 (file)
@@ -1530,24 +1530,7 @@ static NTSTATUS unix_perms_from_wire( connection_struct *conn,
                }
        }
 
-       ret |= ((perms & UNIX_X_OTH ) ? S_IXOTH : 0);
-       ret |= ((perms & UNIX_W_OTH ) ? S_IWOTH : 0);
-       ret |= ((perms & UNIX_R_OTH ) ? S_IROTH : 0);
-       ret |= ((perms & UNIX_X_GRP ) ? S_IXGRP : 0);
-       ret |= ((perms & UNIX_W_GRP ) ? S_IWGRP : 0);
-       ret |= ((perms & UNIX_R_GRP ) ? S_IRGRP : 0);
-       ret |= ((perms & UNIX_X_USR ) ? S_IXUSR : 0);
-       ret |= ((perms & UNIX_W_USR ) ? S_IWUSR : 0);
-       ret |= ((perms & UNIX_R_USR ) ? S_IRUSR : 0);
-#ifdef S_ISVTX
-       ret |= ((perms & UNIX_STICKY ) ? S_ISVTX : 0);
-#endif
-#ifdef S_ISGID
-       ret |= ((perms & UNIX_SET_GID ) ? S_ISGID : 0);
-#endif
-#ifdef S_ISUID
-       ret |= ((perms & UNIX_SET_UID ) ? S_ISUID : 0);
-#endif
+       ret = wire_perms_to_unix(perms);
 
        if (ptype == PERM_NEW_FILE) {
                /*