]> arthur.barton.de Git - netatalk.git/blobdiff - bin/ad/ad_cp.c
Merge 2-1
[netatalk.git] / bin / ad / ad_cp.c
index 1e4bde06290f260b488b0d26c77dfacf94ff6d0d..ac0a737a0b5a12cfcc3477ace70f282ba7f5a3e4 100644 (file)
@@ -387,6 +387,10 @@ static int copy(const char *path,
     if (alarmed)
         return -1;
 
+    /* This currently doesn't work with "." */
+    if (strcmp(path, ".") == 0) {
+        ERROR("\".\" not supported");
+    }
     const char *dir = strrchr(path, '/');
     if (dir == NULL)
         dir = path;
@@ -535,7 +539,7 @@ static int copy(const char *path,
 
             struct adouble ad;
             struct stat st;
-            if (stat(to.p_path, &st) != 0) {
+            if (lstat(to.p_path, &st) != 0) {
                 badcp = rval = 1;
                 break;
             }
@@ -602,7 +606,7 @@ static int copy(const char *path,
 
             struct adouble ad;
             struct stat st;
-            if (stat(to.p_path, &st) != 0) {
+            if (lstat(to.p_path, &st) != 0) {
                 badcp = rval = 1;
                 break;
             }