-
Notifications
You must be signed in to change notification settings - Fork 247
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
passwd: Add a way to delete users/groups #1014
passwd: Add a way to delete users/groups #1014
Conversation
85fe04e
to
07ddcd4
Compare
07ddcd4
to
c89095f
Compare
From the CI output it looks like you need to update the translate function (here's an example of what I did in the LUKS stuff: 5e91412#diff-9f93889254bb669415809d4953fd3fbe) |
733df71
to
c7e716d
Compare
Both `getpwnam_r(3)` and `getgrnam_r(3)` can return `ENOENT` or `ESRCH` if the record is not found. Handle these. The manpages also list `EBADF` and `EPERM` (and implies others via `...`) as other possible codes, which is not great. Digging into this a bit, I think it may be due to different conventions in different NSS providers? Let's just handle `ENOENT` and `ESRCH` for now and leave the less obvious ones until we actually hit something that returns it. This fixes the error CI is hitting in coreos#1014 where it gets `ESRCH` when looking up a non-existent group. Tested-by: Sohan Kunkerkar <[email protected]>
Both `getpwnam_r(3)` and `getgrnam_r(3)` can return `ENOENT` or `ESRCH` if the record is not found. Handle these. The manpages also list `EBADF` and `EPERM` (and implies others via `...`) as other possible codes, which is not great. Digging into this a bit, I think it may be due to different conventions in different NSS providers? Let's just handle `ENOENT` and `ESRCH` for now and leave the less obvious ones until we actually hit something that returns it. This fixes the error CI is hitting in coreos#1014 where it gets `ESRCH` when looking up a non-existent group. Tested-by: Sohan Kunkerkar <[email protected]>
7b96d10
to
0178899
Compare
I would like to add a test to verify this change, however, I'm a little skeptical about the testing part because there's no way I can delete the existing users/groups, at least for an FCOS base image (all users listed below are created via Ignition during first boot and not built into the image) [core@localhost ~]$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
core:x:1000:1000:CoreOS Admin:/var/home/core:/bin/bash
fedora-coreos-pinger:x:981:981:Fedora CoreOS telemetry service user:/:/usr/sbin/nologin
zincati:x:980:980:Zincati user for auto-updates:/:/usr/sbin/nologin |
0178899
to
4c57257
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add a test to verify this change, however, I'm a little skeptical about the testing part.
Hmm, I think we can expand the blackbox tests we have for this? See e.g. tests/positive/passwd/users.go
.
bc0e4bc
to
a5735ab
Compare
ca0cf88
to
873d405
Compare
I want to more strongly emphasize my feelings on this: #738 (comment) I'm not opposed to this code as is, but it seems like it'd be a lot simpler for us to instead skip adding the Wouldn't it work to skip the |
2e99883
to
bdda6b6
Compare
67bb289
to
a2f9661
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the current code working in FCOS to be able to not create the core
user?
a2f9661
to
aa76153
Compare
Yeah, it is. |
8568a0e
to
74cd722
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM; CI looks like it needs a retrigger and will let someone else take another glance at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits, LGTM as is!
Fixes coreos#738 Some users may want to add a custom user, and remove the `core` user injected via the default configuration. This PR will enable users to delete the existing users/groups in a given distro.
This variable is added to indicate if we want to delete the existing users/groups
74cd722
to
786c866
Compare
We've got 3 approvals and green CI...can we merge this? |
For tracking purpose: coreos/fedora-coreos-tracker#155 |
This addition to the docs was missed in the original PR coreos#1014
This addition to the docs was missed in the original PR coreos#1014
This addition to the docs was missed in the original PR coreos#1014
Fixes #738
We need to wait until coreos/ignition-dracut#197 gets merged. Not ready for review yet.