]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Fix CID 1518901 Logically dead code
authorVolker Lendecke <vl@samba.org>
Thu, 5 Jan 2023 14:17:14 +0000 (15:17 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 5 Jan 2023 17:04:34 +0000 (17:04 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb1_trans2.c

index 0a6156d45e00d72f4d6545ef8c17c1f56a9b92a4..ceb9257595510040a961665f1b2ca005e0104e42 100644 (file)
@@ -4409,7 +4409,6 @@ static void call_trans2setpathinfo(
        struct files_struct *fsp = NULL;
        char *params = *pparams;
        uint32_t ucf_flags = ucf_flags_from_smb_request(req);
-       bool require_existing_object = true;
        NTTIME twrp = 0;
        char *fname = NULL;
        bool info_level_handled;
@@ -4567,30 +4566,6 @@ static void call_trans2setpathinfo(
         */
        fsp = smb_fname->fsp;
 
-       /*
-        * There are 4 info levels which can
-        * create a new object in the filesystem.
-        * They are:
-        * SMB_SET_FILE_UNIX_LINK -> creates POSIX symlink.
-        * SMB_POSIX_PATH_OPEN -> creates POSIX file or directory.
-        * SMB_SET_FILE_UNIX_BASIC:
-        * SMB_SET_FILE_UNIX_INFO2: can create a POSIX special file.
-        *
-        * These info levels do not require an existing object.
-        */
-       switch (info_level) {
-       case SMB_SET_FILE_UNIX_BASIC:
-       case SMB_SET_FILE_UNIX_INFO2:
-               require_existing_object = false;
-               break;
-       default:
-               break;
-       }
-
-       if (!VALID_STAT(smb_fname->st) && require_existing_object) {
-               reply_nterror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND);
-       }
-
        status = smbd_do_setfilepathinfo(
                conn,
                req,