vfs_fruit: stat AFP_AfpInfo must fail when it doesn't exist
authorRalph Boehme <slow@samba.org>
Thu, 17 Dec 2015 19:05:04 +0000 (20:05 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 6 Jan 2016 09:07:16 +0000 (10:07 +0100)
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>
(cherry picked from commit 0af7bf4249419ff7c88c5beece915db0a3697b72)

source3/modules/vfs_fruit.c

index 5c1415647e723ec4575805a99b8b52c68bdd697e..18ee2dac16d141cd00c0c40ea088c072e8ff7d55 100644 (file)
@@ -2853,6 +2853,17 @@ static int fruit_stat_meta(vfs_handle_struct *handle,
                           struct smb_filename *smb_fname,
                           bool follow_links)
 {
+       struct adouble *ad = NULL;
+
+       ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+       if (ad == NULL) {
+               DEBUG(3,("fruit_stat_meta %s: %s\n",
+                        smb_fname_str_dbg(smb_fname), strerror(errno)));
+               errno = ENOENT;
+               return -1;
+       }
+       TALLOC_FREE(ad);
+
        /* Populate the stat struct with info from the base file. */
        if (fruit_stat_base(handle, smb_fname, follow_links) == -1) {
                return -1;