All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH] Starting a command inside UML from mconsole
@ 2003-09-13 16:20 BlaisorBlade
  2003-09-13 19:48 ` Matt Zimmerman
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: BlaisorBlade @ 2003-09-13 16:20 UTC (permalink / raw)
  To: user-mode-linux-devel

I'm writing a patch which adds a new command to the mconsole ones:
exec nomeprog args
which starts a new program with root privileges. I've already done the hard 
part(starting the program) and it seems to basically work(no crash still), 
which is done mostly reusing code from kernel/kmod.c; I'll post the patch 
only when I'll have written also the simple part, i.e., the code to parse the 
command-line.

Reason for this: time ago, someone requested how to execute a command from 
mconsole. The discussion ended up by saying "use cad, after having changed 
the related line in /etc/inittab". The command needed was the one to poweroff 
the PC, but this applies generally. Since that thread showed that running 
commands without logging in is something needed, I decided to implement it.

I'd like a discussion about this(how much interest in this there is, 
suggestions, requests). Especially:
- is the ability to read arguments with spaces(within quotes) needed even for 
the program name?
About the way I'm doing it, I'll ask when the true patch is ready(it's just 
too young, so I want to study more before making you lose your time).
Thanks for the attention.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-13 16:20 [uml-devel] [PATCH] Starting a command inside UML from mconsole BlaisorBlade
@ 2003-09-13 19:48 ` Matt Zimmerman
  2003-09-14 18:50   ` BlaisorBlade
  2003-09-14  2:33 ` Jeff Dike
  2003-09-16 18:27 ` BlaisorBlade
  2 siblings, 1 reply; 19+ messages in thread
From: Matt Zimmerman @ 2003-09-13 19:48 UTC (permalink / raw)
  To: user-mode-linux-devel

On Sat, Sep 13, 2003 at 06:20:45PM +0200, BlaisorBlade wrote:

> Reason for this: time ago, someone requested how to execute a command from 
> mconsole. The discussion ended up by saying "use cad, after having changed 
> the related line in /etc/inittab". The command needed was the one to poweroff 
> the PC, but this applies generally. Since that thread showed that running 
> commands without logging in is something needed, I decided to implement it.
> 
> I'd like a discussion about this(how much interest in this there is, 
> suggestions, requests). Especially:

This is interesting.  I wrote a small client/server system for the purpose
of programmatically executing programs within UML.  It works nicely, with
the exception that it is necessary to install the server within UML in order
for it to work.  It would be nice to be able to do this with a pristine UML.

What do you do with stdin, stdout and stderr?  I connect them to a UML
serial device, which can be connected to the tty (for interactive programs)
or any other UML channel.

> - is the ability to read arguments with spaces(within quotes) needed even for 
> the program name?

I don't think this is particularly crucial; does it cause some unexpected
difficulty?

-- 
 - mdz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-13 16:20 [uml-devel] [PATCH] Starting a command inside UML from mconsole BlaisorBlade
  2003-09-13 19:48 ` Matt Zimmerman
@ 2003-09-14  2:33 ` Jeff Dike
  2003-09-14  6:30   ` Matt Zimmerman
                     ` (3 more replies)
  2003-09-16 18:27 ` BlaisorBlade
  2 siblings, 4 replies; 19+ messages in thread
From: Jeff Dike @ 2003-09-14  2:33 UTC (permalink / raw)
  To: BlaisorBlade, Matt Zimmerman; +Cc: user-mode-linux-devel

blaisorblade_spam@yahoo.it said:
> I'm writing a patch which adds a new command to the mconsole ones:
> exec nomeprog args 
> which starts a new program with root privileges.

My reaction to this is that you should log in and execute the command from
the shell.

> Since that thread showed that running  commands without logging in is
> something needed

OK, what's so horrible about logging in?

				Jeff



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14  2:33 ` Jeff Dike
@ 2003-09-14  6:30   ` Matt Zimmerman
  2003-09-14  6:45   ` Russell Coker
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Matt Zimmerman @ 2003-09-14  6:30 UTC (permalink / raw)
  To: user-mode-linux-devel

On Sat, Sep 13, 2003 at 10:33:05PM -0400, Jeff Dike wrote:

> OK, what's so horrible about logging in?

It's difficult to reliably automate.  It's a human interface, not a
programmatic one.

-- 
 - mdz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14  2:33 ` Jeff Dike
  2003-09-14  6:30   ` Matt Zimmerman
@ 2003-09-14  6:45   ` Russell Coker
  2003-09-14  7:59   ` Steve Schnepp
  2003-09-14 17:10   ` BlaisorBlade
  3 siblings, 0 replies; 19+ messages in thread
From: Russell Coker @ 2003-09-14  6:45 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel

On Sun, 14 Sep 2003 12:33, Jeff Dike wrote:
> blaisorblade_spam@yahoo.it said:
> > I'm writing a patch which adds a new command to the mconsole ones:
> > exec nomeprog args
> > which starts a new program with root privileges.
>
> My reaction to this is that you should log in and execute the command from
> the shell.
>
> > Since that thread showed that running  commands without logging in is
> > something needed
>
> OK, what's so horrible about logging in?

I've been having some problems while experimenting with boot scripts etc which 
can prevent logging in.  Having an external method of just launching a shell 
would make it a lot easier...

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14  2:33 ` Jeff Dike
  2003-09-14  6:30   ` Matt Zimmerman
  2003-09-14  6:45   ` Russell Coker
@ 2003-09-14  7:59   ` Steve Schnepp
  2003-09-14 13:50     ` Jeff Dike
  2003-09-14 17:10   ` BlaisorBlade
  3 siblings, 1 reply; 19+ messages in thread
From: Steve Schnepp @ 2003-09-14  7:59 UTC (permalink / raw)
  To: UML Devel ML

On Sat, Sep 13, 2003 at 10:33:05PM -0400, Jeff Dike wrote:
> OK, what's so horrible about logging in?

Having to run some kind of 'logging in' daemon inside.
[ getty / sshd / telnetd / ... ]

	Steve

-- 
GPG public key available from http://snide.free.fr/gpg/snide-free.fr.asc
   Or by email to "snide at free.fr" with "send key pub" as subject
   Fingerprint: 8378 141B 2999 0A35 82D0   6D01 678F 0992 1FEA 4E51


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14  7:59   ` Steve Schnepp
@ 2003-09-14 13:50     ` Jeff Dike
  2003-09-14 16:36       ` Matt Zimmerman
  0 siblings, 1 reply; 19+ messages in thread
From: Jeff Dike @ 2003-09-14 13:50 UTC (permalink / raw)
  To: Steve Schnepp, Russell Coker, Matt Zimmerman; +Cc: UML Devel ML

snide@free.fr said:
> Having to run some kind of 'logging in' daemon inside. 

russell@coker.com.au said:
> I've been having some problems while experimenting with boot scripts
> etc which  can prevent logging in.

mdz@debian.org said:
> It's difficult to reliably automate.

Then give the UML a special console that doesn't make you log in, and just 
gives you a root shell.

				Jeff



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 13:50     ` Jeff Dike
@ 2003-09-14 16:36       ` Matt Zimmerman
  0 siblings, 0 replies; 19+ messages in thread
From: Matt Zimmerman @ 2003-09-14 16:36 UTC (permalink / raw)
  To: UML Devel ML

On Sun, Sep 14, 2003 at 09:50:55AM -0400, Jeff Dike wrote:

> mdz@debian.org said:
> > It's difficult to reliably automate.
> 
> Then give the UML a special console that doesn't make you log in, and just 
> gives you a root shell.

Even once you've logged in, you have to deal with things like _reliably_
detecting a shell prompt, aliases, and other nastiness that comes with an
interactive shell.

It also requires that the UML system be specially configured, at which point
there are already many other ways to do it.

-- 
 - mdz


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14  2:33 ` Jeff Dike
                     ` (2 preceding siblings ...)
  2003-09-14  7:59   ` Steve Schnepp
@ 2003-09-14 17:10   ` BlaisorBlade
  2003-09-14 17:45     ` Michael Richardson
  3 siblings, 1 reply; 19+ messages in thread
From: BlaisorBlade @ 2003-09-14 17:10 UTC (permalink / raw)
  To: user-mode-linux-devel

Alle 04:33, domenica 14 settembre 2003, Jeff Dike ha scritto:
> blaisorblade_spam@yahoo.it said:

> > I'm writing a patch which adds a new command to the mconsole ones:
> > exec nomeprog args
> > which starts a new program with root privileges.

I must recall this part of my message:
> > Since that thread showed that running  commands without logging in is
> > something needed
> OK, what's so horrible about logging in?
> 				Jeff
However, ask to the admins who wanted to poweroff the UML guest without 
logging in and which decided to change the cad handler. This is, for me, a 
cleaner and more general way to do such things.
In fact, I already thought about such things(), but mconsole is already an 
exception to the "logging in" rule. And has no big security implication, 
since to start mconsole you need anyway the privileges of UML owner on the 
host, and can already halt or reboot whatever.
Beyond, I've read an article about the possibilities of the VMWare GUI(I think 
that UMLd is already something such), and to recreate them I thought that 
something such was useful.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 17:10   ` BlaisorBlade
@ 2003-09-14 17:45     ` Michael Richardson
  2003-09-14 20:28       ` Henrik Nordstrom
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Richardson @ 2003-09-14 17:45 UTC (permalink / raw)
  To: user-mode-linux-devel

-----BEGIN PGP SIGNED MESSAGE-----


It is entirely reasonable that the admin of the host system doesn't even
have login priveledges on the guest system, but would like the guest to
shutdown nicely before he reboots the host.

]      Out and about in Ottawa.    hmmm... beer.                |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another Debian/notebook using, kernel hacking, security guy");  [
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys - custom hacks make this fully PGP2 compat

iQCVAwUBP2SpHIqHRg3pndX9AQHc5AP+NLO98XZZEyOIxEHviePfJRT7hHIQPQeh
vAfx6Fj0qyag0AWZmes/CKNk4fSHyHkakbJCRs4u/gUrXatS3xPXCo4xC4k7ndKG
UmDwj6ZBu5NAMDAvXdkOPOM/FQMqh9o8UBUF0a9t9yzwpZEomUUArY7aGx/nTxWB
tBnqko38+VY=
=JlxK
-----END PGP SIGNATURE-----


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-13 19:48 ` Matt Zimmerman
@ 2003-09-14 18:50   ` BlaisorBlade
  2003-09-14 20:33     ` Henrik Nordstrom
  2003-09-15 17:12     ` BlaisorBlade
  0 siblings, 2 replies; 19+ messages in thread
From: BlaisorBlade @ 2003-09-14 18:50 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]

Alle 21:48, sabato 13 settembre 2003, Matt Zimmerman ha scritto:
> On Sat, Sep 13, 2003 at 06:20:45PM +0200, BlaisorBlade wrote:
> >
> > I'd like a discussion about this(how much interest in this there is,
> > suggestions, requests). Especially:
>
> This is interesting.  I wrote a small client/server system for the purpose
> of programmatically executing programs within UML.  It works nicely, with
> the exception that it is necessary to install the server within UML in
> order for it to work.  It would be nice to be able to do this with a
> pristine UML.
>
> What do you do with stdin, stdout and stderr?  I connect them to a UML
> serial device, which can be connected to the tty (for interactive programs)
> or any other UML channel.
Hmm, I didn't think to this. I was thinking to *simple* commands, only a bit 
more complicate than the cad one, such as calling mount(I thought to the 
->"Add shared directory" VMWare menu item...). Also, this is my first "true" 
kernel work, and I took most of the code from kernel/kmod.c, i.e. the one 
which runs modprobe/hotplug.

Your idea is good(opening a file and dupping it to 0,1,2 handles should be 
simple). Only I wouldn't like that it becomes too long to implement, i.e. to 
do in user-space. And I must go discovering how exactly to do it inside the 
kernel(I'll do this, however).
>
> > - is the ability to read arguments with spaces(within quotes) needed even
> > for the program name?
>
> I don't think this is particularly crucial; does it cause some unexpected
> difficulty?
No, simply I hadn't wrote the code yet and at first I thought that this was 
useless(because the program path wouldn't normally contain spaces).

Now, I'm posting the patch against 2.4.22-3um(I am not so fast to port patches 
back and forth to reach -4um for now). It does compile, I've got to test the 
parsing part but I want to post it even now so that you can say me if I'm 
doing it well or using a completely wrong way, and such things(I'm new to 
kernel hacking, as I said, even if I found enough docs).

I already know that the limit to 20 args is ugly; it's only a fast crap I put 
there, even because I had doubt about calling kmalloc. What I understood,at 
the end, is that I can call it freely in runner_thread(with GFP_KERNEL and 
without GFP_ATOMIC) and that I must free it only if execve(which is wrapped 
inside exec_usermodehelper, see kernel/kmod.c) fails. Is it right?

Thanks for the interest, and sorry if you think you wasted your time.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN

[-- Attachment #2: mconsole_exec.patch --]
[-- Type: text/x-diff, Size: 4628 bytes --]

--- linuxUm-2.4.22/arch/um/drivers/mconsole_user.c.saved	2003-09-13 20:22:06.000000000 +0200
+++ linuxUm-2.4.22/arch/um/drivers/mconsole_user.c	2003-09-14 18:15:13.000000000 +0200
@@ -21,6 +21,7 @@
 	{ "version", mconsole_version, MCONSOLE_INTR },
 	{ "halt", mconsole_halt, MCONSOLE_PROC },
 	{ "reboot", mconsole_reboot, MCONSOLE_PROC },
+        { "exec", mconsole_exec, MCONSOLE_PROC },
 	{ "config", mconsole_config, MCONSOLE_PROC },
 	{ "remove", mconsole_remove, MCONSOLE_PROC },
 	{ "sysrq", mconsole_sysrq, MCONSOLE_INTR },
--- linuxUm-2.4.22/arch/um/drivers/mconsole_kern.c.saved	2003-09-13 20:22:06.000000000 +0200
+++ linuxUm-2.4.22/arch/um/drivers/mconsole_kern.c	2003-09-14 20:27:00.000000000 +0200
@@ -18,6 +18,7 @@
 #include "linux/file.h"
 #include "linux/fs.h"
 #include "linux/proc_fs.h"
+#include "linux/kmod.h"
 #include "asm/irq.h"
 #include "asm/uaccess.h"
 #include "user_util.h"
@@ -210,6 +211,7 @@
     help - Print this message \n\
     halt - Halt UML \n\
     reboot - Reboot UML \n\
+    exec - execute a command as root inside the UML\n\
     config <dev>=<config> - Add a new device to UML;  \n\
 	same syntax as command line \n\
     config <dev> - Query the configuration of a device \n\
@@ -266,6 +268,95 @@
 	mconsole_reply(req, "", 0, 0);
 }
 
+/* This is the focal point of the exec patch. Much code comes from
+ * kernel/kmod.c. But I just couldn't use call_usermodehelper, because it must be 
+ * called from process context.*/
+struct subprocess_info {
+        char *command;
+        pid_t retval;
+};
+
+/* This code must be called in a new thread, and uses 2.4 exec_usermodehelper
+ * (which seems to be gone inside 2.6) to start the specified program.
+ * This function is like ____call_usermodehelper*/
+int runner_thread(void * data)
+{
+        struct subprocess_info *sub_info = data;
+	char buf[MCONSOLE_MAX_DATA];
+        char *ptr = buf, *endptr;
+        char *path, *argv[21]; /*For now.*/
+	char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+	int i = 0, retval;
+	strcpy(buf, sub_info->command);
+
+	ptr += strlen("exec");
+
+	while (i < 20) {
+		while(isspace(*ptr)) ptr++;
+
+		if (ptr == NULL)
+			break;
+
+		endptr = ptr;
+		if (*ptr == '\"' || *ptr == '\'') { /*quoted arg*/
+			while (*endptr != *ptr || *(endptr - 1) == '\\') endptr++;
+			ptr++;  /*skips the first quote*/
+		} else {
+			while(!isspace(*endptr)) endptr++;
+		}
+		argv[i++] = ptr;
+		*endptr = '\0';
+		ptr = endptr + 1;
+	}
+
+	if (*argv[0] == '\0')
+		sub_info->retval = -EINVAL; /*invalid command to execute, though this maybe 
+					      is not needed.*/
+	path = argv[0];
+	argv[i] = NULL;
+
+	/*path = "/bin/sleep";
+        argv = { path, "20", NULL };*/
+        retval = exec_usermodehelper(path, argv, envp);
+
+        /* Exec failed? */
+        sub_info->retval = (pid_t)retval;
+        do_exit(0);
+}
+
+/* This is like __call_usermodehelper. Only exception is that it's not a callback of keventd, and that 
+ * it bundles the declaration of sub_info from call_usermodehelper.*/
+void mconsole_exec(struct mc_request *req)
+{
+        pid_t pid;
+
+        struct subprocess_info sub_info = {
+                command:        req->request.data,
+                retval:         0,
+        };
+
+        /*
+         * CLONE_VFORK: wait until the usermode helper has execve'd successfully
+         * We need the data structures to stay around until that is done.
+         */
+        pid = kernel_thread(runner_thread, &sub_info, CLONE_VFORK | SIGCHLD);
+
+	if (pid < 0) {
+		char buf[60];
+		snprintf(buf, 60, "kernel_thread failed in mconsole_exec with error code: %d", -pid);
+		mconsole_reply(req, buf, 1, 0);
+	}
+	if (sub_info.retval < 0) {
+		char buf[50];
+		snprintf(buf, 50, "execve failed in mconsole_exec with errno = %d", -sub_info.retval);
+		mconsole_reply(req, buf, 1, 0);
+	}
+
+	mconsole_reply(req, "The command has been started successfully.", 0, 0);
+}
+
+/* Patch end */
+
 /* This list is populated by __initcall routines. */
 
 LIST_HEAD(mconsole_devices);
--- linuxUm-2.4.22/arch/um/include/mconsole.h.saved	2003-09-13 20:22:07.000000000 +0200
+++ linuxUm-2.4.22/arch/um/include/mconsole.h	2003-09-14 12:19:53.000000000 +0200
@@ -73,6 +73,7 @@
 extern void mconsole_help(struct mc_request *req);
 extern void mconsole_halt(struct mc_request *req);
 extern void mconsole_reboot(struct mc_request *req);
+extern void mconsole_exec(struct mc_request *req);
 extern void mconsole_config(struct mc_request *req);
 extern void mconsole_remove(struct mc_request *req);
 extern void mconsole_sysrq(struct mc_request *req);

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 17:45     ` Michael Richardson
@ 2003-09-14 20:28       ` Henrik Nordstrom
  2003-09-14 20:32         ` Michael Richardson
  2003-09-15  7:31         ` Ulf Bartelt
  0 siblings, 2 replies; 19+ messages in thread
From: Henrik Nordstrom @ 2003-09-14 20:28 UTC (permalink / raw)
  To: Michael Richardson; +Cc: user-mode-linux-devel

On Sun, 14 Sep 2003, Michael Richardson wrote:

> It is entirely reasonable that the admin of the host system doesn't even
> have login priveledges on the guest system, but would like the guest to
> shutdown nicely before he reboots the host.

For this there already is control-alt-delete (cad command in mconsole). A
guest which wants to be cleanly shut down ought to have a cad handler in
it's inittab (all distros does).

I see the ability to execute commands from mconsole more of a advanced 
administration and debugging tool, where a channel to the guest is always 
guaranteed no matter what happens inside the guest (within reasonable 
limits). 

My personal feeling is that having a mconsole "backdoor" into executing
commands inside the guest is a generally good thing as it gives the host a
clean path for controlling the UML beyond just c-a-d. Even more so in
hosting or honeypot situations where it may not be possible to guarantee
that the hosted UML maintains a separate channel for the purpose. I would
even go as far as saying this is a thing which should be possible via the
sysrq interface on all architectures but unfortunately the kernel sysrq
interface is a bit too limited for this purpose.

Regards
Henrik



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 20:28       ` Henrik Nordstrom
@ 2003-09-14 20:32         ` Michael Richardson
  2003-09-15  7:31         ` Ulf Bartelt
  1 sibling, 0 replies; 19+ messages in thread
From: Michael Richardson @ 2003-09-14 20:32 UTC (permalink / raw)
  To: user-mode-linux-devel

-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "Henrik" == Henrik Nordstrom <hno@marasystems.com> writes:
    Henrik> My personal feeling is that having a mconsole "backdoor" into
    Henrik> executing commands inside the guest is a generally good thing as
    Henrik> it gives the host a clean path for controlling the UML beyond
    Henrik> just c-a-d. Even more so in hosting or honeypot situations where

  Actually, it has great uses in testing as well.
  Right now, I attach to the console with expect. If I could just execute
commands directly that would be cool too. 

  Were you thinking about having stdin/stdout/stderr hooked up as well?

]      Out and about in Ottawa.    hmmm... beer.                |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another Debian/notebook using, kernel hacking, security guy");  [
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys - custom hacks make this fully PGP2 compat

iQCVAwUBP2TQdIqHRg3pndX9AQHLOwQAwOP66lEqbeU0YVIdL8ytu4vkxfp/Dz68
vwYBGBDJ6IoW52QVUg7IFMfOwHmxxlJQVh6hrpTGinNpMGmD8cuc8kZTSw3rnvpC
Md8YEDXyko66uWoBn3hJMEXHCjFfHYmWy6RbMiMRwRMx+JpATzt2sHIE3Fse8z83
QaetCbN0du4=
=Mfc4
-----END PGP SIGNATURE-----


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 18:50   ` BlaisorBlade
@ 2003-09-14 20:33     ` Henrik Nordstrom
  2003-09-15 17:12     ` BlaisorBlade
  1 sibling, 0 replies; 19+ messages in thread
From: Henrik Nordstrom @ 2003-09-14 20:33 UTC (permalink / raw)
  To: BlaisorBlade; +Cc: user-mode-linux-devel

On Sun, 14 Sep 2003, BlaisorBlade wrote:

> Your idea is good(opening a file and dupping it to 0,1,2 handles should be 
> simple). Only I wouldn't like that it becomes too long to implement, i.e. to 
> do in user-space. And I must go discovering how exactly to do it inside the 
> kernel(I'll do this, however).

My feeling is that attaching to the console is a suitable default, maybe
with the option to attaching to a specified channel.

Regards
Henrik



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 20:28       ` Henrik Nordstrom
  2003-09-14 20:32         ` Michael Richardson
@ 2003-09-15  7:31         ` Ulf Bartelt
  2003-09-15  9:20           ` Henrik Nordstrom
  1 sibling, 1 reply; 19+ messages in thread
From: Ulf Bartelt @ 2003-09-15  7:31 UTC (permalink / raw)
  To: user-mode-linux-devel

Am Son, 2003-09-14 um 22.28 schrieb Henrik Nordstrom:
> On Sun, 14 Sep 2003, Michael Richardson wrote:
> 
> > It is entirely reasonable that the admin of the host system doesn't even
> > have login priveledges on the guest system, but would like the guest to
> > shutdown nicely before he reboots the host.
> 
> For this there already is control-alt-delete (cad command in mconsole). A
> guest which wants to be cleanly shut down ought to have a cad handler in
> it's inittab (all distros does).

Exactly.  All an uml hostig admin wants to know is the path to the uml
stop script and I *don't* want the admin to do other things than using
exactly that script, especially (s)he shall not issue commands at will
in my uml.  The uml was set up by me and only I know what and how to
take down and in which order.  So ctrl-alt-del or maybe some means to
tell the uml of a soon coming powerdown/powerfail should be all what's
needed to brimg a customer's uml down cleanly.

> I see the ability to execute commands from mconsole more of a advanced 
> administration and debugging tool, where a channel to the guest is always 
> guaranteed no matter what happens inside the guest (within reasonable 
> limits).

I was to lazy up to now to fight thru driving an uml by expect... from
debootstrap's state of having a mini-Debian installed to having it up
and reachable in the network, some install steps need to be done and a
"perfect remote control" without networking and other tricky things
would make my installer simpler.  But the init= bootarg is my friend and
I can live doing it that way...

So I think such an "uml remote control" would be nice to have but not
essential...

-- 
#
# Say it in Python ;-)
#
try:     you.run(away)
finally: borg.assimilate(you)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-15  7:31         ` Ulf Bartelt
@ 2003-09-15  9:20           ` Henrik Nordstrom
  0 siblings, 0 replies; 19+ messages in thread
From: Henrik Nordstrom @ 2003-09-15  9:20 UTC (permalink / raw)
  To: Ulf Bartelt; +Cc: user-mode-linux-devel

On Mon, 15 Sep 2003, Ulf Bartelt wrote:

> So I think such an "uml remote control" would be nice to have but not
> essential...

Agreed.

Regards
Henrik



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-14 18:50   ` BlaisorBlade
  2003-09-14 20:33     ` Henrik Nordstrom
@ 2003-09-15 17:12     ` BlaisorBlade
  1 sibling, 0 replies; 19+ messages in thread
From: BlaisorBlade @ 2003-09-15 17:12 UTC (permalink / raw)
  To: user-mode-linux-devel

Alle 20:50, domenica 14 settembre 2003, BlaisorBlade ha scritto:
> > > - is the ability to read arguments with spaces(within quotes) needed
> > > even for the program name?
> Now, I'm posting the patch against 2.4.22-3um(I am not so fast to port
> patches back and forth to reach -4um for now). It does compile, I've got to
> test the parsing part but I want to post it even now so that you can say me
> if I'm doing it well or using a completely wrong way, and such things(I'm
> new to kernel hacking, as I said, even if I found enough docs).

> Thanks for the interest, and sorry if you think you wasted your time.
In fact :-(. Sorry for anyone who tried it: the parsing code is totally wrong. 
I'm going to correct it. I wrote it very fast, and I was thinking only to the 
kernel related issues...
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-13 16:20 [uml-devel] [PATCH] Starting a command inside UML from mconsole BlaisorBlade
  2003-09-13 19:48 ` Matt Zimmerman
  2003-09-14  2:33 ` Jeff Dike
@ 2003-09-16 18:27 ` BlaisorBlade
  2003-09-17 17:39   ` BlaisorBlade
  2 siblings, 1 reply; 19+ messages in thread
From: BlaisorBlade @ 2003-09-16 18:27 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Hi, I have finally some working code. I've cleaned it up and it works quite 
well, now I only need to setup the file handling. Also, it can be configured 
with CONFIG_MCONSOLE_EXEC. Note that if disabled, for header issues, it 
defines the exec command anyway but it pretends not to exist(and is not 
showed in the 
However, there is a problem I'm investigating on. Even if the execve fails, it 
reports success. I've debugged it and it showed up that threads synchronize 
properly(i.e. CLONE_VFORK works) and that the fault seems to be in 
kmod.c:exec_usermodehelper.

It seems that this code, at the end of the function:
        if (execve(program_path, argv, envp) < 0)
                return -errno;
        return 0;

is wrong. Execve returns -2(i.e. -ENOENT), but I've not found a place where 
errno is set. It seems that it's not a UML problem, either: simply that code 
should be:
	return execve(program_path, argv, envp);
because kernel functions don't set errno. However I need confirms on this.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN

[-- Attachment #2: mconsole_exec.patch --]
[-- Type: text/x-diff, Size: 7049 bytes --]

--- linuxUm/arch/um/drivers/mconsole_user.c.saved	2003-09-13 20:22:06.000000000 +0200
+++ linuxUm/arch/um/drivers/mconsole_user.c	2003-09-16 18:01:24.000000000 +0200
@@ -21,6 +21,7 @@
 	{ "version", mconsole_version, MCONSOLE_INTR },
 	{ "halt", mconsole_halt, MCONSOLE_PROC },
 	{ "reboot", mconsole_reboot, MCONSOLE_PROC },
+        { "exec", mconsole_exec, MCONSOLE_PROC },
 	{ "config", mconsole_config, MCONSOLE_PROC },
 	{ "remove", mconsole_remove, MCONSOLE_PROC },
 	{ "sysrq", mconsole_sysrq, MCONSOLE_INTR },
--- linuxUm/arch/um/drivers/mconsole_kern.c.saved	2003-09-13 20:22:06.000000000 +0200
+++ linuxUm/arch/um/drivers/mconsole_kern.c	2003-09-16 19:08:14.000000000 +0200
@@ -18,6 +18,7 @@
 #include "linux/file.h"
 #include "linux/fs.h"
 #include "linux/proc_fs.h"
+#include "linux/kmod.h"
 #include "asm/irq.h"
 #include "asm/uaccess.h"
 #include "user_util.h"
@@ -203,13 +204,19 @@
 	/* put_filesystem(proc); */
  out: ;
 }
+#ifdef CONFIG_MCONSOLE_EXEC
+#  define EXEC_HELPTEXT "\
+    exec - execute a command as root inside the UML\n"
+#else
+#  define EXEC_HELPTEXT ""
+#endif
 
 #define UML_MCONSOLE_HELPTEXT \
 "Commands: \n\
     version - Get kernel version \n\
     help - Print this message \n\
     halt - Halt UML \n\
-    reboot - Reboot UML \n\
+    reboot - Reboot UML \n" EXEC_HELPTEXT "\
     config <dev>=<config> - Add a new device to UML;  \n\
 	same syntax as command line \n\
     config <dev> - Query the configuration of a device \n\
@@ -265,6 +272,149 @@
 	reactivate_fd(req->originating_fd, MCONSOLE_IRQ);
 	mconsole_reply(req, "", 0, 0);
 }
+#ifdef CONFIG_MCONSOLE_EXEC
+/* This is the focal point of the exec patch. Much code comes from
+ * kernel/kmod.c. But I just couldn't use call_usermodehelper, because it must be 
+ * called from process context.*/
+struct subprocess_info {
+	char *command;
+	int retval;
+};
+
+/* This function parses arguments from buf to the argv array.
+ * When it goes on a space, starts a new arguments. If it starts with a quote,
+ * it will end at the first matching quote(of the same tipe) which is not escaped with a \.
+ * Otherwise, the arg ends at the first space and can freely contain quotes.
+ * After this, in each argument \<char> is replaced by char.*/
+static void parse_args(char *buf, size_t size, char **argv) {
+	char *start_arg = buf, *end_arg;
+	int i = 0, must_not_break = 1;
+
+	start_arg += strlen("exec");
+
+	while (i < size - 1 && must_not_break) {
+		while(isspace(*start_arg))
+			start_arg++;
+
+		if (*start_arg == '\0')
+			break;
+
+		end_arg = start_arg;
+		if (*start_arg == '\"' || *start_arg == '\'') { /*quoted arg*/
+			end_arg++;
+			/*while (1) {
+				while (*end_arg != *start_arg && *end_arg != '\0')
+					end_arg++;
+				if (*(end_arg - 1) != '\\' || *end_arg == '\0')
+					break;
+				end_arg++;
+			}*/
+			while ((*end_arg != *start_arg || *(end_arg - 1) == '\\')
+				&& *end_arg != '\0')
+				end_arg++;
+			start_arg++;	/*skips the first quote*/
+		} else {
+			while(!isspace(*end_arg) && *end_arg != '\0')
+				end_arg++;
+		}
+		argv[i++] = start_arg;
+
+		if (*end_arg == '\0')
+			must_not_break = 0; /*we have finished, but the break must
+					      be done after we strip '\' out.*/
+		*end_arg = '\0';
+
+		/*let's remove those '\'! The text is shifted back to cover the \'s*/
+		char *curs = start_arg;
+		int displacement = 0;
+		while (*curs != '\\' && *curs != '\0')
+			curs++;
+		while (*curs != '\0') {
+			displacement++;
+			curs++;
+			do {
+				*(curs-displacement) = *curs;
+				curs++;
+			} while (*curs != '\\' && *curs != '\0');
+		}
+		*(curs - displacement) = '\0';
+		start_arg = end_arg + 1;
+	}
+
+	argv[i] = NULL;
+}
+
+/* This code must be called in a new thread, and uses 2.4 exec_usermodehelper
+ * (which seems to be gone inside 2.6) to start the specified program.
+ * This function is like ____call_usermodehelper*/
+static int runner_thread(void * data)
+{
+	struct subprocess_info *sub_info = data;
+
+	char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+
+	char *path, *argv[MCONSOLE_MAX_DATA / 2 + 1];
+	char buf[MCONSOLE_MAX_DATA];
+	int retval;
+
+	strcpy(buf, sub_info->command);
+
+	parse_args(buf, MCONSOLE_MAX_DATA / 2 + 1, argv);
+	if (*argv[0] == '\0')
+		sub_info->retval = -EINVAL; /*invalid command to execute, though this maybe 
+					      is not needed.*/
+	path = argv[0];
+
+	retval = exec_usermodehelper(path, argv, envp);
+
+	/* Exec failed? */
+	sub_info->retval = retval;
+	do_exit(0);
+}
+
+/* This is like __call_usermodehelper. Only exception is that it's not a callback of keventd, and that 
+ * it bundles the declaration of sub_info from call_usermodehelper.*/
+void mconsole_exec(struct mc_request *req)
+{
+	pid_t pid;
+
+	struct subprocess_info sub_info = {
+		command:	req->request.data,
+		retval:		0,
+	};
+
+	/*
+	 * CLONE_VFORK: wait until the usermode helper has execve'd successfully
+	 * We need the data structures to stay around until that is done.
+	 */
+	pid = kernel_thread(runner_thread, &sub_info, CLONE_VFORK | SIGCHLD);
+
+	if (pid < 0) {
+		char buf[60];
+		snprintf(buf, 60, "kernel_thread failed in mconsole_exec with error code: %d", -pid);
+		mconsole_reply(req, buf, 1, 0);
+		return;
+	}
+	if (sub_info.retval < 0) {
+		char buf[50];
+		snprintf(buf, 50, "execve failed in mconsole_exec with errno = %d", -sub_info.retval);
+		mconsole_reply(req, buf, 1, 0);
+		return;
+	}
+
+	mconsole_reply(req, "The command has been started successfully.", 0, 0);
+}
+#else
+/* I must put mconsole_exec in the commands table always, because there 
+ * linux/config.h cannot be included. So I pretend it doesn't exist by hiding
+ * it in the help text*/
+void mconsole_exec(struct mc_request *req)
+{
+	mconsole_reply(req, "Unknown command", 1, 0);
+	/*must be the same as in mconsole_reply*/
+}
+/* Patch end */
+#endif			/*CONFIG_MCONSOLE_EXEC*/
 
 /* This list is populated by __initcall routines. */
 
--- linuxUm/arch/um/config.in.saved	2003-09-13 20:22:06.000000000 +0200
+++ linuxUm/arch/um/config.in	2003-09-16 16:31:13.000000000 +0200
@@ -40,6 +40,7 @@
 tristate 'Host filesystem' CONFIG_HOSTFS
 tristate 'Honeypot proc filesystem' CONFIG_HPPFS
 bool 'Management console' CONFIG_MCONSOLE
+dep_bool 'Execution through management console' CONFIG_MCONSOLE_EXEC $CONFIG_MCONSOLE
 dep_bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ $CONFIG_MCONSOLE
 bool '2G/2G host address space split' CONFIG_HOST_2G_2G
 bool 'Symmetric multi-processing support' CONFIG_UML_SMP
--- linuxUm/arch/um/include/mconsole.h.saved	2003-09-13 20:22:07.000000000 +0200
+++ linuxUm/arch/um/include/mconsole.h	2003-09-16 18:11:48.000000000 +0200
@@ -73,6 +73,7 @@
 extern void mconsole_help(struct mc_request *req);
 extern void mconsole_halt(struct mc_request *req);
 extern void mconsole_reboot(struct mc_request *req);
+extern void mconsole_exec(struct mc_request *req);
 extern void mconsole_config(struct mc_request *req);
 extern void mconsole_remove(struct mc_request *req);
 extern void mconsole_sysrq(struct mc_request *req);

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [uml-devel] [PATCH] Starting a command inside UML from mconsole
  2003-09-16 18:27 ` BlaisorBlade
@ 2003-09-17 17:39   ` BlaisorBlade
  0 siblings, 0 replies; 19+ messages in thread
From: BlaisorBlade @ 2003-09-17 17:39 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: jeff

[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]

Alle 20:27, martedì 16 settembre 2003, BlaisorBlade ha scritto:
> Hi, I have finally some working code. I've cleaned it up and it works quite
> well, now I only need to setup the file handling. Also, it can be
> configured with CONFIG_MCONSOLE_EXEC. Note that if disabled, for header
> issues, it defines the exec command anyway but it pretends not to exist(and
> is not showed in the
I missed the "help" word here: the command is not showed in the help but 
something is there. The header issues are that I cannot include 
linux/config.h in *_user.c files(the include path are explicitally removed 
for those files, I think for a good reason), so I must always put the command 
in the command table. Obviously, if I could move the table on the other 
file(and the prototypes of commands out of mconsole.h), everything would be 
fine, but I've not fully understood the differences between _user.c and 
_kern.c(I've noticed all differences created by Makefiles, but not in other 
places, i.e. the link scripts).

> However, there is a problem I'm investigating on. Even if the execve fails,
> it reports success. I've debugged it and it showed up that threads
> synchronize properly(i.e. CLONE_VFORK works) and that the fault seems to be
> in kmod.c:exec_usermodehelper.
>
> It seems that this code, at the end of the function:
>         if (execve(program_path, argv, envp) < 0)
>                 return -errno;
>         return 0;

I was wrong. On the i386 arch(and I think others, too) the translation from 
return value to errno setting is done in include/asm-i386/unistd.h. Instead, 
UML doesn't do it. I'm posting a patch to correct this in 
include/asm-um/unistd.h for mainline, but I think that the rest of Uml will 
have to be changed, probably, to conform to the new(and correct) semantic. If 
you agree that this patch will have to go in, I'll complete it with complete 
checking for errno. But I think I'll need a working version of -4um(see my 
message above), since I think that version has added/changed also much uses 
of errno.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN

[-- Attachment #2: errno.patch --]
[-- Type: text/x-diff, Size: 414 bytes --]

--- linuxUm/include/asm-um/unistd.h.notfixed	2003-09-17 13:30:42.000000000 +0200
+++ linuxUm/include/asm-um/unistd.h	2003-09-17 19:15:58.000000000 +0200
@@ -33,7 +33,11 @@
 	set_fs(KERNEL_DS);			\
 	ret = sys(args);			\
 	set_fs(fs);				\
-	return ret;
+	if (ret < 0) {				\
+	  errno = -ret;				\
+	  return -1;				\
+	}					\
+	return 0;
 
 static inline long open(const char *pathname, int flags, int mode) 
 {

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2003-09-17 18:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-13 16:20 [uml-devel] [PATCH] Starting a command inside UML from mconsole BlaisorBlade
2003-09-13 19:48 ` Matt Zimmerman
2003-09-14 18:50   ` BlaisorBlade
2003-09-14 20:33     ` Henrik Nordstrom
2003-09-15 17:12     ` BlaisorBlade
2003-09-14  2:33 ` Jeff Dike
2003-09-14  6:30   ` Matt Zimmerman
2003-09-14  6:45   ` Russell Coker
2003-09-14  7:59   ` Steve Schnepp
2003-09-14 13:50     ` Jeff Dike
2003-09-14 16:36       ` Matt Zimmerman
2003-09-14 17:10   ` BlaisorBlade
2003-09-14 17:45     ` Michael Richardson
2003-09-14 20:28       ` Henrik Nordstrom
2003-09-14 20:32         ` Michael Richardson
2003-09-15  7:31         ` Ulf Bartelt
2003-09-15  9:20           ` Henrik Nordstrom
2003-09-16 18:27 ` BlaisorBlade
2003-09-17 17:39   ` BlaisorBlade

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.