From mw@barfooze.de  Fri Jan  6 13:33:27 2012
Return-Path: <mw@barfooze.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 455B9106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  6 Jan 2012 13:33:27 +0000 (UTC)
	(envelope-from mw@barfooze.de)
Received: from furnace.wzff.de (furnace.wzff.de [IPv6:2a01:4f8:150:63e2::9])
	by mx1.freebsd.org (Postfix) with ESMTP id D839C8FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  6 Jan 2012 13:33:26 +0000 (UTC)
Received: from mw by furnace.wzff.de with local (Exim 4.77 (FreeBSD))
	(envelope-from <mw@barfooze.de>)
	id 1Rj9vB-000Giy-Ht
	for FreeBSD-gnats-submit@freebsd.org; Fri, 06 Jan 2012 14:33:25 +0100
Message-Id: <E1Rj9vB-000Giy-Ht@furnace.wzff.de>
Date: Fri, 06 Jan 2012 14:33:25 +0100
From: Moritz Wilhelmy <mw@wzff.de>
Reply-To: Moritz Wilhelmy <mw@wzff.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: confusing usr.sbin/adduser output if /etc/adduser.conf contains uidstart directive
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         163863
>Category:       bin
>Synopsis:       [patch] adduser(8): confusing usr.sbin/adduser output if /etc/adduser.conf contains uidstart directive
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 06 13:40:08 UTC 2012
>Closed-Date:    Fri Nov 02 22:22:46 UTC 2012
>Last-Modified:  Fri Nov 02 22:22:46 UTC 2012
>Originator:     Moritz Wilhelmy
>Release:        FreeBSD 9.0-RC2 amd64
>Organization:
>Environment:
System: FreeBSD furnace.wzff.de 9.0-RC2 FreeBSD 9.0-RC2 #14: Wed Nov 9 10:27:26 UTC 2011 root@phallus.wzff.de:/usr/obj/usr/src/sys/PHALLUS amd64

>Description:
	if uidstart is set (for instance to 2000) in adduser.conf, adduser will
	always prompt Uid [2000]:, although it internally increases the UID for
	newly created users after the prompt is printed
>How-To-Repeat:
	# echo uidstart=2000 >> /etc/adduser.conf
	# adduser
	Username: lola
	Full name: & Foo
	Uid [2000]: FIXME
>Fix:
Maybe this:

--- /usr/sbin/adduser	2011-11-09 13:34:50.891925440 +0100
+++ adduser	2012-01-06 14:25:53.344752556 +0100
@@ -488,6 +488,7 @@
 	_prompt=
 
 	if [ -n "$uuid" ]; then
+		uuid=`get_nextuid $uuid`
 		_prompt="Uid [$uuid]: "
 	else
 		_prompt="Uid (Leave empty for default): "
@@ -500,7 +501,6 @@
 	fi
 
 	[ -n "$_input" ] && uuid=$_input
-	uuid=`get_nextuid $uuid`
 	uidstart=$uuid
 }
 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: deischen 
State-Changed-When: Sat Feb 25 07:59:46 UTC 2012 
State-Changed-Why:  
Committed to HEAD.  Will MFC to 9.0 in 2 weeks, or when I get 
a chance.  Ping me if I seem to have forgotten. 

Thanks for your contribution! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163863 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/163863: commit references a PR
Date: Sat, 25 Feb 2012 07:59:18 +0000 (UTC)

 Author: deischen
 Date: Sat Feb 25 07:58:59 2012
 New Revision: 232146
 URL: http://svn.freebsd.org/changeset/base/232146
 
 Log:
   When using uidstart in /etc/adduser.conf, get the next
   available user id and show it in the "Uid [xxx]" prompt.
   
   PR:		163863
   Submitted by:	Moritz Wilhelmy (mw at wzff dot de)
   MFC after:	2 weeks
 
 Modified:
   head/usr.sbin/adduser/adduser.sh
 
 Modified: head/usr.sbin/adduser/adduser.sh
 ==============================================================================
 --- head/usr.sbin/adduser/adduser.sh	Sat Feb 25 04:54:51 2012	(r232145)
 +++ head/usr.sbin/adduser/adduser.sh	Sat Feb 25 07:58:59 2012	(r232146)
 @@ -488,6 +488,7 @@ get_uid() {
  	_prompt=
  
  	if [ -n "$uuid" ]; then
 +		uuid=`get_nextuid $uuid`
  		_prompt="Uid [$uuid]: "
  	else
  		_prompt="Uid (Leave empty for default): "
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Fri Nov 2 22:22:45 UTC 2012 
State-Changed-Why:  
MFCed/fixed by now or it will never be MFCed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163863 
>Unformatted:
