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

man: clarify subid delegation #345

Merged
merged 1 commit into from
May 25, 2021

Conversation

ikerexxe
Copy link
Collaborator

Clarify that the subid delegation can only come from one source. This work is based on #331 (comment)

Related: #331

@alexey-tikhonov
Copy link

Thanks Iker.

There are some consequences for local user tools when you configure NSS module, would be great to document those.

Clarify that the subid delegation can only come from one source.
Moreover, add an example of what might happen if the subid source is NSS
and useradd is executed.

Related: shadow-maint#331
@brauner brauner merged commit 0871122 into shadow-maint:master May 25, 2021
@brauner
Copy link
Collaborator

brauner commented May 25, 2021

Thank you!

@hallyn
Copy link
Member

hallyn commented May 26, 2021

Does useradd fail with NSS set? This should only happen if SUB_UID_COUNT != 0 in login.defs. The comment suggests that useradd and groupadd are not possible at all with NSS. That should be fixed. If it isn't, please open a bug.

@ikerexxe
Copy link
Collaborator Author

Let me review it and I'll come back with a clarification by the beginning of next week.

@ikerexxe
Copy link
Collaborator Author

ikerexxe commented Jun 1, 2021

I've been testing it and the results don't match with what I wrote in the man page:

NSS SUB_UID_COUNT Useradd output /etc/sub*id
files 65536 User created locally Range created
files 0 User created locally Range not created
invalid 65536 User created locally Range created
invalid 0 User created locally Range not created
sss 65536 User created locally Range not created
sss 0 User created locally Range not created

Thus, I would propose to change the man page again. Instead of writing

So, for example, if the subid source is configured as NSS and
<command>useradd</command> is executed, then the command will fail and the entry will not be
created in <filename>/etc/subuid</filename>.

I'd propose to write

So, for example, if the subid source is configured as sss and
<command>useradd</command> is executed, then the user will be created, but the entry will not be
created in <filename>/etc/subuid</filename>.

@hallyn @alexey-tikhonov what are your thoughts?

@alexey-tikhonov
Copy link

I'd propose to write

So, for example, if the subid source is configured as sss and
<command>useradd</command> is executed, then the user will be created, but the entry will not be
created in <filename>/etc/subuid</filename>.

if the subid source is configured as sss -> if any subid source except files is configured

@brauner
Copy link
Collaborator

brauner commented Jun 1, 2021

I've been testing it and the results don't match with what I wrote in the man page:

NSS SUB_UID_COUNT Useradd output /etc/sub*id
files 65536 User created locally Range created
files 0 User created locally Range not created
invalid 65536 User created locally Range created
invalid 0 User created locally Range not created
sss 65536 User created locally Range not created
sss 0 User created locally Range not created
Thus, I would propose to change the man page again. Instead of writing

So, for example, if the subid source is configured as NSS and
<command>useradd</command> is executed, then the command will fail and the entry will not be
created in <filename>/etc/subuid</filename>.

I'd propose to write

So, for example, if the subid source is configured as sss and
<command>useradd</command> is executed, then the user will be created, but the entry will not be
created in <filename>/etc/subuid</filename>.

Should we rather fail completely in such a case? It feels that's cleaner.

@alexey-tikhonov
Copy link

That's more or less what I've been asking in #331

But it's perfectly legitimate to have users from different databases on a single host. So I don't think we should disable local user manipulation tools entirely in this case.

@hallyn
Copy link
Member

hallyn commented Jun 1, 2021

Oh. That wasn't my intent, indeed. Can we agree that if
subid is using something other than files, and SUB_UID_COUNT is
not 0, then the user creation should simply fail? Or is it
just easier (for users) to leave it like this, since the only
recourse is to edit login.defs anyway?

@alexey-tikhonov
Copy link

alexey-tikhonov commented Jun 1, 2021

I don't have strong opinion if it should fail with SUB_UID_COUNT != 0.

Imo, at the moment it's enough to carefully document current state.

@ikerexxe
Copy link
Collaborator Author

ikerexxe commented Jun 2, 2021

I agree with Alexey that for the moment documenting the current state should be enough. Besides, once users start using this feature I think that we'll get their feedback and we can take a more definitive decision regarding this problem.

ikerexxe added a commit to ikerexxe/shadow that referenced this pull request Jun 7, 2021
Following the discussion shadow-maint#345
I have changed the documentation to clarify the behaviour of subid
delegation when any subid source except files is configured.
ikerexxe added a commit to ikerexxe/shadow that referenced this pull request Jun 11, 2021
Following the discussion shadow-maint#345
I have changed the documentation to clarify the behaviour of subid
delegation when any subid source except files is configured.
ikerexxe added a commit to ikerexxe/shadow that referenced this pull request Jun 15, 2021
Following the discussion shadow-maint#345
I have changed the documentation to clarify the behaviour of subid
delegation when any subid source except files is configured.
@ikerexxe ikerexxe deleted the subid_single_source branch March 6, 2023 16:05
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.

None yet

4 participants