The attached patch is needed to correctly emulate setuid executables.
With this change, and by making qemu be setuid root (and assumming all
of the risks and responsibilites of doing so), executables such as
/bin/su will be able to create the correct environment.


                                Stuart

Stuart R. Anderson                               [EMAIL PROTECTED]
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                 BD03 0A62 E534 37A7 9149
Index: linux-user/linuxload.c
===================================================================
RCS file: /sources/qemu/qemu/linux-user/linuxload.c,v
retrieving revision 1.2
diff -u -r1.2 linuxload.c
--- linux-user/linuxload.c      19 Nov 2006 20:29:35 -0000      1.2
+++ linux-user/linuxload.c      19 Mar 2007 15:09:50 -0000
@@ -78,6 +78,8 @@
        if(bprm->e_uid != geteuid()) {
            id_change = 1;
        }
+    } else {
+      seteuid(getuid());
     }
 
     /* Set-gid? */
@@ -91,6 +93,8 @@
        if (!in_group_p(bprm->e_gid)) {
                id_change = 1;
        }
+    } else {
+      setegid(getgid());
     }
 
     memset(bprm->buf, 0, sizeof(bprm->buf));
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to