From 2aee767bb3db8721868a54f583d88961d8b354f8 Mon Sep 17 00:00:00 2001 From: HAT Date: Mon, 16 Jul 2012 22:32:54 +0900 Subject: [PATCH] apple_dump: Extended Attributes AppleDouble support for *BSD --- NEWS | 1 + contrib/shell_utils/apple_dump.in | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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 ""; } -- 2.39.2