# HG changeset patch # User heiko # Date 1390915817 -3600 # Node ID ecd7c783aba41b0e14f187dada7260b245483c2b # Parent ae403e3c2a41f80bd0fa65832ca4a726e9bac3bb Added better output to check_permissions. diff -r ae403e3c2a41 -r ecd7c783aba4 plugins/check_amanda-client --- a/plugins/check_amanda-client Sat Jan 25 23:59:32 2014 +0100 +++ b/plugins/check_amanda-client Tue Jan 28 14:30:17 2014 +0100 @@ -54,6 +54,9 @@ *::verbose = $opt_verbose ? sub { say '# ', @_ } : sub { }; + verbose('setting working directory to /, this avoids permission problems'); + chdir '/'; + # test needs to be run as root:* or as backup:backup # change to backup if still root su $USER if $> == 0; @@ -119,7 +122,7 @@ sub find_tool { my $name = shift; my @rc = grep { -f -x } map { catfile $_, $name } split /:/, $ENV{PATH} - or die "Can't find `$name' in $ENV{PATH}\n"; + or die "Can't find executable `$name' in $ENV{PATH}\n"; $rc[0]; } @@ -139,8 +142,13 @@ my $f_mode = (stat _)[2] & 07777 or die $!; my $msg = - sprintf "need: 0%04o root:$group, got: 0%04o $f_owner:$f_group\n", - $mode, $f_mode; + sprintf "need: 0%04o root:%s, got: 0%04o %s:%s\n", + $mode, $group, $f_mode, $f_owner, $f_group; + + if (-f '/etc/debian_version') { + $msg .= sprintf "try dpkg-statoverride --update --add root %sgroup 0%04o %s\n", + $group, $mode, $file; + } die $msg unless $f_owner eq $owner; die $msg unless $f_group eq $group;