From: Jeremy Allison Date: Fri, 2 Jul 2021 20:37:56 +0000 (-0700) Subject: s3: VFS: fruit: In fruit_stat_meta_netatalk(), move the call to fruit_stat_base(... X-Git-Tag: tevent-0.11.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=342086d773cbd85c1683ab9fcb1a9c2b225c890f;p=thirdparty%2Fsamba.git s3: VFS: fruit: In fruit_stat_meta_netatalk(), move the call to fruit_stat_base() before the ad_get() call. 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index b9427865a3f..9c5657b8091 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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);