summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-06 16:42:15 +0000
committerMiles Bader <miles@gnu.org>1997-02-06 16:42:15 +0000
commitd8a4e0794b75fc4d782e4d6c1ac4e3d0d849b058 (patch)
treeea731f364dd606b6214b4c8736e785114741893a
parent9338aa92790022e9cad34968317312db503ca3bc (diff)
(main):
Look for NOBODY in ARGS_DEFS too, and use a last ditch default if we can't find it anywhere.
-rw-r--r--utils/login.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/login.c b/utils/login.c
index e4d1f628..7bef4c19 100644
--- a/utils/login.c
+++ b/utils/login.c
@@ -1,6 +1,6 @@
/* Hurdish login
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -614,7 +614,10 @@ main(int argc, char *argv[])
/* USER is whom to look up. If it's 0, then we hit the end of
the sh_args without seeing a user, so we want to add defaults
values for `nobody'. */
- char *user = arg ?: envz_get (args, args_len, "NOBODY");
+ char *user = arg
+ ?: envz_get (args, args_len, "NOBODY")
+ ?: envz_get (args_defs, args_defs_len, "NOBODY")
+ ?: "login";
struct passwd *pw =
isdigit (*user) ? getpwuid (atoi (user)) : getpwnam (user);
/* True if this is the user arg and there were no user options. */