smbd: We want to delete symlinks as such in reply_unlink()
authorVolker Lendecke <vl@samba.org>
Wed, 25 Oct 2023 16:58:34 +0000 (18:58 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 7 Nov 2023 12:46:37 +0000 (12:46 +0000)
Even with "follow symlinks = yes" we don't want to delete the target
when being given a symlink name.

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

index 4eb13c18cc3a875dc2a47151a1623d297bfed5be..addca927c74359d228d53a159872702fc9fba7b0 100644 (file)
@@ -2745,7 +2745,7 @@ void reply_unlink(struct smb_request *req)
        status = filename_convert_dirfsp(ctx,
                                         conn,
                                         name,
-                                        ucf_flags,
+                                        ucf_flags | UCF_LCOMP_LNK_OK,
                                         twrp,
                                         &dirfsp,
                                         &smb_fname);