]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: fruit: In fruit_stat_meta_netatalk(), move the call to fruit_stat_base(...
authorJeremy Allison <jra@samba.org>
Fri, 2 Jul 2021 20:37:56 +0000 (13:37 -0700)
committerJeremy Allison <jra@samba.org>
Sun, 4 Jul 2021 17:15:34 +0000 (17:15 +0000)
Both must succeed for a valid return, and we're next going
to replace ad_get() with a wrapper that calls openat_pathref_fsp(),
which needs a VALID_STAT().

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

index b9427865a3f2f2b80c7637a2c7d401f3ec7a6ebb..9c5657b8091e12c55f1c52db618e1306f162464b 100644 (file)
@@ -3060,6 +3060,11 @@ static int fruit_stat_meta_netatalk(vfs_handle_struct *handle,
 {
        struct adouble *ad = NULL;
 
+       /* Populate the stat struct with info from the base file. */
+       if (fruit_stat_base(handle, smb_fname, follow_links) == -1) {
+               return -1;
+       }
+
        ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
        if (ad == NULL) {
                DBG_INFO("fruit_stat_meta %s: %s\n",
@@ -3069,10 +3074,6 @@ static int fruit_stat_meta_netatalk(vfs_handle_struct *handle,
        }
        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;
-       }
        smb_fname->st.st_ex_size = AFP_INFO_SIZE;
        smb_fname->st.st_ex_ino = hash_inode(&smb_fname->st,
                                              smb_fname->stream_name);