From d8a4e0794b75fc4d782e4d6c1ac4e3d0d849b058 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 6 Feb 1997 16:42:15 +0000 Subject: (main): Look for NOBODY in ARGS_DEFS too, and use a last ditch default if we can't find it anywhere. --- utils/login.c | 7 +++++-- 1 file 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 @@ -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. */ -- cgit v1.2.3