]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: hash the machine name, when looking for a suitable UID base (#7437)
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2017 19:57:19 +0000 (20:57 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 24 Nov 2017 19:57:19 +0000 (20:57 +0100)
commitd381c8a6bf850f4d349de515e56b561d41bdd528
tree8c3f8e9846507814285f03c7f2dcb070f7bef2c4
parenta8027a18f17e4c9798decae98efa9084c0868f0a
nspawn: hash the machine name, when looking for a suitable UID base (#7437)

When "-U" is used we look for a UID range we can use for our container.
We start with the UID the tree is already assigned to, and if that
didn't work we'd pick random ranges so far. With this change we'll first
try to hash a suitable range from the container name, and use that if it
works, in order to make UID assignments more likely to be stable.

This follows a similar logic PID 1 follows when using DynamicUser=1.
src/nspawn/nspawn.c