Commit ce36dba8 authored by Mac Newbold's avatar Mac Newbold

Fix regular expression for osids, add username to error notification.

parent 5a90cbd8
......@@ -83,7 +83,7 @@ my $osid = shift;
my @nodes = @ARGV;
# Untaint args.
if ($osid =~ /^([-\@\w\/]+)$/) { $osid = $1; }
if ($osid =~ /^([-\@\w\/\.]+)$/) { $osid = $1; }
elsif (!$mfs) { fatal("Bad data in osid: '$osid'\n"); }
if ($mfs) {
......@@ -243,13 +243,14 @@ sub debug ( $;$ ) {
my $notice = shift || 0;
my $prio="info";
if ($notice) { $prio = "notice"; }
syslog($prio,$msg) || print "syslog failed: $! $?\n";;
syslog($prio,$msg) || notify("syslog failed: $! $?\n");
if ($d) { print $msg; }
}
sub notify ( $ ) {
my $msg = shift;
$msg .= "\ndate=".`date`."\ncmdline=\n$cmdline\n\npid=$$\n";
my $user= getpwuid($UID);
$msg .= "\ndate=".`date`."\ncmdline=\n$cmdline\n\npid=$$\n\nuser=$user\n";
if (!$d) {
SENDMAIL($TBOPS,"os_select error",$msg,$TBOPS);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment