Bug 1185342

Summary: YaST does not set up subuids/-gids for users
Product: [SUSE Linux Enterprise Server] PUBLIC SUSE Linux Enterprise Server 15 SP3 Reporter: Fabian Vogt <fvogt>
Component: YaST2Assignee: E-mail List <yast2-maintainers>
Status: VERIFIED FEATURE QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P2 - High CC: ancor, ioannis.bonatakis, pdostal
Version: unspecified   
Target Milestone: unspecified   
Hardware: Other   
OS: Other   
URL: https://openqa.suse.de/tests/5900328/modules/rootless_podman/steps/1
Whiteboard:
Found By: openQA Services Priority:
Business Priority: Blocker: Yes
Marketing QA Status: --- IT Deployment: ---

Description Fabian Vogt 2021-04-27 09:56:45 UTC
Clone of bug 1179261.

While "useradd" uses the SUB_UID_COUNT/SUB_GID_COUNT values from login.defs to assign subuids/-gids for newly created users, YaST does not use useradd and users do not have subuids/-gids.

This means that additional steps have to be taken to allow use of features like rootless containers.

## Observation

openQA test in scenario sle-15-SP3-Online-x86_64-containers_sle_image_on_sle_host@64bit fails in
[rootless_podman](https://openqa.suse.de/tests/5900328/modules/rootless_podman/steps/1)

## Test suite description
Extra tests about software in containers module on SLE



## Reproducible

Fails since (at least) Build [178.1](https://openqa.suse.de/tests/5900328) (current job)


## Expected result

Last good: [14.2.23](https://openqa.suse.de/tests/5896073) (or more recent)


## Further details

Always latest result in this scenario: [latest](https://openqa.suse.de/tests/latest?arch=x86_64&distri=sle&flavor=Online&machine=64bit&test=containers_sle_image_on_sle_host&version=15-SP3)
Comment 1 Stefan Weiberg 2021-04-28 07:35:24 UTC
Regarding the shadow update mentioned in the openSUSE bug, we have merged it in 15 SP3 already in case it is a requirement to resolve this issue.
Comment 2 Ancor Gonzalez Sosa 2021-04-28 10:30:04 UTC
The current yast2-users do not support subuids and subgids.

Support for that was added to useradd as part of fate#320422, titled "Shadow update to enable user namespaces remapping in Docker".

But there was never a request to add such feature to yast2-users as well. This bug report is the first news the YaST Team has received about that being wanted.

So we are tempted to close this as FEATURE and request a (late) Jira entry instead.

As a side note, maintenance of yast2-users (in the sense of keeping its features in sync with the shadow suite) would be much easier if yast2-users would use useradd (and other shadow tools) under the hood. We are currently working on that. Hopefully a first version will land in Tumbleweed in a couple of months. But that's not what the original developers of yast2-users did (many years ago, this is likely the oldest YaST module around) so please don't expect that yast2-users available in the current SLES will automatically gain every feature added useradd without nobody requesting it.
Comment 3 Ancor Gonzalez Sosa 2021-04-28 11:36:55 UTC
(In reply to Ancor Gonzalez Sosa from comment #2)
> 
> So we are tempted to close this as FEATURE and request a (late) Jira entry
> instead.

Doing so. Please create a Jira entry describing how subuids and subgids should work in yast2-user. For example, should it generate them unconditionally during installation? Should YaST offer any UI to configure them when yast2-user is executed in an already installed system? What are the expectations about AutoYaST?
Comment 4 Fabian Vogt 2021-04-28 11:41:00 UTC
(In reply to Ancor Gonzalez Sosa from comment #2)
> The current yast2-users do not support subuids and subgids.
> 
> Support for that was added to useradd as part of fate#320422, titled "Shadow
> update to enable user namespaces remapping in Docker".
> 
> But there was never a request to add such feature to yast2-users as well.
> This bug report is the first news the YaST Team has received about that
> being wanted.
> 
> So we are tempted to close this as FEATURE and request a (late) Jira entry
> instead.
> 
> As a side note, maintenance of yast2-users (in the sense of keeping its
> features in sync with the shadow suite) would be much easier if yast2-users
> would use useradd (and other shadow tools) under the hood. We are currently
> working on that. Hopefully a first version will land in Tumbleweed in a
> couple of months. But that's not what the original developers of yast2-users
> did (many years ago, this is likely the oldest YaST module around) so please
> don't expect that yast2-users available in the current SLES will
> automatically gain every feature added useradd without nobody requesting it.

The main issue here is that most outside of the YaST team aren't aware of that
technicality. IMO it's natural to assume that users created by YaST (which is
the recommended way) are complete and very similar to use created by useradd.

The referenced FATE entry also reads like noone there was aware that YaST had
separate code and just assumed that implementing the feature in shadow is
enough so that users created using YaST are also getting subuids/-gids.

IMO every mismatch between useradd and YaST is a bug. yast2-users-ng addresses
that in a future-proof way, but until then yast2-users needs fixes as well.
Comment 5 Fabian Vogt 2021-04-28 11:49:13 UTC
(In reply to Ancor Gonzalez Sosa from comment #3)
> (In reply to Ancor Gonzalez Sosa from comment #2)
> > 
> > So we are tempted to close this as FEATURE and request a (late) Jira entry
> > instead.
> 
> Doing so. Please create a Jira entry describing how subuids and subgids
> should work in yast2-user. For example, should it generate them
> unconditionally during installation? Should YaST offer any UI to configure
> them when yast2-user is executed in an already installed system? What are
> the expectations about AutoYaST?

useradd adds them unconditionally for all non-system users (https://github.com/shadow-maint/shadow/blob/7273c25cc21480de275d1632ee19b8123ec119ad/src/useradd.c#L2423), so YaST could do the same both in the installed system and AutoYaST. A UI to add them to existing users would be nice, but IMO just an optional feature.
Comment 6 Ancor Gonzalez Sosa 2021-04-28 12:38:23 UTC
(In reply to Fabian Vogt from comment #4)
> 
> IMO it's natural to assume that users created by YaST (which is
> the recommended way) are complete and very similar to use created by useradd.

I fear you are elevating your own expectations about how yast2-users should have been implemented (which I personally share) to the category of requirement.

> IMO every mismatch between useradd and YaST is a bug.

IMO is not.

useradd and yast2-users are two different tools. yast2-users has never claimed to be a GUI/TUI frontend for useradd[1]. In other words, mimicking the useradd behavior (current or future) was never a requirement for yast2-user.

In some sense, your sentence looks to me a bit like "every mismatch between wicked and systemd-networkd is a bug or "every mismatch between SUSEFirewall and Firewalld is a bug".

[1] Quite the opposite, that was intentionally avoided. See
https://github.com/yast/yast-users/blob/master/package/yast2-users.changes#L3687
Comment 7 Lukas Ocilka 2021-04-29 07:44:47 UTC
We still claim that this is a feature request. Please read comment #3 again and file a feature. It MAY be delivered as ECO, but definitely not as a bugfix as it's not a bug.

Requesting new functionality in SLE is possible only through JIRA. And especially as it's unclear what exactly should be implemented, how, and how this is expected to be used, what is the expected default behavior, how the UI should look like (if at all), etc. We need use-cases, Docu team needs information how to document it, QA needs info how to test it, ... it's a feature request.
Comment 8 Fabian Vogt 2021-04-29 09:22:21 UTC
(In reply to Ancor Gonzalez Sosa from comment #6)
> (In reply to Fabian Vogt from comment #4)
> useradd and yast2-users are two different tools. yast2-users has never
> claimed to be a GUI/TUI frontend for useradd[1]. In other words, mimicking
> the useradd behavior (current or future) was never a requirement for
> yast2-user.

Is that explicitly documented? It is very counter intuitive and against
expectations that users created by YaST do not follow what is configured
in /etc/login.defs.

> In some sense, your sentence looks to me a bit like "every mismatch between
> wicked and systemd-networkd is a bug or "every mismatch between SUSEFirewall
> and Firewalld is a bug".

I don't think that's a valid analogy, because wicked and systemd-networkd are
alternative tools which are not used simultaneously or even installed on the
same system.

From my perspective this is more like if yast-packager didn't implement
dependency solving properly, resulting in an incomplete installation.

> [1] Quite the opposite, that was intentionally avoided. See
> https://github.com/yast/yast-users/blob/master/package/yast2-users.
> changes#L3687

Is it also written down why?

(In reply to Lukas Ocilka from comment #7)
> We still claim that this is a feature request. Please read comment #3 again
> and file a feature. It MAY be delivered as ECO, but definitely not as a
> bugfix as it's not a bug.
>
> Requesting new functionality in SLE is possible only through JIRA. And
> especially as it's unclear what exactly should be implemented, how, and how
> this is expected to be used, what is the expected default behavior, how the
> UI should look like (if at all), etc. We need use-cases, Docu team needs
> information how to document it, QA needs info how to test it, ... it's a
> feature request.

The whole process for that is a pain, but here you go:
https://jira.suse.com/browse/PM-2620
Comment 9 Ancor Gonzalez Sosa 2021-04-29 09:29:49 UTC
(In reply to Fabian Vogt from comment #8)
> 
> > [1] Quite the opposite, that was intentionally avoided. See
> > https://github.com/yast/yast-users/blob/master/package/yast2-users.
> > changes#L3687
> 
> Is it also written down why?

Unfortunately no. And nobody seems to know. :( I guess it looked like a wise decision back then for whatever reason(s).
Comment 10 openQA Review 2021-05-14 05:18:15 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1738613

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released"
3. The label in the openQA scenario is removed
Comment 11 openQA Review 2021-05-28 05:18:29 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1758644

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released"
3. The label in the openQA scenario is removed
Comment 12 openQA Review 2021-06-11 05:18:44 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1779789

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released"
3. The label in the openQA scenario is removed
Comment 13 Oliver Kurz 2021-06-25 06:25:05 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1805377

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The label in the openQA scenario is removed
Comment 14 Ancor Gonzalez Sosa 2021-06-29 07:56:14 UTC
Just for completeness, note that we are restructuring YaST Users in the master branch of the repository to rely in useradd (& friends) when creating the users. That means those changes will land in openSUSE Tumbleweed in the short term and also SLE-15-SP4 in the mid term.

See the details in this blog post https://yast.opensuse.org/blog/2021-06-28/sprint-126 or in this pull request (same information but with more links) https://github.com/yast/yast-users/pull/316
Comment 15 Fabian Vogt 2021-07-09 11:48:56 UTC
(In reply to Ancor Gonzalez Sosa from comment #14)
> Just for completeness, note that we are restructuring YaST Users in the
> master branch of the repository to rely in useradd (& friends) when creating
> the users. That means those changes will land in openSUSE Tumbleweed in the
> short term and also SLE-15-SP4 in the mid term.
> 
> See the details in this blog post
> https://yast.opensuse.org/blog/2021-06-28/sprint-126 or in this pull request
> (same information but with more links)
> https://github.com/yast/yast-users/pull/316

openQA agrees, the subuid/subgid setup is complete now: https://openqa.opensuse.org/tests/1831564#step/rootless_podman/34

Thanks!
Comment 16 openQA Review 2021-07-24 00:01:22 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1854020

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The label in the openQA scenario is removed
Comment 17 openQA Review 2021-08-07 00:38:52 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: engines_and_tools_podman
https://openqa.suse.de/tests/6660125

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The label in the openQA scenario is removed
Comment 18 openQA Review 2021-08-21 00:54:40 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: engines_and_tools_podman
https://openqa.suse.de/tests/6900937

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The label in the openQA scenario is removed
Comment 19 openQA Review 2021-09-04 23:58:55 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1901374

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The label in the openQA scenario is removed
Comment 20 openQA Review 2021-09-18 23:59:09 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: textmode@64bit
https://openqa.opensuse.org/tests/1923730

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 21 openQA Review 2021-10-03 00:48:41 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7300527

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 22 openQA Review 2021-10-17 00:57:07 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7438623

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 23 openQA Review 2021-10-31 01:12:27 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7572210

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 24 openQA Review 2021-11-14 01:16:47 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7671843

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 25 openQA Review 2021-11-29 00:36:15 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7751240

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 26 openQA Review 2021-12-13 00:52:40 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7837439

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 27 openQA Review 2021-12-27 00:53:50 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7907706

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 28 openQA Review 2022-01-10 00:58:56 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/7954473

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 29 openQA Review 2022-01-24 12:55:39 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/8018069

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 30 openQA Review 2022-02-08 00:31:48 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/8113186

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 31 openQA Review 2022-02-22 00:32:57 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/8202242

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
Comment 32 openQA Review 2022-03-22 02:12:49 UTC
This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: podman_tests
https://openqa.suse.de/tests/8360528

To prevent further reminder comments one of the following options should be followed:
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`

Expect the next reminder at the earliest in 56 days if nothing changes in this ticket.