Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatcar-tmpfiles: Always copy missing entries over to the database #26

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Jan 17, 2023

When a user or group entry is missing but the passwd/group file exists it is not added by flatcar-tmpfiles and systemd-tmpfiles will then fail because it can't resolve the user or group. We only care about the fixed set of users like "core" because those are the ones that the user will normally customize and this is also enough to fix the bug because tmpfiles.d/baselayout-home.conf is the only place where not "root" is used but another user which is "core".
Always copy the missing entries (from the fixed list of entries to be copied) over to the database under /etc/, regardless if it exists or not.

How to use

Should be backported to Beta/Alpha to fix flatcar/Flatcar#946 (comment)

Testing done

In CI plus manually with the provided image from flatcar/Flatcar#946 through sudo flatcar-update -P flatcar_test_update.gz -D -V 9999.9.9 and also with the following test cases:

  • manually creating a core user with a different comment/name and rerunning
  • manually deleting the core group and rerunning
  • manually truncating the shadow file and rerunning
  • ensuring that the files get created if they don't exist

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 17, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 18, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 18, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
@pothos pothos marked this pull request as ready for review January 18, 2023 20:15
@pothos pothos requested a review from a team January 18, 2023 20:15
scripts/flatcar-tmpfiles Outdated Show resolved Hide resolved
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 19, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
@pothos pothos requested a review from krnowak January 19, 2023 16:54
Copy link
Member

@krnowak krnowak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, had only some comment nitpicks.

scripts/flatcar-tmpfiles Outdated Show resolved Hide resolved
scripts/flatcar-tmpfiles Outdated Show resolved Hide resolved
When a user or group entry is missing but the passwd/group file exists
it is not added by flatcar-tmpfiles and systemd-tmpfiles will then fail
because it can't resolve the user or group. We only care about the
fixed set of users like "core" because those are the ones that the user
will normally customize and this is also enough to fix the bug because
tmpfiles.d/baselayout-home.conf is the only place where not "root" is
used but another user which is "core".
Always copy the missing entries (from the fixed list of entries to be
copied) over to the database under /etc/, regardless if it exists or
not.
@pothos pothos merged commit b2a203f into flatcar-master Jan 20, 2023
@pothos pothos deleted the kai/populate-always branch January 20, 2023 10:19
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 20, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 20, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 20, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Jan 20, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 17, 2023
This pulls in
flatcar/baselayout#26
to fix the regression in Alpha/Beta (itself a fix for another
regression) where systemd-tmpfiles bailed if /etc/passwd|group didn't
have the core user, now solved by always copying missing entries over
to the databases, not only if the files didn't exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release Flatcar Container Linux Alpha 3480.0.0, Beta 3446.1.0, Stable 3374.2.2
2 participants