3 # Sets all the XFS attributes for a file
5 require './file-lib.pl';
6 $disallowed_buttons{'attr'} && &error($text{'ebutton'});
8 &webmin_log("attr", undef, $in{'file'}, \%in);
9 &switch_acl_uid_and_chroot();
10 print "Content-type: text/plain\n\n";
11 if ($access{'ro'} || !&can_access($in{'file'})) {
12 print $text{'facl_eaccess'},"\n";
17 for($i=0; defined($n = $in{"name$i"}); $i++) {
22 $out = `attr -s '$n' '$in{'file'}' <$temp 2>&1`;
31 # Remove those that no longer exist
32 $out = `attr -l '$in{'file'}' 2>&1`;
33 foreach $l (split(/[\r\n]+/, $out)) {
34 if ($l =~ /Attribute\s+"(.*)"/i && !$set{$1}) {
35 $out = `attr -r '$1' '$in{'file'}' 2>&1`;