Last change
on this file since 645 was
645,
checked in by quentin, 17 years ago
|
syslog-ng configuration for zephyring when root logs in
|
-
Property svn:executable set to
*
|
File size:
533 bytes
|
Rev | Line | |
---|
[645] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use Sys::Hostname; |
---|
| 6 | |
---|
| 7 | sub sendmsg { |
---|
| 8 | my ($message) = @_; |
---|
| 9 | open(ZWRITE, "|-", qw|/usr/bin/zwrite -d -c scripts -i root -s|, hostname) or die "Couldn't open zwrite"; |
---|
| 10 | print ZWRITE $message; |
---|
| 11 | close(ZWRITE); |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | my $last; |
---|
| 15 | |
---|
| 16 | while (my $message = <>) { |
---|
| 17 | chomp $message; |
---|
| 18 | $message =~ s/^(.*?): //; |
---|
| 19 | if ($message =~ m|Accepted (\S+) for root|) { |
---|
| 20 | my $send = $message; |
---|
| 21 | if ($1 eq "gssapi-with-mic") { |
---|
| 22 | $send = $last."\n".$send; |
---|
| 23 | } |
---|
| 24 | sendmsg($send); |
---|
| 25 | } |
---|
| 26 | $last = $message; |
---|
| 27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.