]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: ignore ENAMETOOLONG in fruit_unlink_rsrc_adouble()
authorMikeLiu <mikeliu@qnap.com>
Thu, 26 Oct 2023 08:15:39 +0000 (16:15 +0800)
committerVolker Lendecke <vl@samba.org>
Fri, 17 Nov 2023 11:07:01 +0000 (11:07 +0000)
adouble_path() inside fruit_unlink_rsrc_adouble() prepend "._" to a basename,
lenth of apple double filename will exceed NAME_MAX if length of basename
is equal to NAME_MAX (or NAME_MAX-1).

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Nov 17 11:07:01 UTC 2023 on atb-devel-224

source3/modules/vfs_fruit.c

index b510b04aea68c8d7be36a0de2085e3b465508355..b3dd6016ae36a2b639ca3c1648f3af3546d13670 100644 (file)
@@ -2110,7 +2110,7 @@ static int fruit_unlink_rsrc_adouble(vfs_handle_struct *handle,
                        adp_smb_fname,
                        0);
        TALLOC_FREE(adp_smb_fname);
-       if ((rc != 0) && (errno == ENOENT) && force_unlink) {
+       if ((rc != 0) && (errno == ENOENT || errno == ENAMETOOLONG) && force_unlink) {
                rc = 0;
        }