Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=emul32-tools/.git;a=commitdiff;h=adad55e98017d118d6c4dea55a572df7d26b92bc

commit adad55e98017d118d6c4dea55a572df7d26b92bc
Author: VMiklos <[EMAIL PROTECTED]>
Date:   Sun Jul 22 01:44:23 2007 +0200

emul32: new --mount, --umount and --linux32 switches
this way no need to grant permission to execute linux32 and others as root
(which would be equal to grant permission to execute bash as root)

diff --git a/README.Frugalware b/README.Frugalware
index cbc8305..5fc782e 100644
--- a/README.Frugalware
+++ b/README.Frugalware
@@ -32,9 +32,6 @@ directory.

Second, you need to add your user to the `/etc/sudoers` file. See an example:

-// FIXME: we need sudo for mount/linux32/umount currently, right?
-// we could add --mount/--linux32/--umount options to emul32 to limit secholes
-
----
krics ALL=(ALL) NOPASSWD: /usr/bin/emul32
----
diff --git a/emul32 b/emul32
index e86848c..280e3a4 100644
--- a/emul32
+++ b/emul32
@@ -20,6 +20,17 @@
#   USA.
#

+if [ "$1" = "--mount" ]; then
+       mount -o bind /home/$USER/Common /usr/lib/chroot32/home/$USER/Common
+       exit $?
+elif [ "$1" = "--umount" ]; then
+       umount /home/$USER/Common
+       exit $?
+elif [ "$1" = "--linux32" ]; then
+       linux32 /usr/sbin/chroot /usr/lib/chroot32/
+       exit $?
+fi
+
if [ ! "`type -p linux32`" ]; then
echo "Cannot find the linux32 binary! Is linux32 installed?"
exit 1
@@ -44,12 +55,12 @@ if [ ! -d /home/$USER/Common ]; then
fi

if [ -d /home/$USER/Common ]; then
-    sudo mount -o bind /home/$USER/Common /usr/lib/chroot32/home/$USER/Common
+    sudo $0 --mount
fi

echo "if [ ! -d /home/$USER/Common ]; then mkdir -p /home/$USER/Common; chown 
-R $USER:users /home/$USER; fi; \
-/bin/su - $USER -c \"$cmd\"" |sudo linux32 /usr/sbin/chroot /usr/lib/chroot32/
+/bin/su - $USER -c \"$cmd\"" |sudo $0 --linux32

-sudo umount /home/$USER/Common
+sudo $0 --umount

xhost -local:localhost >/dev/null
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to