#1 Thanx to everyone for their suggetsions
Based on these, here is a patch for v1.1 of mailconfig. This is
slightly less intrusive (skipping the directory listings of /lib in
favor of an ldconfig -p call). Plus minor other enhancements.
As always, point your browser at:
http://www.binary9.net/nicholas/kerneldb
And thank you again
--- mailconfig.v1 Wed Apr 24 22:05:54 1996
+++ mailconfig Thu Apr 25 11:07:21 1996
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# mailconfig
+# mailconfig v1.1
#
# Nicholas J. Leon [nicholas@binary9.net] 4/22/96
#
@@ -28,11 +28,14 @@
print "Gathering information from /proc\n";
while ($f=shift @files) {
- next unless -r "/proc/$f";
+ next unless open PROCFILE, "/proc/$f";
+
+ my @procinfo = <PROCFILE>;
+ close PROCFILE;
+ map (s/\0/\n/g, @procinfo);
print MAILOUT "$SEP proc $f\n";
- print MAILOUT `cat /proc/$f`;
- print MAILOUT "\n";
+ print MAILOUT @procinfo, "\n";
}
}
@@ -121,7 +124,8 @@
}
sub getCmdInfo {
- my(@cmds)=("gcc -v","ld -V","perl -v","perl -V","lilo -V");
+ my(@cmds)=("gcc -v", "ld -V", "ldd -v", "ldconfig -p", "perl -v",
+ "perl -V","lilo -V");
my($c);
print "Gathering information from various programs.\n";
@@ -134,19 +138,6 @@
}
-sub getDirs {
- my(@dirs)=("/lib","/usr/lib","/usr/local/lib");
- my($d);
-
- print "Gathering information from various directories.\n";
-
- while ($d=shift @dirs) {
- print MAILOUT "$SEP dir $d\n";
- print MAILOUT `ls -la $d`;
- print MAILOUT "\n";
- }
-}
-
$TMPFILE="/tmp/mailconfig.$$";
print <<EOT
@@ -169,21 +160,17 @@
exit unless $ans=~/^y/i;
-if (! -d "/proc") {
- print "Whoops! Mailconfig requires the /proc filesystem!\n";
- exit 1;
-}
+die "Whoops! Mailconfig requires the /proc filesystem!\n" unless -d "/proc";
open(MAILOUT,">$TMPFILE") || die "Couldn't open $TMPFILE: $!";
getProcInfo;
getCmdInfo;
getTargetInfo;
-getDirs;
close MAILOUT;
`mail -s 'KernelDB' kerneldb\@binary9.net < $TMPFILE` &&
die "Couldn't mail the results ($!), $TMPFILE left intact.\n";
-system("rm",$TMPFILE);
+unlink $TMPFILE;
N!
__________________________________________________________________________
Nicholas J. Leon (pgp/finger) nicholas@binary9.net
Shinanyaku on Kali:Central descent2/warcraft2
Technical Development, Wachovia Bank real job!