From: HAT Date: Mon, 16 Jul 2012 13:32:54 +0000 (+0900) Subject: apple_dump: Extended Attributes AppleDouble support for *BSD X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=2aee767bb3db8721868a54f583d88961d8b354f8 apple_dump: Extended Attributes AppleDouble support for *BSD --- diff --git a/NEWS b/NEWS index 2806adce..dc6a45dd 100644 --- 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: apple_dump: Extended Attributes AppleDouble support for *BSD * UPD: Install relevant includes necessary for building programs with installed headers and shared lib libatalk diff --git a/contrib/shell_utils/apple_dump.in b/contrib/shell_utils/apple_dump.in index f5dab451..e207151d 100755 --- a/contrib/shell_utils/apple_dump.in +++ b/contrib/shell_utils/apple_dump.in @@ -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; +} elsif (0 == system("which getextattr > /dev/null 2>&1")) { + $eacommand = 4; } else { $eacommand = 0; } @@ -873,6 +875,17 @@ sub checkea { } close (EALIST); return 0; + } elsif ( $eacommand == 4 ) { + open(EALIST, "lsextattr -q user \"$file\" |"); + while() { + $_ = "\t".$_; + if ( $_ =~ /\torg\.netatalk\.Metadata[\n\t]/ ) { + close (EALIST); + return 1; + } + } + close (EALIST); + 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"); + } elsif ( $eacommand == 4 ) { + system("getextattr -q user org.netatalk.Metadata \"$file\" > $eatempfile"); } else { return ""; }