On Fri, Mar 27, 2015 at 8:41 AM, Ingo Schwarze <schwa...@usta.de> wrote:
> Hi Denis,
>
> Denis Lapshin wrote on Thu, Mar 26, 2015 at 11:33:16AM +0300:
>
> > Some time ago start getting errors after nightly Secutiry running:
> >
> > Use of uninitialized value $home in concatenation (.)
> > or string at /usr/libexec/security line 356.
>
> Fixed in -current, thanks for reporting.
>
> Regarding the corrupted file /etc/passwd on your machine,
> use vipw(8) in the way i explained before.
>
> Note that 5.4 is old and no longer supported.
>
> Yours,
>   Ingo
>
>
good morning


my $homes = find_homes;
check_rhosts_owner @$_ foreach @$homes;

I am not sure about perl internal but aren 't you playing too much from @
to \@ lol


why not check_homes(sub {
  check_rhosts_content @_;
  check whaterver you want on passwd;
});

Just leaving that here:

#!/usr/bin/perl


use strict;
use v5.10;
use Data::Dumper;



sub whatever {
  open my $fh, '<', $ARGV[0] or die 'oops'.$!;
  my @passwd = map [ @{[split /:/]}[0,2,5] ], <$fh>;

  my @homes = grep {
    $_[0]($_);
  } @passwd;

  return \@homes;
}

my $check_home = sub {
  say Dumper($_) ;
  unless ( -d $_->[ 2 ] ) {
    warn $_->[ 2 ].' is not existing, so what ? ';
    return;
  }
  return 1;
};

say Dumper(whatever($check_home));


-- 
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail
/\

Reply via email to