]> arthur.barton.de Git - netatalk.git/commitdiff
Fix an error when duplicating files that lacked an AppleDouble file which lead to...
authorFrank Lahm <franklahm@googlemail.com>
Wed, 19 Oct 2011 08:44:39 +0000 (10:44 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 19 Oct 2011 08:44:39 +0000 (10:44 +0200)
NEWS
etc/afpd/file.c
libatalk/vfs/unix.c

diff --git a/NEWS b/NEWS
index 375f0edca075338bd165fcc9005f0f700303cb90..fb95c3a54f063e2c229bd1ee3507f156d675ccf2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ Changes in 2.2.2
 
 * UPD: afpd: Enhanced POSIX ACL mapping semantics, from Laura Mueller
 * FIX: afpd: ACL access checking
+* FIX: afpd: Fix an error when duplicating files that lacked an AppleDouble file
+       which lead to a possible Finder crash
 * FIX: dbd: Better checking for duplicated or bogus CNIDs from AppleDouble files
 * FIX: Fix compilation error when AppleTalk support is disabled
 
index ec85f37a52e0dfdefb79335b05e447bb970138ea..8402ebf164dcb81611b38402181eabdfc34d8088 100644 (file)
@@ -1555,7 +1555,8 @@ int copyfile(const struct vol *s_vol,
     if (ad_reso_fileno(adp) == -1 || 0 == (err = copy_fork(ADEID_RFORK, &add, adp))){
         /* copy the data fork */
         if ((err = copy_fork(ADEID_DFORK, &add, adp)) == 0) {
-            err = d_vol->vfs->vfs_copyfile(d_vol, sfd, src, dst);
+            if (ad_meta_fileno(adp) != -1)
+                err = d_vol->vfs->vfs_copyfile(d_vol, sfd, src, dst);
         }
     }
 
index 89c2ba1b26e74d93e7aa8f8192f14c8629ea1f75..ffb524b825d88e7b2444a8e5cf742eaf4d5834d6 100644 (file)
@@ -192,13 +192,13 @@ int copy_file(int dirfd, const char *src, const char *dst, mode_t mode)
     sfd = open(src, O_RDONLY);
 #endif
     if (sfd < 0) {
-        LOG(log_error, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s",
+        LOG(log_info, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s",
             src, dst, src, strerror(errno));
         return -1;
     }
 
     if ((dfd = open(dst, O_WRONLY | O_CREAT | O_TRUNC, mode)) < 0) {
-        LOG(log_error, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s",
+        LOG(log_info, logtype_afpd, "copy_file('%s'/'%s'): open '%s' error: %s",
             src, dst, dst, strerror(errno));
         ret = -1;
         goto exit;