Changeset 1911 for branches


Ignore:
Timestamp:
Jun 17, 2011, 8:40:06 PM (11 years ago)
Author:
achernya
Message:
Make d_zroot work properly

d_zroot.pl was copied to a-h, and it was noticed that it failed quite
horribly. Fixed by Quentin, these changes are also relevant to the
Fedora VMs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fc15-dev/server/fedora/config/etc/syslog-ng/d_zroot.pl

    r1747 r1911  
    3232sub buildKeyMap($) {
    3333    my ($file) = @_;
    34     open (KEYS, $file) or warn "Couldn't open $file: $!";
     34    open (KEYS, $file) or (warn "Couldn't open $file: $!\n" and return);
    3535    while (<KEYS>) {
    3636        chomp;
     
    5858buildKeyMap("/root/.ssh/authorized_keys2");
    5959
    60 while (1) {
    61     my @message = scalar(<>);
     60my @message;
     61
     62while (my $line = <>) {
     63    @message = $line;
    6264    eval {
    6365        local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
     
    8082        } elsif ($message =~ m|Root (\S+) shell|) {
    8183            sendmsg($message);
    82         } elsif ($message =~ m|session \S+ for user (\S+)|) {
    83             sendmsg($message) if exists $USERS{$1};
     84        } elsif ($message =~ m|pam_unix\(([^:]+):session\): session \S+ for user (\S+)|) {
     85            sendmsg($message) if $1 ne "cron" and exists $USERS{$2};
    8486        } elsif ($message =~ m|^Found matching (\w+) key: (\S+)|) {
    8587            if ($sshkeys{$2}) {
Note: See TracChangeset for help on using the changeset viewer.