X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=contrib%2Fshell_utils%2Fapple_dump.in;fp=contrib%2Fshell_utils%2Fapple_dump.in;h=76ca18484bc133419134218f6e58d22c4faa447f;hb=45de28fff51f6dcc354c4fabfda9bdb570324194;hp=e7cc759adb828b9e31289f6c0a673c5ae8ed766f;hpb=86452598be0482436cf6ff39b6690566c33eb79d;p=netatalk.git diff --git a/contrib/shell_utils/apple_dump.in b/contrib/shell_utils/apple_dump.in index e7cc759a..76ca1848 100755 --- a/contrib/shell_utils/apple_dump.in +++ b/contrib/shell_utils/apple_dump.in @@ -833,8 +833,12 @@ sub hexdump { sub checkea { my ($file) = @_; + $file =~ s/\\/\\\\/g; + $file =~ s/\"/\\\"/g; + $file =~ s/\$/\\\$/g; + $file =~ s/\`/\\\`/g; if ( $eacommand == 1 ) { - open(EALIST, "getfattr ".$file." |"); + open(EALIST, "getfattr \"$file\" |"); while() { if ( $_ eq "user.org.netatalk.Metadata\n" ) { close (EALIST); @@ -844,7 +848,7 @@ sub checkea { close (EALIST); return 0; } elsif ( $eacommand == 2 ) { - open(EALIST, "attr -q -l ".$file." |"); + open(EALIST, "attr -q -l \"$file\" |"); while() { if ( $_ eq "org.netatalk.Metadata\n" ) { close (EALIST); @@ -854,7 +858,7 @@ sub checkea { close (EALIST); return 0; } elsif ( $eacommand == 3 ) { - open(EALIST, "runat ".$file." ls -1 |"); + open(EALIST, "runat \"$file\" ls -1 |"); while() { if ( $_ eq "org.netatalk.Metadata\n" ) { close (EALIST); @@ -871,14 +875,18 @@ sub checkea { sub eaopenfile { my ($file) = @_; + $file =~ s/\\/\\\\/g; + $file =~ s/\"/\\\"/g; + $file =~ s/\$/\\\$/g; + $file =~ s/\`/\\\`/g; ($eatempfh, $eatempfile) = tempfile(UNLINK => 1); if ( $eacommand == 1 ) { - system("getfattr --only-values -n user.org.netatalk.Metadata $file > $eatempfile"); + system("getfattr --only-values -n user.org.netatalk.Metadata \"$file\" > $eatempfile"); } elsif ( $eacommand == 2 ) { - system("attr -q -g org.netatalk.Metadata $file > $eatempfile"); + system("attr -q -g org.netatalk.Metadata \"$file\" > $eatempfile"); } elsif ( $eacommand == 3 ) { - system("runat $file cat org.netatalk.Metadata > $eatempfile"); + system("runat \"$file\" cat org.netatalk.Metadata > $eatempfile"); } else { return ""; }