Hi,

I’m interested in working on bug #248500 and have been looking into how UID 
allocation is currently handled by adduser.

The main issue I’m trying to address is the distinction between avoiding 
currently allocated UIDs and avoiding reuse of UIDs that have been allocated in 
the past. The latter requires some form of persistent state, since once an 
account is removed there is no longer an entry in /etc/passwd from which 
adduser can determine that the UID was previously used.

I also looked at the UID/GID pool functionality introduced in #1067845, in 
particular UID_POOL and RESERVE_UID_POOL. This provides a mechanism for 
reserving known UID assignments, but it does not appear to constitute a general 
history of previously allocated UIDs.

I’m therefore interested in investigating whether the existing UID pool 
mechanism could be extended or reused to implement the semantics requested by 
#248500, while considering a few questions:

1. How should UIDs assigned by adduser be persisted so that they remain 
unavailable after the corresponding account is removed?
2. What should happen when an account is recreated, should it receive its 
previous UID or should that UID remain permanently unavailable?
3. How should existing systems be handled, where previously used UIDs are no 
longer present in /etc/passwd and therefore cannot be reconstructed reliably?
4. How should manually specified UIDs (--uid) interact with the mechanism?
5. Should system UIDs and regular user UIDs follow the same policy?
6. How should concurrent adduser invocations be handled to avoid allocating the 
same UID?

Before starting an implementation, I’d like to check whether this approach 
matches the intended direction for #248500, and whether there are any previous 
proposals or design constraints I should take into account.

If the bug is still considered open for development, I’d be happy to 
investigate this further and prepare a patch with tests. If, however, the issue 
has already been addressed by recent changes or is no longer considered 
relevant, I think the bug can be closed.

Thanks,
Juan Munoz
Salsa: Juaesm 

Reply via email to