]> arthur.barton.de Git - netatalk.git/commitdiff
Don't convert AppleDouble v2 file of symlinks, delete it
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 27 Nov 2012 17:04:29 +0000 (18:04 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 27 Nov 2012 17:04:29 +0000 (18:04 +0100)
Netatalk 2.x created AppleDouble files for symlinks. Netatalk's 3
autoconversion of AppleDouble files to AppleDouble metadata
extended attributes failed to do the conversion in ad_convert()
because some filesystem may not support EAs on symlinks.

The new behaviour is to ignore symlinks in ad_convert().

Fixes bug #471.

libatalk/adouble/ad_conv.c

index eef809128de212d0a754a86ca2889ff831a19e06..329790bb23b72f3c9685e2909b10eabef6ac2be1 100644 (file)
@@ -64,8 +64,16 @@ static int ad_conv_v22ea_hf(const char *path, const struct stat *sp, const struc
 
     LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): BEGIN", fullpathname(path));
 
+    switch (S_IFMT & sp->st_mode) {
+    case S_IFREG:
+        break;
+    default:
+        return 0;
+    }
+
     ad_init(&adea, vol);
     ad_init_old(&adv2, AD_VERSION2, adea.ad_options);
+
     adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0;
 
     /* Open and lock adouble:v2 file */
@@ -124,6 +132,13 @@ static int ad_conv_v22ea_rf(const char *path, const struct stat *sp, const struc
 
     LOG(log_debug, logtype_ad,"ad_conv_v22ea_rf(\"%s\"): BEGIN", fullpathname(path));
 
+    switch (S_IFMT & sp->st_mode) {
+    case S_IFREG:
+        break;
+    default:
+        return 0;
+    }
+
     if (S_ISDIR(sp->st_mode))
         return 0;