serpent-os / boulder-d-legacy

Replaced by Rust tooling
https://serpentos.com
21 stars 7 forks source link

Parse /etc/passwd for suitably unprivileged user to use for builds #4

Closed ermo closed 2 years ago

ermo commented 2 years ago

Currently, this user is hardcoded to uid 65_534 (the "default" nobody UID) in source/boulder/stages/package.d

However, this breaks on Fedora because Fedora uses uid 65_534 for the separate nfsnobody user (likely for security purposes), whereas the "normal" nobody user has uid 99.

The suggested approach is to use (a variant of) getpwent and then cache the resulting uid in a Thread Global immutable __gshared unprivilegedUser variable in the boulder main() function.

ermo commented 2 years ago

Fixed in https://github.com/serpent-os/boulder/commit/c63b7b20d23f09bc867f8b900fcec1960a4b3c4c