Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.sbin/user Pull up revision 1.13 (requested by jlam):



details:   https://anonhg.NetBSD.org/src/rev/a462eb6b06b2
branches:  netbsd-1-4
changeset: 470910:a462eb6b06b2
user:      he <he%NetBSD.org@localhost>
date:      Tue Sep 12 22:12:06 2000 +0000

description:
Pull up revision 1.13 (requested by jlam):
  Make the ``-d homedir'' option work.  Fixes PR#10401.

diffstat:

 usr.sbin/user/user.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 6e0fb91444e0 -r a462eb6b06b2 usr.sbin/user/user.c
--- a/usr.sbin/user/user.c      Tue Sep 12 08:34:36 2000 +0000
+++ b/usr.sbin/user/user.c      Tue Sep 12 22:12:06 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.10.2.4 2000/07/05 21:08:32 he Exp $ */
+/* $NetBSD: user.c,v 1.10.2.5 2000/09/12 22:12:06 he Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -36,7 +36,7 @@
 __COPYRIGHT(
        "@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.10.2.4 2000/07/05 21:08:32 he Exp $");
+__RCSID("$NetBSD: user.c,v 1.10.2.5 2000/09/12 22:12:06 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -705,8 +705,10 @@
                (void) pw_abort();
                errx(EXIT_FAILURE, "already a `%s' user", login);
        }
-       /* if home directory hasn't been given, make it up */
-       if (!up->u_homeset) {
+       if (up->u_homeset) {
+               (void) strlcpy(home, up->u_home, sizeof(home));
+       } else {
+               /* if home directory hasn't been given, make it up */
                (void) snprintf(home, sizeof(home), "%s/%s", up->u_basedir, login);
        }
        expire = 0;



Home | Main Index | Thread Index | Old Index