Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/user Fix error message when trying to add a group u...



details:   https://anonhg.NetBSD.org/src/rev/e9f12911d550
branches:  trunk
changeset: 782950:e9f12911d550
user:      blymn <blymn%NetBSD.org@localhost>
date:      Wed Nov 28 11:31:27 2012 +0000

description:
Fix error message when trying to add a group using -g =uid that
that already exists, the old version printed the wrong GID.

diffstat:

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

diffs (27 lines):

diff -r 8bb35d55787b -r e9f12911d550 usr.sbin/user/user.c
--- a/usr.sbin/user/user.c      Wed Nov 28 11:20:58 2012 +0000
+++ b/usr.sbin/user/user.c      Wed Nov 28 11:31:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.130 2012/11/28 11:20:58 blymn Exp $ */
+/* $NetBSD: user.c,v 1.131 2012/11/28 11:31:27 blymn Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.130 2012/11/28 11:20:58 blymn Exp $");
+__RCSID("$NetBSD: user.c,v 1.131 2012/11/28 11:31:27 blymn Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1576,7 +1576,7 @@
                                        errx(EXIT_FAILURE,
                                            "Can't modify user `%s': "
                                            "gid %d is already in use",
-                                           login_name, up->u_uid);
+                                           login_name, pwp->pw_uid);
                                }
                                pwp->pw_gid = pwp->pw_uid;
                                if (!creategid(newlogin, pwp->pw_uid, "")) {



Home | Main Index | Thread Index | Old Index