webmin/webmin-1.640-install_noroot.patch

81 lines
2.4 KiB
Diff

diff -Nru webmin-1.420.orig/setup.sh webmin-1.420/setup.sh
--- webmin-1.420.orig/setup.sh 2008-06-04 15:08:13.000000000 +0200
+++ webmin-1.420/setup.sh 2008-06-04 15:11:17.000000000 +0200
@@ -33,17 +33,6 @@
echo "systems and common Unix services to be easily administered."
echo ""
-# Only root can run this
-id | grep "uid=0(" >/dev/null
-if [ $? != "0" ]; then
- uname -a | grep -i CYGWIN >/dev/null
- if [ $? != "0" ]; then
- echo "ERROR: The Webmin install script must be run as root";
- echo "";
- exit 1;
- fi
-fi
-
# Use the supplied destination directory, if any
if [ "$1" != "" ]; then
wadir=$1
@@ -364,12 +353,6 @@
echo ""
exit 12
fi
- $perl -e 'use Socket; socket(FOO, PF_INET, SOCK_STREAM, getprotobyname("tcp")); setsockopt(FOO, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); bind(FOO, pack_sockaddr_in($ARGV[0], INADDR_ANY)) || exit(1); exit(0);' $port
- if [ $? != "0" ]; then
- echo "ERROR: TCP port $port is already in use by another program"
- echo ""
- exit 13
- fi
printf "Login name (default admin): "
if [ "$login" = "" ]; then
read login
@@ -740,45 +740,6 @@
echo ""
fi
-echo "Changing ownership and permissions .."
-# Make all config dirs non-world-readable
-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
-# Make miniserv config files non-world-readable
-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
- # Make program directory non-world-writable, but executable
- chown -R root "$wadir"
- chgrp -R bin "$wadir"
- chmod -R og-w "$wadir"
- chmod -R a+rx "$wadir"
-fi
-if [ $var_dir != "/var" -a "$upgrading" != 1 ]; then
- # Make log directory non-world-readable or writable
- chown -R root $var_dir
- chgrp -R bin $var_dir
- chmod -R og-rwx $var_dir
-fi
-# Fix up bad permissions from some older installs
-for m in ldap-client ldap-server ldap-useradmin mailboxes mysql postgresql servers virtual-server; do
- if [ -d "$config_dir/$m" ]; then
- chown root $config_dir/$m
- chgrp bin $config_dir/$m
- chmod og-rw $config_dir/$m
- chmod og-rw $config_dir/$m/config 2>/dev/null
- fi
-done
-echo "..done"
-echo ""
-
# Save target directory if one was specified
if [ "$wadir" != "$srcdir" ]; then
echo $wadir >$config_dir/install-dir