BradV has asked for the wisdom of the Perl Monks concerning the following question:
I have a Big Brother perl script which reads the system auth log to generate a report. I have put the full path to the perl script in the sudoers file and have Big Brother configured to run a bash script. That bash script simply has the entry:
sudo /usr/local/bbuser/ext/bb-audit.plThis works fine under Linux since the whole perl script is getting executed with elevated privileges. Solaris, on the other hand, does not like it and barfs when I try to open the log file. I have in the perl script:
if ( `uname -s` eq "SunOS" ) { $file="/var/log/authlog" } else { $file="/var/log/secure" } my $fh=IO::File->new($file, O_RDONLY) or die 'Could not open file ', $ +file, ": $!";
Solaris 10 continually fails with:
Could not open file /var/log/authlog: Permission denied at /usr/local/bbuser/ext/bb-audit.pl line 96.Line 96 is the IO::File->new line. Any thoughts on how to make this work under Solaris?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sudo setting to read auth log
by JavaFan (Canon) on Apr 16, 2012 at 10:51 UTC | |
by BradV (Sexton) on Apr 16, 2012 at 15:34 UTC | |
by JavaFan (Canon) on Apr 16, 2012 at 16:31 UTC | |
by BradV (Sexton) on Apr 17, 2012 at 09:54 UTC |