Joerg Hoh
2006-Feb-28 22:33 UTC
Bug#248500: [Adduser-devel] Bug#248500: adduser: do not re-use uids used once
Hi We need to have a persistent statefile if we want to avoid to reuse a uid which was already used by some other user. Think of the following scenario: adduser foo -> foo gets uid X deluser foo -> uid X is no longer used adduser bar -> bar gets uid X So this uid is reused, even with the "always increment the hightest already used uid by one and assign it to the new user"-algorithm. But the whole thing of making this value persistent seems rather ugly to me. Need to think some time about that, maybe I have a better idea to solve that issue (a file for a single value). Joerg -- Was denen einen ihr Watergate, ist den anderen ihr Firstgate. - Thomas Bliessner, <slrnd1hklm.g53.nospam@melix.com.mx>
Pepe
2009-Jul-18 13:32 UTC
[Adduser-devel] Bug#248500: Bug#248500: adduser: do not re-use uids used once
On Tue, Feb 28, 2006 at 11:29:58PM +0100, Joerg Hoh wrote:> Hi > > We need to have a persistent statefile if we want to avoid to reuse a uid > which was already used by some other user. Think of the following scenario: > > adduser foo > -> foo gets uid X > > deluser foo > -> uid X is no longer used > > adduser bar > -> bar gets uid X > > So this uid is reused, even with the "always increment the hightest > already used uid by one and assign it to the new user"-algorithm. > > > But the whole thing of making this value persistent seems rather ugly to > me. Need to think some time about that, maybe I have a better idea to solve > that issue (a file for a single value).Well, we already have this "state file" in the system, namely "/etc/passwd". We could create a disabled system user with a system UID (for example UID 999, and for example named "adduser"), which would be managed by the adduser scripts, and which would hold in the GECOS field the highest ever used user ID in the system. So, every time a new user is added to the system, the adduser scripts would update the GECOS field of this "adduser" system user. This "adduser" user could be disabled ("passwd -l adduser") as it is never meant to login into the system. This solution keeps compatibility with the old scheme of things, and needs no special state file, while solves the problem. What do you think? -- Pepe pepe at naleco.com
Marc Haber
2011-Nov-23 10:53 UTC
[Adduser-devel] Bug#248500: Bug#248500: adduser: do not re-use uids used once
On Sat, Jul 18, 2009 at 03:32:53PM +0200, Pepe wrote:> Well, we already have this "state file" in the system, namely > "/etc/passwd".*UGH* I''d prefer a /var/lib/adduser/state over abusing /etc/passwd any time. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 31958061 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 31958062