vfs_fruit: add fruit_stat_rsrc_stream() implementation
authorRalph Boehme <slow@samba.org>
Fri, 2 Dec 2016 10:30:06 +0000 (11:30 +0100)
committerUri Simchoni <uri@samba.org>
Wed, 1 Mar 2017 23:32:21 +0000 (00:32 +0100)
This fixes fruit_stat_rsrc for the fruit:resource=stream case.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/modules/vfs_fruit.c

index 07221d37f2575ae5d205dd798fc57872d8679105..c0202afbf68160b3f42d85881faa585b232507ae 100644 (file)
@@ -3619,6 +3619,21 @@ static int fruit_stat_rsrc_netatalk(vfs_handle_struct *handle,
        return 0;
 }
 
+static int fruit_stat_rsrc_stream(vfs_handle_struct *handle,
+                                 struct smb_filename *smb_fname,
+                                 bool follow_links)
+{
+       int ret;
+
+       if (follow_links) {
+               ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
+       } else {
+               ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
+       }
+
+       return ret;
+}
+
 static int fruit_stat_rsrc(vfs_handle_struct *handle,
                           struct smb_filename *smb_fname,
                           bool follow_links)
@@ -3633,6 +3648,9 @@ static int fruit_stat_rsrc(vfs_handle_struct *handle,
 
        switch (config->rsrc) {
        case FRUIT_RSRC_STREAM:
+               ret = fruit_stat_rsrc_stream(handle, smb_fname, follow_links);
+               break;
+
        case FRUIT_RSRC_XATTR:
        case FRUIT_RSRC_ADFILE:
                ret = fruit_stat_rsrc_netatalk(handle, smb_fname, follow_links);