webmin/webmin-1.979-install_noroot.patch

67 lines
1.9 KiB
Diff
Raw Permalink Normal View History

--- webmin-1.979/setup.sh.orig 2021-08-08 14:23:37.063512514 +0200
+++ webmin-1.979/setup.sh 2021-08-08 14:25:02.508128368 +0200
@@ -39,17 +39,6 @@
echo "systems and common Unix services to be easily administered."
echo ""
-# Only root can run this
-id | grep -i "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
@@ -786,45 +775,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