Package: inn2 / 2.5.3-3

inncheck-permissions Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/scripts/inncheck.in
+++ b/scripts/inncheck.in
@@ -73,13 +73,13 @@ my %checklist = (
 ##  0600 is allowed, but not 0500 for instance (not executable).
 ##  0660 is used when the file can contain passwords.
 my %modes = (
-    'active',		[0600, $INN::Config::filemode],
-    'incoming.conf',	[0400, 0660],
+    'active',		[0600, $INN::Config::filemode, $INN::Config::runasuser, $INN::Config::runasgroup],
+    'incoming.conf',	[0400, 0660, undef, $INN::Config::runasgroup],
     'inn.conf',		[0400, 0664],
-    'innfeed.conf',	[0400, 0660],
+    'innfeed.conf',	[0400, 0660, undef, $INN::Config::runasgroup],
     'moderators',	[0400, 0664],
     'newsfeeds',	[0400, 0664],
-    'passwd.nntp',	[0400, 0660],
+    'passwd.nntp',	[0400, 0660, undef, $INN::Config::runasgroup],
 );
 
 ##  The file and line we're currently at.
@@ -1024,7 +1024,7 @@ storage_conf
 sub
 checkperm
 {
-    my ($f, $m, $u, $g) = ( @_, $INN::Config::runasuser, $INN::Config::runasgroup);
+    my ($f, $m, $u, $g) = ( @_, 'root', 'root' );
     my (@sb, $owner, $group, $mode);
 
     die "Internal error, undefined name in perm from ", (caller(0))[2], "\n"
@@ -1032,6 +1032,10 @@ checkperm
     die "Internal error, undefined mode in perm from ", (caller(0))[2], "\n"
 	if !defined @$m;
 
+    # non-standard owner and group
+    $u = $m->[2] if $m->[2];
+    $g = $m->[3] if $m->[3];
+
     if ( ! -e $f ) {
 	eprint "$pfx$f:0: missing\n";
     }