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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
$NetBSD: patch-aa,v 1.5 2007/04/21 05:22:57 obache Exp $
--- setup.sh.orig 2007-04-09 05:00:00.000000000 +0000
+++ setup.sh
@@ -35,6 +35,11 @@ echo ""
# Only root can run this
id | grep "uid=0(" >/dev/null
+#
+# For pkgsrc, we allow anyone to run this script, including unprivileged
+# users.
+#
+true
if [ $? != "0" ]; then
uname -a | grep -i CYGWIN >/dev/null
if [ $? != "0" ]; then
@@ -122,6 +127,9 @@ if [ -r "$config_dir/config" ]; then
upgrading=1
fi
+# For pkgsrc, we are never upgrading, only installing.
+upgrading=0
+
# Check if upgrading from an old version
if [ "$upgrading" = 1 ]; then
echo ""
@@ -199,6 +207,10 @@ if [ "$upgrading" = 1 ]; then
else
# Config directory exists .. make sure it is not in use
ls $config_dir | grep -v rpmsave >/dev/null 2>&1
+ #
+ # For pkgsrc, we don't care if the config directory already exists.
+ #
+ false
if [ "$?" = "0" -a "$config_dir" != "/etc/webmin" ]; then
echo "ERROR: Config directory $config_dir is not empty"
echo ""
@@ -522,6 +534,12 @@ else
kfile=$config_dir/miniserv.pem
openssl version >/dev/null 2>&1
+ #
+ # For pkgsrc, we always want to use the default miniserv.pem, though
+ # we'll recommend to the user at post-install time to generate a
+ # new certificate.
+ #
+ false
if [ "$?" = "0" ]; then
# We can generate a new SSL key for this host
host=`hostname`
@@ -728,31 +746,34 @@ EOF
echo ""
fi
-echo "Changing ownership and permissions .."
-for m in $newmods; do
- chown -R root $config_dir/$m
- chgrp -R bin $config_dir/$m
- chmod -R og-rw $config_dir/$m
-done
-for f in miniserv.conf miniserv.pem miniserv.users; do
- chown -R root $config_dir/$f
- chgrp -R bin $config_dir/$f
- chmod -R og-rw $config_dir/$f
-done
-chmod +r $config_dir/version
-if [ "$nochown" = "" ]; then
- chown -R root "$wadir"
- chgrp -R bin "$wadir"
- chmod -R og-w "$wadir"
- chmod -R a+rx "$wadir"
-fi
-if [ $var_dir != "/var" ]; then
- chown -R root $var_dir
- chgrp -R bin $var_dir
- chmod -R og-rwx $var_dir
-fi
-echo "..done"
-echo ""
+# For pkgsrc, we skip changing ownership and permissions as we allow the
+# INSTALL/DEINSTALL to manage this for us.
+#
+#echo "Changing ownership and permissions .."
+#for m in $newmods; do
+# chown -R root $config_dir/$m
+# chgrp -R bin $config_dir/$m
+# chmod -R og-rw $config_dir/$m
+#done
+#for f in miniserv.conf miniserv.pem miniserv.users; do
+# chown -R root $config_dir/$f
+# chgrp -R bin $config_dir/$f
+# chmod -R og-rw $config_dir/$f
+#done
+#chmod +r $config_dir/version
+#if [ "$nochown" = "" ]; then
+# chown -R root "$wadir"
+# chgrp -R bin "$wadir"
+# chmod -R og-w "$wadir"
+# chmod -R a+rx "$wadir"
+#fi
+#if [ $var_dir != "/var" ]; then
+# chown -R root $var_dir
+# chgrp -R bin $var_dir
+# chmod -R og-rwx $var_dir
+#fi
+#echo "..done"
+#echo ""
# Save target directory if one was specified
if [ "$wadir" != "$srcdir" ]; then
|