bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
608 stars 64 forks source link

Ubuntu needs system uid range in adduser.conf #301

Open willem640 opened 5 months ago

willem640 commented 5 months ago

Unfortunately I'm not (yet) very familiar with the project so can't create a pull request for this. When installing dbus in an Ubuntu stratum (hijacked Fedora), apt gives me the following error: fatal: The user 'messagebus' already exists, but is not a system user. Exiting.

This is because Ubuntu uses 100-999 as the system uid/gid range by default, but Fedora uses 1-999. Bedrock correctly has /etc/login.defs as a global file, but adduser uses /etc/adduser.conf in Ubuntu.

My proposed solution: The following options should be imported from login.defs or synchronized between login.defs and adduser.conf:

/etc/login.defs - /etc/adduser.conf
SYS_UID_MIN - FIRST_SYSTEM_UID
SYS_UID_MAX - LAST_SYSTEM_UID
SYS_GID_MIN - FIRST_SYSTEM_GID
SYS_GID_MAX - LAST_SYSTEM_GID

Perhaps the same should be done for FIRST_UID, LAST_UID, FIRST_GID and LAST_GID. Those values have the same name in login.defs.

Maybe someone can make a PR for this (or tell me how to do it). Thanks!

paradigm commented 5 months ago

Bedrock does make some effort to resolve this concern, but I'm not fresh on this area to recall specifics. Take a look at enforce_id_ranges in /bedrock/share/common-code This should be called both when brl enable and brl repairing a stratum.

You seem interested in not just reporting the issue but contributing here. Could you investigate why the current solution is inadequate?