[Pkg-shadow-devel] Re: Bug#351281: Duplicate uids not allowed, even with --non-unique

Nicolas François nicolas.francois at centraliens.net
Sat Feb 4 13:08:24 UTC 2006


Hello Tomasz,

The attached patch fixes this bug.

On Fri, Feb 03, 2006 at 03:02:02PM -0500, sfrost at snowman.net wrote:
> 
>   Looks like something broke -o/--non-unique.  useradd now refuses to
>   create a user with a duplicate uid even with -o or --non-unique are
>   supplied.

Kind Regards,
-- 
Nekral
-------------- next part --------------
Goal: allow non-unique UID

Fixes: #351281

Status wrt upstream: not reported yet

Index: shadow-4.0.14/src/useradd.c
===================================================================
--- shadow-4.0.14.orig/src/useradd.c	2006-01-24 01:13:37.000000000 +0100
+++ shadow-4.0.14/src/useradd.c	2006-02-04 13:56:09.000000000 +0100
@@ -1757,10 +1757,12 @@
 	 */
 	open_files ();
 
-	/* first, seek for a valid uid to use for this user.
-	 * We do this because later we can use the uid we found as
-	 * gid too ... --gafton */
-	find_new_uid ();
+	if (!oflg){
+		/* first, seek for a valid uid to use for this user.
+		 * We do this because later we can use the uid we found as
+		 * gid too ... --gafton */
+		find_new_uid ();
+	}
 
 	/* do we have to add a group for that user? This is why we need to
 	 * open the group files in the open_files() function  --gafton */


More information about the Pkg-shadow-devel mailing list