]> arthur.barton.de Git - netatalk.git/commitdiff
apple_dump: Extended Attributes AppleDouble support for *BSD
authorHAT <hat@fa2.so-net.ne.jp>
Mon, 16 Jul 2012 13:32:54 +0000 (22:32 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Mon, 16 Jul 2012 13:32:54 +0000 (22:32 +0900)
NEWS
contrib/shell_utils/apple_dump.in

diff --git a/NEWS b/NEWS
index 2806adce8a00d35693ca3b009910831a7f02c850..dc6a45dd9c76f956161493e2471b32d76fb31117 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Changes in 3.0.1
 * FIX: afpd: Fix a crash on FreeBSD
 * FIX: Fix possible alignment violations due to bad casts
 * FIX: dbd: Fix logging
 * FIX: afpd: Fix a crash on FreeBSD
 * FIX: Fix possible alignment violations due to bad casts
 * FIX: dbd: Fix logging
+* FIX: apple_dump: Extended Attributes AppleDouble support for *BSD
 * UPD: Install relevant includes necessary for building programs with
        installed headers and shared lib libatalk
 
 * UPD: Install relevant includes necessary for building programs with
        installed headers and shared lib libatalk
 
index f5dab45128cf064d97c90fced979991294795999..e207151d5c3f1d625a1e7ac953f21efc3a3859b7 100755 (executable)
@@ -59,6 +59,8 @@ if (     0 == system("which getfattr > /dev/null 2>&1")) {
     $eacommand = 2;
 } elsif (0 == system("which runat > /dev/null 2>&1")) {
     $eacommand = 3;
     $eacommand = 2;
 } elsif (0 == system("which runat > /dev/null 2>&1")) {
     $eacommand = 3;
+} elsif (0 == system("which getextattr > /dev/null 2>&1")) {
+    $eacommand = 4;
 } else {
     $eacommand = 0;
 }
 } else {
     $eacommand = 0;
 }
@@ -873,6 +875,17 @@ sub checkea {
         }
         close (EALIST);
         return 0;
         }
         close (EALIST);
         return 0;
+    } elsif ( $eacommand == 4 ) {
+        open(EALIST, "lsextattr -q user \"$file\" |");
+        while(<EALIST>) {
+            $_ = "\t".$_;
+            if ( $_ =~ /\torg\.netatalk\.Metadata[\n\t]/ ) {
+                close (EALIST);
+                return 1;
+            }
+        }
+        close (EALIST);
+        return 0;
     } else {
         return 0;
     }
     } else {
         return 0;
     }
@@ -893,6 +906,8 @@ sub eaopenfile {
         system("attr -q -g org.netatalk.Metadata \"$file\" > $eatempfile");
     } elsif ( $eacommand == 3 ) {
         system("runat \"$file\" cat org.netatalk.Metadata > $eatempfile");
         system("attr -q -g org.netatalk.Metadata \"$file\" > $eatempfile");
     } elsif ( $eacommand == 3 ) {
         system("runat \"$file\" cat org.netatalk.Metadata > $eatempfile");
+    } elsif ( $eacommand == 4 ) {
+        system("getextattr -q user org.netatalk.Metadata \"$file\" > $eatempfile");
     } else {
         return "";
     }
     } else {
         return "";
     }