vfs_fruit: ignore delete on the AFP_Resource stream
authorRalph Boehme <slow@samba.org>
Sat, 19 Dec 2015 17:27:06 +0000 (18:27 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 21 Dec 2015 22:21:18 +0000 (23:21 +0100)
OS X ignores deletes on the AFP_Resource stream. This was discovered by
torture tests against OS X SMB server.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index 34b35247b0b670ca266b6b59fadb6659a2710566..cb0d2848fa319cd98a7f8dd2ac669e1aa86632f5 100644 (file)
@@ -2478,27 +2478,8 @@ static int fruit_unlink(vfs_handle_struct *handle,
        }
 
        if (is_afpresource_stream(smb_fname)) {
-               if (config->rsrc == FRUIT_RSRC_ADFILE) {
-                       char *adp = NULL;
-
-                       rc = adouble_path(talloc_tos(),
-                                         smb_fname->base_name, &adp);
-                       if (rc != 0) {
-                               return -1;
-                       }
-                       /* FIXME: direct unlink(), missing smb_fname */
-                       rc = unlink(adp);
-                       if ((rc == -1) && (errno == ENOENT)) {
-                               rc = 0;
-                       }
-                       TALLOC_FREE(adp);
-               } else {
-                       rc = SMB_VFS_REMOVEXATTR(handle->conn,
-                                                smb_fname->base_name,
-                                                AFPRESOURCE_EA_NETATALK);
-               }
-
-               return rc;
+               /* OS X ignores deletes on the AFP_Resource stream */
+               return 0;
        }
 
        return SMB_VFS_NEXT_UNLINK(handle, smb_fname);