summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-04-17 10:48:02 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-04-17 10:48:02 +0000
commit3d9b6ab16bfb84f1a0715f5ecdd44c7e1d32ee4a (patch)
tree3825e1e91e44c999119da7d0d27b6698232921ce /libexec
parent53e226a601594dc7f8e6613edb67b4fe5a4d109e (diff)
Keep the exact format of the message:
user %s mailbox is %s, group %s This is easy because we now have the strmode() function. From Andrew Fresh, minimally tweaked myself.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/security/security9
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/security/security b/libexec/security/security
index e6889a44537..82ee372d35e 100644
--- a/libexec/security/security
+++ b/libexec/security/security
@@ -1,6 +1,6 @@
#!/usr/bin/perl -T
-# $OpenBSD: security,v 1.8 2011/04/10 23:28:48 schwarze Exp $
+# $OpenBSD: security,v 1.9 2011/04/17 10:48:01 schwarze Exp $
#
# Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
# Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>
@@ -444,13 +444,14 @@ sub check_mailboxes {
nag !(opendir my $dh, $dir), "opendir: $dir: $!" and return;
foreach my $name (readdir $dh) {
next if $name =~ /^\.\.?$/;
- my ($mode, $fuid) = (stat "$dir/$name")[2,4];
+ my ($mode, $fuid, $fgid) = (stat "$dir/$name")[2,4,5];
my $fname = (getpwuid $fuid)[0] || $fuid;
+ my $gname = (getgrgid $fgid)[0] || $fgid;
nag $fname ne $name,
"user $name mailbox is owned by $fname";
nag S_IMODE($mode) != (S_IRUSR | S_IWUSR),
- sprintf 'user %s mailbox permissions are %04o',
- $name, S_IMODE($mode);
+ sprintf 'user %s mailbox is %s, group %s',
+ $name, strmode($mode), $gname;
}
closedir $dh;
}