]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we can't cope...
authorJeremy Allison <jra@samba.org>
Fri, 7 Feb 2014 18:19:26 +0000 (10:19 -0800)
committerKarolin Seeger <kseeger@samba.org>
Fri, 14 Feb 2014 21:35:40 +0000 (22:35 +0100)
Fix bug : Bug 10429 - samba returns STATUS_OBJECT_NAME_NOT_FOUND when attempting to remove dangling symlink

https://bugzilla.samba.org/show_bug.cgi?id=10429

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb  8 00:01:16 CET 2014 on sn-devel-104
(cherry picked from commit 17adbbcad7e401dd544dfa76f7ec9aeb6a847381)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Feb 14 22:35:40 CET 2014 on sn-devel-104

source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c

index 620a58075383cba8aade1362ac3fa550415cc0d4..202cc78fe5ef557c27c8593f6f2d75cb523eea53 100644 (file)
@@ -892,8 +892,19 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
        state.handle = handle;
        state.status = NT_STATUS_OK;
 
-       status = walk_streams(handle, smb_fname_base, NULL, collect_one_stream,
+       if (S_ISLNK(smb_fname_base->st.st_ex_mode)) {
+               /*
+                * Currently we do't have SMB_VFS_LLISTXATTR
+                * inside the VFS which means there's no way
+                * to cope with a symlink when lp_posix_pathnames().
+                * returns true. For now ignore links.
+                * FIXME - by adding SMB_VFS_LLISTXATTR. JRA.
+                */
+               status = NT_STATUS_OK;
+       } else {
+               status = walk_streams(handle, smb_fname_base, NULL, collect_one_stream,
                              &state);
+       }
 
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(state.streams);
index 6650021af17f1194b9cf66a81b2bd9c45cd88191..c4d86ee6852c1cad443225e896324e5964cae60a 100644 (file)
@@ -799,8 +799,19 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
        state.handle = handle;
        state.status = NT_STATUS_OK;
 
-       status = walk_xattr_streams(handle->conn, fsp, fname,
+       if (S_ISLNK(sbuf.st_ex_mode)) {
+               /*
+                * Currently we do't have SMB_VFS_LLISTXATTR
+                * inside the VFS which means there's no way
+                * to cope with a symlink when lp_posix_pathnames().
+                * returns true. For now ignore links.
+                * FIXME - by adding SMB_VFS_LLISTXATTR. JRA.
+                */
+               status = NT_STATUS_OK;
+       } else {
+               status = walk_xattr_streams(handle->conn, fsp, fname,
                                    collect_one_stream, &state);
+       }
 
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(state.streams);