]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Slightly simplify unix_perms_from_wire()
authorVolker Lendecke <vl@samba.org>
Fri, 20 Sep 2024 19:01:52 +0000 (21:01 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2024 15:22:46 +0000 (15:22 +0000)
Avoid an else-branch, we return before

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb2_trans2.c

index de0105e5c212be40ddfcf3e03b77a25332ab5f0a..29c1ce44bb2a4e86294791df8a724ec2c1e9e393 100644 (file)
@@ -902,10 +902,9 @@ NTSTATUS unix_perms_from_wire(connection_struct *conn,
        if (perms == SMB_MODE_NO_CHANGE) {
                if (!VALID_STAT(*psbuf)) {
                        return NT_STATUS_INVALID_PARAMETER;
-               } else {
-                       *ret_perms = psbuf->st_ex_mode;
-                       return NT_STATUS_OK;
                }
+               *ret_perms = psbuf->st_ex_mode;
+               return NT_STATUS_OK;
        }
 
        ret = wire_perms_to_unix(perms);