Menu

#511 cannot save file with voiced sound mark by Photoshop CS5

None
closed
nobody
None
5
2015-02-02
2013-03-29
HAT
No

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.

Discussion

  • Ralph Böhme

    Ralph Böhme - 2013-04-02

    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
    $
    
     
  •  HAT

    HAT - 2013-04-02

    Test attached file.

     
  •  HAT

    HAT - 2013-04-02

    of_alloc() in etc/afpd/ofork.c :

    if ((ad->ad_name = strdup(path)) == NULL) {
    

    Probably mtoupath() should be used.

    Another function is also worried.
    of_rename() in etc/afpd/ofork.c :

    if ((of_name(of) = strdup(newpath)) == NULL)
    

    There may be the same problem.

     
  • Ralph Böhme

    Ralph Böhme - 2013-04-02

    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

    • in many places the code depends upon struct adouble.ad_name being UTF8-MAC encoded
    • ad_rtruncate() is passed a struct adouble, not a filename
    • therefore ad_rtruncate() will have to convert to UTF8 but it can't, because mtoupath() is not in libatalk

    Until a customer is affected by this bug (which isn't at the moment), I can't dedicate ressources towards it.

     
  • hiroyuki sato

    hiroyuki sato - 2013-04-04

    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.

     
  • Ralph Böhme

    Ralph Böhme - 2013-04-04

    I think the better, simpler approach is to modify ad_rtruncate() to take an additional parameter, the file name in host endcoding, eg

    int ad_rtruncate(struct adouble *ad, const char *uname, off_t size);
    

    In case you need further help:
    http://www.netafp.com/netatalk-support/

     
  • Ralph Böhme

    Ralph Böhme - 2013-04-07

    There seems to be an issue with the git repo on SF. Use this link instead https://github.com/franklahm/Netatalk/commits/bug511-forkname

     
  •  HAT

    HAT - 2013-04-07

    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.

     
  • Ralph Böhme

    Ralph Böhme - 2013-04-07
     
  • Ralph Böhme

    Ralph Böhme - 2013-04-07
    • status: open --> closed
     

Log in to post a comment.