Skip to content

Conversation

@poettering
Copy link
Member

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.

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.
@poettering
Copy link
Member Author

CI failure due to #7440. Everything else passed. Merging.

@poettering
Copy link
Member Author

Ah, wait, not merging, nobody reviewed this yet.....

@keszybz keszybz merged commit d381c8a into systemd:master Nov 24, 2017
angdraug added a commit to angdraug/systemd that referenced this pull request Dec 23, 2020
Explicitly document the behavior introduced in systemd#7437: when picking a new
UID shift base with "-U", a hash of the machine name will be tried
before falling back to fully random UID base candidates.
bluca pushed a commit that referenced this pull request Dec 23, 2020
Explicitly document the behavior introduced in #7437: when picking a new
UID shift base with "-U", a hash of the machine name will be tried
before falling back to fully random UID base candidates.
mikhailnov pushed a commit to mikhailnov/systemd that referenced this pull request Apr 23, 2021
Explicitly document the behavior introduced in systemd#7437: when picking a new
UID shift base with "-U", a hash of the machine name will be tried
before falling back to fully random UID base candidates.

(cherry picked from commit 68709a6)
(cherry picked from commit 4032a13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants