Bug 15504 - vfs_fruit: Unable to delete long filename (255 characters)
Summary: vfs_fruit: Unable to delete long filename (255 characters)
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.15.13
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2023-10-26 07:23 UTC by Mike Liu
Modified: 2023-11-17 11:08 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Liu 2023-10-26 07:23:57 UTC
Samba version 4.15.13

vfs objects = fruit
fruit:resource = file

Steps to Reproduce:
1. Upload a test file with 255 characters filename 
2. Delete the test file via Windows file explorer
3. test file will appear after refresh


log.smbd shows ...

fruit_unlinkat: Forced unlink of [中▒~I▒管▒~W第201803212▒~Y~_▒~E▒▒~Q~J▒~\▒▒~E▒▒~O▒▒~H▒▒~Q▒~A~G▒~@~A▒~J| ▒~O▒▒~O~[▒~\▒~Q▒~I▒~\業▒~O▒~Z▒~L詳▒~B說▒~X~N▒~@~BMã Trung Lươ▒
ng S▒~Q 201803212 Thông báo những quy ▒~Q▒~Knh v▒~A th▒~]i gian ngh▒~I phép n▒~Cm, t▒~Cng ca ▒~Q▒~Ui ngh▒~I bù, chi tiết như sau..pdf:AFP_Resource] failed [File name too long]

strace shows ...

 unlinkat(45, "._\344\270\255\350\211\257\347\256\241\345\255\227\347\254\254201803212\350\231\237\345\205\254\345\221\212\346\234\254\345\205\254\345\217\270\345\210\245\344\274\221\345\201\207\343\200\201\345\212\240\347\217\255\346\217\233\350\243\234\344\274\221\347\255\211\344\275\234\346\245\255\350\246\217\345\256\232\357\274\214\350\251\263\345\246\202\350\252\252\346\230\216\343\200\202M\303\243 Trung L\306\260\306\241ng S\341\273\221 201803212 Th\303\264ng b\303\241o nh\341\273\257ng quy \304\221\341\273\213nh v\341\273\201 th\341\273\235i gian ngh\341\273\211 ph\303\251p n\304\203m, t\304\203ng ca \304\221\341\273\225i ngh\341\273\211 b\303\271, chi ti\341\272\277t nh\306\260 sau..pdf", 0) = -1 ENAMETOOLONG (File name too long)
adouble_path() inside fruit_unlink_rsrc_adouble() prepend "._" to a basename,
length of apple double filename will exceed NAME_MAX if length of basename is equal to NAME_MAX (or NAME_MAX-1).
Comment 1 Mike Liu 2023-10-26 08:33:45 UTC
Maybe can ignore ENAMETOOLONG. Filename exceed NAME_MAX can't be created like ENOENT.

Comment 3 Samba QA Contact 2023-11-17 11:08:04 UTC
This bug was referenced in samba master: