]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "vfs_xattr_tdb: fix dangling symlink detection"
authorJule Anger <janger@samba.org>
Wed, 15 Oct 2025 13:32:41 +0000 (15:32 +0200)
committerJule Anger <janger@samba.org>
Wed, 15 Oct 2025 13:36:13 +0000 (13:36 +0000)
This reverts commit 2de3b8ec09cf3dcd6d17ccf5b025477b338f51cc.

Pushed incorrectly.

Signed-off-by: Jule Anger <janger@samba.org>
source3/modules/vfs_xattr_tdb.c

index 19331d0de4f63d00a750a67591e58ad7f057fca2..447d868924d1042d7b93f45a271b3c2984ff81a5 100644 (file)
@@ -604,12 +604,13 @@ static int xattr_tdb_unlinkat(vfs_handle_struct *handle,
        } else {
                ret = SMB_VFS_NEXT_STAT(handle, full_fname);
                if (ret == -1 && (errno == ENOENT || errno == ELOOP)) {
-                       /*
-                        * Could be trying to remove a dangling symlink.
-                        */
-                       ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
-                       if (ret == 0 && !S_ISLNK(full_fname->st.st_ex_mode)) {
-                               ret = -1;
+                       if (VALID_STAT(smb_fname->st) &&
+                                       S_ISLNK(smb_fname->st.st_ex_mode)) {
+                               /*
+                                * Original name was a link - Could be
+                                * trying to remove a dangling symlink.
+                                */
+                               ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
                        }
                }
        }