Mercurial > pkg
comparison src/pkg-files.pl @ 34:6422228dfea7
better name.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 10 Feb 2013 05:52:35 -0500 |
parents | src/pkg-examine.pl@819e950ac8cc |
children | 4823f88ea3b6 |
comparison
equal
deleted
inserted
replaced
33:4c49f8e6d79d | 34:6422228dfea7 |
---|---|
1 #!/usr/bin/perl | |
2 use File::stat; | |
3 | |
4 if ($ARGV[0] eq "--help"){ | |
5 print <<"HERE"; | |
6 | |
7 pkg-examine -- print package contents. | |
8 | |
9 Written by Robert McIntyre. This software is free | |
10 software and is released to the public domain. | |
11 | |
12 HERE | |
13 exit 0; | |
14 } | |
15 | |
16 $" = " "; | |
17 $pkg_name = $ARGV[0]; | |
18 | |
19 `id -g $pkg_name 2>/dev/null`; | |
20 if (($pkg_name eq "") || $?){ | |
21 print "No group named $pkg_name.\n"; | |
22 exit 0; | |
23 } | |
24 | |
25 @files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`); | |
26 | |
27 | |
28 print "All files owned by this package:\n"; | |
29 foreach (@files){print " $_\n";} | |
30 | |
31 print "SetUID/SetGID files:\n"; | |
32 foreach $file(@files){ | |
33 | |
34 $sb = stat($file); | |
35 $mode = $sb->mode & 07777; | |
36 if ($mode & 07000){ | |
37 printf "%s, %04o\n", $file, $mode; | |
38 } | |
39 } | |
40 | |
41 | |
42 | |
43 | |
44 |