A new bug was reported by netatalk-ja mailing list.
Photoshop CS5 and CS5.1 cannot save file if filename include voiced sound mark.
This problem occur only when setting "save preview".
Therefore, it seems that resource fork is related.
This is already checked in four environments.
netatalk 3.0.2 / CentOS 5.7
netatalk 3.0.2 / CentOS 6.4
netatalk 3.0.3 / CentOS 6.4
netatalk 3.0.2 / FreeBSD 9.0-RELEASE(AMD64) / ZFS
This problem don't occur when setting "appledouble=v2".
Photoshop CS3, CS4 and CS6 have no problem.
log:
http://www.i-elements.net/netatalk/netatalk303.log
Mar 28 01:24:54.828215 afpd[21725] {afp_dsi.c:604} (D5:AFPDaemon): <== Start AFP command: AFP_SETFORKPARAM Mar 28 01:24:54.828271 afpd[21725] {ad_lock.c:515} (D5:ad): ad_tmplock(reso, WR, off: 0 (-), len: 24221): BEGIN Mar 28 01:24:54.828322 afpd[21725] {ad_lock.c:72} (D5:ad): set_lock(fd: 13, F_SETLK, F_WRLCK, off: 82 (-), len: 24221): BEGIN Mar 28 01:24:54.828359 afpd[21725] {ad_lock.c:567} (D5:ad): ad_tmplock: END: 0 Mar 28 01:24:54.828683 afpd[21725] {ad_write.c:176} (E:ad): ad_rtruncate("/hogehoge/でざいん.psd"): No such file or directory Mar 28 01:24:54.828736 afpd[21725] {ad_lock.c:515} (D5:ad): ad_tmplock(reso, CLR, off: 0 (-), len: 24221): BEGIN Mar 28 01:24:54.828770 afpd[21725] {ad_lock.c:72} (D5:ad): set_lock(fd: 13, F_SETLK, F_UNLCK, off: 82 (-), len: 24221): BEGIN Mar 28 01:24:54.828807 afpd[21725] {ad_lock.c:567} (D5:ad): ad_tmplock: END: 0 Mar 28 01:24:54.828840 afpd[21725] {afp_dsi.c:613} (D5:AFPDaemon): ==> Finished AFP command: AFP_SETFORKPARAM -> AFPERR_PARAM
When FPSetForkParms is received, ad_rtruncate() fails.
The filename でざいん.psd is NFD!!!
It seems that filename is saved as NFD in variavle ad_name.
include/atalk/adouble.h
char *ad_name; /* name in server encoding (usually UTF8) */
ad_name should be vol charset.
Maybe, when setting the length of resource fork as zero, the file cannot be found by the mistake of charset.
How to reproduce
Although I don't have Photoshop, it's reproducible by an easy method.
1) save a file with voiced sound mark and resource fork on netatalk volume
2) delete EA com.apple.ResourceFork
$ ls -l@ total 24 -rw-r-----@ 1 hat staff 225 1 10 2010 ほげ.txt com.apple.FinderInfo 32 com.apple.ResourceFork 4764 com.apple.TextEncoding 15 com.apple.metadata:kMDItemFinderComment 81 $ xattr -d com.apple.ResourceFork ほげ.txt xattr: [Errno 22] Invalid argument: '\xe3\x81\xbb\xe3\x81\x91\xe3\x82\x99.txt'
log:
Mar 28 21:15:31.160286 afpd[968] {afp_dsi.c:604} (D5:AFPDaemon): <== Start AFP command: AFP_SETFORKPARAM Mar 28 21:15:31.160298 afpd[968] {ad_lock.c:515} (D5:ad): ad_tmplock(reso, WR, off: 0 (-), len: 4764): BEGIN Mar 28 21:15:31.160306 afpd[968] {ad_lock.c:72} (D5:ad): set_lock(fd: 17, F_SETLK, F_WRLCK, off: 82 (-), len: 4764): BEGIN Mar 28 21:15:31.160313 afpd[968] {ad_lock.c:567} (D5:ad): ad_tmplock: END: 0 Mar 28 21:15:31.160331 afpd[968] {ad_write.c:176} (E:ad): ad_rtruncate("/home/hat/test/ほげ.txt"): No such file or directory Mar 28 21:15:31.160339 afpd[968] {ad_lock.c:515} (D5:ad): ad_tmplock(reso, CLR, off: 0 (-), len: 4764): BEGIN Mar 28 21:15:31.160346 afpd[968] {ad_lock.c:72} (D5:ad): set_lock(fd: 17, F_SETLK, F_UNLCK, off: 82 (-), len: 4764): BEGIN Mar 28 21:15:31.160353 afpd[968] {ad_lock.c:567} (D5:ad): ad_tmplock: END: 0 Mar 28 21:15:31.160360 afpd[968] {afp_dsi.c:613} (D5:AFPDaemon): ==> Finished AFP command: AFP_SETFORKPARAM -> AFPERR_PARAM
This is the same message.
Works for me with 3.0.3:
$ touch /Volumes/test/ほげ.txt $ echo blub > /Volumes/test/ほげ.txt/..namedfork/rsrc $ xattr -l /Volumes/test/ほげ.txt com.apple.ResourceFork: blub $ xattr -d com.apple.ResourceFork /Volumes/test/ほげ.txt $ xattr -l /Volumes/test/ほげ.txt $
Test attached file.
of_alloc() in etc/afpd/ofork.c :
Probably mtoupath() should be used.
Another function is also worried.
of_rename() in etc/afpd/ofork.c :
There may be the same problem.
I was initially testing with Solaris, there the error doesn't show up. I can however reproduce it on Linux.
Fixing this might get more involved then one would think, because the
Until a customer is affected by this bug (which isn't at the moment), I can't dedicate ressources towards it.
Hello
We will fix this problem the following steps.
I want to get a consensus, so I'll appreciate if someone comment me about this fix.
1, move mtoupath() utompath() functions to libatalk/unicode/charcnv.c as library.
2, change mtoupath() and utompath() arguments. and link functions in libatalk
There are files which is called mtoupath() and utompath().
It is used same function name, but thorse number argument does not same.
mtoupath
libatalk/vfs/ea_ad.c
utompath
bin/ad/ad_util.c
etc/cnid_dbd/cmd_dbd_scanvol.c
bin/ad/ad_cp.c
etc/cnid_dbd/cmd_dbd_scanvol.c
3, send patch above
4, fix etc/afped/ofork.c and send patch.
Best regards.
I think the better, simpler approach is to modify ad_rtruncate() to take an additional parameter, the file name in host endcoding, eg
In case you need further help:
http://www.netafp.com/netatalk-support/
I've pushed a possible fix to branch 'bug511-forkname' in [1e787cd52b5d7327d180af76ca7e4ab071683313]. Please test and report back.
Related
Commit: <Commit _id='1e787cd52b5d7327d180af76ca7e4ab071683313' tree_id='0e5a8208ad7f95883094267e66463adbb0c6e9ab' committed=I{'date': datetime.datetime(2013, 4, 6, 15, 8, 37), 'email': 'franklahm@googlemail.com', 'name': 'Frank Lahm'} authored=I{'date': datetime.datetime(2013, 4, 6, 15, 8, 37), 'email': 'franklahm@googlemail.com', 'name': 'Frank Lahm'} message='Fix an issue with filenames containing non-ASCII characters\n\nFix an issue with filenames containing non-ASCII characters that\nlead to a failure setting the size of a files ressource fork.\nThis affected application like Adobe Photoshop where saving\nfiles may fail. Fixes bug #511.\n' parent_ids=I['8a31fe1c9da97425ff8636da56dbbec914f754b3'] child_ids=I[] repo_ids=I[ObjectId('503b705bfd48f843173d5fd3'), ObjectId('5910acbc2cd81052b64b3380'), ObjectId('5e503de0dd85f4654ba114ee'), ObjectId('5e828a7a9d8bdd372301c28f')]>
There seems to be an issue with the git repo on SF. Use this link instead https://github.com/franklahm/Netatalk/commits/bug511-forkname
It checked in the following environments.
CentOS 6.4 32bit / xattr
OpenIndiana 32bit / xattr
Fedora 18 64bit / xattr
Fedora 18 32bit / xattr
Fedora 17 64bit / xattr
CentOS6.4 64bit / Photoshop CS 5.1
CentOS6.4 / Photoshop CS 5.1
There is no problem.
Changeset [1e787cd52b5d7327d180af76ca7e4ab071683313] merged develop.