'useradd' from shadow-4.0.14-r1 (and possibly other versions, too) has a bug, when attempting to create a user alias. Instead of creating, it whines about UID being duplicate. It is a problem in useradd.c, where a function find_new_uid() is supposed to check if uid is valid, and eventually find a new one. In one place, it is called regardless of -o (--non-uniqe) option being specified. simple patch should fix it: (i'd submit it as file, but didn't find how :) ) --- src/useradd.c.orig 2006-05-25 16:34:30.000000000 +0200 +++ src/useradd.c 2006-05-25 16:46:43.000000000 +0200 @@ -1758,7 +1758,13 @@ /* 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 (); + + /* however, ignore the case when -o is specified as this + * would make the -o option ignored completely. + * -o automatically enforces uid being specified on the + * cmdline, and such should be always valid */ + if (!oflg ) + 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 */
4.0.15 already has this fixed ;)
You are right. I just upgraded, and it works. Thanks! However, isn't keyword unmasking a strange sort of fix? ;) I mean, it's a feature not working at all, maybe some sort of port into stable (or unmasking the working version) would be neat ;) Anyways, works for me too, so i'm fine with it.
we try and take the route of moving newer versions into stable instead of patching bombing the current stable version