summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-04 23:31:18 +0000
committerRoland McGrath <roland@gnu.org>2002-05-04 23:31:18 +0000
commit06954bf7224708f5468d5d029f3a10be5eff38e9 (patch)
tree7370105b49cb3a03fdc44cb02f2d6a037988cb47 /utils
parent1fe22e5b2a2aba21a9f6ebbe87fcc2e5b6a31b46 (diff)
2002-05-04 Roland McGrath <roland@frob.com>
* fakeauth.c (main): Update doc strings, clean up argp_parse call.
Diffstat (limited to 'utils')
-rw-r--r--utils/fakeauth.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/fakeauth.c b/utils/fakeauth.c
index 000c988e..38ab2441 100644
--- a/utils/fakeauth.c
+++ b/utils/fakeauth.c
@@ -327,10 +327,17 @@ main (int argc, char **argv)
auth_t authport;
pid_t child;
int status;
+ int argi;
- struct argp argp = { 0, 0, 0, "Hurd standard authentication server." };
+ struct argp argp = { 0, 0, "COMMAND...", "\
+Run COMMAND with a fake authentication handle that claims to be root or \
+any arbitrary identity derived from that handle, but in fact is always just \
+a proxy for your real authentication handle. This means that all processes \
+created by the COMMAND will have your privileges, even though it may \
+believe it has restricted them to different identities or no identity at all.\
+" };
- argp_parse (&argp, argc, argv, 0, 0, 0);
+ argp_parse (&argp, argc, argv, 0, &argi, 0);
auth_bucket = ports_create_bucket ();
authhandle_portclass = ports_create_class (&destroy_authhandle, 0);
@@ -365,11 +372,11 @@ main (int argc, char **argv)
error (2, errno, "Cannot switch to fake auth handle");
mach_port_deallocate (mach_task_self (), authport);
- if (posix_spawnp (&child, argv[1], NULL, NULL, &argv[1], environ))
+ if (posix_spawnp (&child, argv[argi], NULL, NULL, &argv[argi], environ))
error (3, errno, "cannot run %s", argv[1]);
if (waitpid (child, &status, 0) != child)
- error (4, errno, "waitpid");
+ error (4, errno, "waitpid on %d", child);
if (WIFSIGNALED (status))
error (WTERMSIG (status) + 128, 0,