Open unix-guy opened 8 months ago
Same issue here, from man page for login.defs
UID_MAX (number), UID_MIN (number)
Range of user IDs used for the creation of regular users by useradd or newusers.
The default value for UID_MIN (resp. UID_MAX) is 1000 (resp. 60000).
The UID_MIN and UID_MAX really just affect useradd command (which is the reason why we use it since other extensions execute useradd) and are not necessarily representative of system accounts
The code here checks /etc/login.defs to see if the user's UID is less than UID_MIN.
However, login.defs also has settings to defined min/max SYSTEM UID range:
In our use case, this causes problems because the admin ID is created very early in provisioning BEFORE we can set our standard values for UID_MIN / UID_MAX... and after we do, then the admin ID falls outside the range and is marked as a system user.
The check would be better to also validate against SYS_UID_MAX.
https://github.com/Azure/azure-linux-extensions/blob/b4d783a87157675f81505aa94af5bb2935a1307d/Utils/distroutils.py#L175