vfs_fruit: remove now unused AppleDouble code for resource fork in xattr
authorRalph Boehme <slow@samba.org>
Fri, 17 May 2019 12:31:15 +0000 (14:31 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 May 2019 20:19:27 +0000 (20:19 +0000)
This was only needed to get the resourcefork size via the ad_* AppleDouble
function. This is now done with a fstat on the low level xattr fd (remember,
this is Solaris only code...), so we can remove the xattr special casing from
the AppleDouble functions.

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

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

index 3c6f959fa05b866ccccbc0ff68a2cf791ad65603..ba53abfdd6a3f6955ef78e5bb1ac49575dd30577 100644 (file)
@@ -1593,20 +1593,6 @@ exit:
        return ealen;
 }
 
-static int ad_open_rsrc_xattr(const struct smb_filename *smb_fname,
-                               int flags,
-                               mode_t mode)
-{
-#ifdef HAVE_ATTROPEN
-       /* FIXME: direct Solaris xattr syscall */
-       return attropen(smb_fname->base_name,
-                       AFPRESOURCE_EA_NETATALK, flags, mode);
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-
 static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname,
                                int flags,
                                mode_t mode)
@@ -1631,19 +1617,7 @@ static int ad_open_rsrc(vfs_handle_struct *handle,
                        int flags,
                        mode_t mode)
 {
-       struct fruit_config_data *config = NULL;
-       int fd;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct fruit_config_data, return -1);
-
-       if (config->rsrc == FRUIT_RSRC_XATTR) {
-               fd = ad_open_rsrc_xattr(smb_fname, flags, mode);
-       } else {
-               fd = ad_open_rsrc_adouble(smb_fname, flags, mode);
-       }
-
-       return fd;
+       return ad_open_rsrc_adouble(smb_fname, flags, mode);
 }
 
 /*
@@ -1687,24 +1661,6 @@ static int ad_open(vfs_handle_struct *handle,
        return 0;
 }
 
-static ssize_t ad_read_rsrc_xattr(vfs_handle_struct *handle,
-                                 struct adouble *ad)
-{
-       int ret;
-       SMB_STRUCT_STAT st;
-
-       /* FIXME: direct sys_fstat(), don't have an fsp */
-       ret = sys_fstat(ad->ad_fd, &st,
-                       lp_fake_directory_create_times(
-                               SNUM(handle->conn)));
-       if (ret != 0) {
-               return -1;
-       }
-
-       ad_setentrylen(ad, ADEID_RFORK, st.st_ex_size);
-       return st.st_ex_size;
-}
-
 static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
                                    struct adouble *ad,
                                    const struct smb_filename *smb_fname)
@@ -1778,19 +1734,7 @@ static ssize_t ad_read_rsrc(vfs_handle_struct *handle,
                            struct adouble *ad,
                            const struct smb_filename *smb_fname)
 {
-       struct fruit_config_data *config = NULL;
-       ssize_t len;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct fruit_config_data, return -1);
-
-       if (config->rsrc == FRUIT_RSRC_XATTR) {
-               len = ad_read_rsrc_xattr(handle, ad);
-       } else {
-               len = ad_read_rsrc_adouble(handle, ad, smb_fname);
-       }
-
-       return len;
+       return ad_read_rsrc_adouble(handle, ad, smb_fname);
 }
 
 /**
@@ -1898,22 +1842,14 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
        int rc = 0;
        const struct ad_entry_order  *eid;
        struct adouble *ad = NULL;
-       struct fruit_config_data *config;
        time_t t = time(NULL);
 
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct fruit_config_data, return NULL);
-
        switch (type) {
        case ADOUBLE_META:
                eid = entry_order_meta_xattr;
                break;
        case ADOUBLE_RSRC:
-               if (config->rsrc == FRUIT_RSRC_ADFILE) {
-                       eid = entry_order_dot_und;
-               } else {
-                       eid = entry_order_rsrc_xattr;
-               }
+               eid = entry_order_dot_und;
                break;
        default:
                return NULL;