mirror of https://github.com/schoebel/mars
marsadm: show wrong permissions
Feature request by Tilmann Steinberg. It greatly eases debugging when searching for a source of wrong permissions. Some admin tools like Puppet seem to have their own default notion of "secure permissions" and try to "fix" them ;)
This commit is contained in:
parent
c0d57bef7a
commit
8c3cfe97f3
|
@ -5087,8 +5087,10 @@ if ($mars_stat[4]) {
|
||||||
lwarn "Fixed by setting to 0.\n";
|
lwarn "Fixed by setting to 0.\n";
|
||||||
}
|
}
|
||||||
# check permissions
|
# check permissions
|
||||||
if ($mars_stat[2] & 077777 != 0700) {
|
my $perms = ($mars_stat[2] & 07777);
|
||||||
lwarn "Directory $mars has wrong permissions.\n";
|
if ($perms != 0700) {
|
||||||
|
my $txt = sprintf("Directory $mars has wrong permissions 0%o.\n", $perms);
|
||||||
|
lwarn($txt);
|
||||||
chmod(0700, $mars) or ldie "Cannot chmod $mars.\n";
|
chmod(0700, $mars) or ldie "Cannot chmod $mars.\n";
|
||||||
lwarn "Fixed to mode 0700 for security reasons.\n";
|
lwarn "Fixed to mode 0700 for security reasons.\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue