Handle hostnames with upper-case letters
[webmin.git] / file / getext.cgi
1 #!/usr/local/bin/perl
2 # getext.cgi
3 # Returns a string of EXT attributes for some file
4
5 require './file-lib.pl';
6 &ReadParse();
7 &switch_acl_uid_and_chroot();
8 print "Content-type: text/plain\n\n";
9 if (!&can_access($in{'file'})) {
10         print $text{'facl_eaccess'},"\n";
11         }
12 else {
13         $out = `lsattr -d '$in{'file'}' 2>&1`;
14         $out =~ s/^lsattr.*\n//;
15         if ($? || $out !~ /^(\S+)\s/) {
16                 print $out,"\n";
17                 }
18         else {
19                 print "\n";
20                 @a = split(//, $1);
21                 print join("", grep { $_ ne '-' } @a),"\n";
22                 }
23         }
24
25