aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/webmin/files/init-exclude.patch
blob: 135492d713f41b97bbc2373b5db8081061472cff (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Hack in support for an "exclude" config option for the init module, so
# we can hide certain system services that shouldn't really be configurable
# via the web interface
#
# Upstream-status: Pending
#
# Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
--- webmin-1.570.orig/init/index.cgi
+++ webmin-1.570/init/index.cgi
@@ -48,19 +48,20 @@ elsif ($init_mode eq "init" && $access{'
 					     : "$config{'init_dir'}/$ac[0]");
 		}
 	@runlevels = &list_runlevels();
-	foreach $r (@runlevels) {
-		foreach $w ("S", "K") {
-			foreach $a (&runlevel_actions($r, $w)) {
-				@ac = split(/\s+/, $a);
-				if (!$nodemap{$ac[2]}) {
-					push(@acts, $ac[1]);
-					push(@actsl,
-					     "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
-					push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
-					}
-				}
-			}
-		}
+	# Assume there won't be any of these broken actions
+	#foreach $r (@runlevels) {
+	#	foreach $w ("S", "K") {
+	#		foreach $a (&runlevel_actions($r, $w)) {
+	#			@ac = split(/\s+/, $a);
+	#			if (!$nodemap{$ac[2]}) {
+	#				push(@acts, $ac[1]);
+	#				push(@actsl,
+	#				     "1+$r+$ac[0]+$ac[1]+$ac[2]+$w");
+	#				push(@actsf, "$config{'init_base'}/rc$r.d/$w$ac[0]$ac[1]");
+	#				}
+	#			}
+	#		}
+	#	}
 
 	# For each action, look at /etc/rc*.d/* files to see if it is 
 	# started at boot
Index: webmin-1.570/init/init-lib.pl
===================================================================
--- webmin-1.570.orig/init/init-lib.pl
+++ webmin-1.570/init/init-lib.pl
@@ -108,15 +108,17 @@ List boot time action names from init.d,
 =cut
 sub list_actions
 {
-local($dir, $f, @stbuf, @rv);
+local($dir, $f, @stbuf, @rv, @exclude);
 $dir = $config{init_dir};
+@exclude = split(/,/, $config{exclude});
 opendir(DIR, $dir);
 foreach $f (sort { lc($a) cmp lc($b) } readdir(DIR)) {
 	if ($f eq "." || $f eq ".." || $f =~ /\.bak$/ || $f eq "functions" ||
 	    $f eq "core" || $f eq "README" || $f eq "rc" || $f eq "rcS" ||
 	    -d "$dir/$f" || $f =~ /\.swp$/ || $f eq "skeleton" ||
 	    $f =~ /\.lock$/ || $f =~ /\.dpkg-(old|dist)$/ ||
-	    $f =~ /^\.depend\./ || $f eq '.legacy-bootordering') { next; }
+	    $f =~ /^\.depend\./ || $f eq '.legacy-bootordering' ||
+	    grep {$_ eq $f} @exclude ) { next; }
 	if (@stbuf = stat("$dir/$f")) {
 		push(@rv, "$f $stbuf[1]");
 		}