Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/user If the class was not specified, don't print a ...



details:   https://anonhg.NetBSD.org/src/rev/a20c72b4b43f
branches:  trunk
changeset: 583321:a20c72b4b43f
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 30 14:35:23 2005 +0000

description:
If the class was not specified, don't print a warning.

diffstat:

 usr.sbin/user/user.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r ed0b996c109d -r a20c72b4b43f usr.sbin/user/user.c
--- a/usr.sbin/user/user.c      Sat Jul 30 13:22:34 2005 +0000
+++ b/usr.sbin/user/user.c      Sat Jul 30 14:35:23 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.84 2005/07/29 18:16:21 christos Exp $ */
+/* $NetBSD: user.c,v 1.85 2005/07/30 14:35:23 christos Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -35,7 +35,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.84 2005/07/29 18:16:21 christos Exp $");
+__RCSID("$NetBSD: user.c,v 1.85 2005/07/30 14:35:23 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -975,6 +975,8 @@
 {
        login_cap_t *lc;
        
+       if (class == NULL || *class == '\0')
+               return 0;
        /*
         * Check if /etc/login.conf exists. login_getclass() will
         * return 1 due to it not existing, so not informing the
@@ -1038,7 +1040,7 @@
                errx(EXIT_FAILURE, "`%s' is not a valid login name", login_name);
        }
 #ifdef EXTENSIONS
-       if (up->u_class != NULL && !valid_class(up->u_class)) {
+       if (!valid_class(up->u_class)) {
                errx(EXIT_FAILURE, "No such login class `%s'", up->u_class);
        }
 #endif



Home | Main Index | Thread Index | Old Index