-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support for alternative YPPWD_SRCDIR #374
Conversation
39ec130
to
2d392ef
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.
Great improvement! Thanks.
Code wise looks quite good to me, but I will not approve it untill having a solution from the shadow tools for that commands missing --prefix
option.
2d392ef
to
8d7ca13
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.
LGTM
CI failing, but the failure is unrelated to the changes in this PR.
# | ||
# Hopefully, this mixin will disappear (maybe substituted by a similar one) once the shadow | ||
# tools gain the ability to specify the exact location of the passwd, shadow and groups files. | ||
module RootPath |
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.
NP: Maybe this mixin can be part of the Action
base class.
The shadow PR got merged today. |
08800b3
to
7bcbd1d
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.
LGTM
Added the changelog and version bump, since the updated shadow tools are already accepted. See https://build.suse.de/request/show/303035 and https://build.suse.de/request/show/303036 |
✔️ Internal Jenkins job #8 successfully finished |
Problem
In a NIS master server, there is a setting stored at
/etc/sysconfig/ypserv
and calledYPPWD_SRCDIR
that specifies where are thepasswd
,shadow
andgroup
files that NIS should export. By default this points to/etc
. So in a typical NIS master server, managing the users and groups of the NIS domain is fully equivalent to managing the local users and groups in the system.But what happens if that setting is set to a non default value?
When YaST Users runs in a system that is a NIS master server with
YPPWD_SRCDIR
pointing to an alternative location, it allows the user to select which set of "local users" should be managed in that execution of YaST - the one stored at/etc
or the one stored at the location pointed byYPPWD_SRCDIR
.Unfortunately, when rewriting YaST Users to rely on the
shadow
tools (useradd
and friends) we were not aware of that circumstance and YaST always modifies the files under/etc
.See https://bugzilla.suse.com/show_bug.cgi?id=1206627
Solution
First step. Make
Linux::Writer
more configurable so it can be instructed to write the changes to the files in the directory pointed byYPPWD_SRCDIR
Second step. Modify
Linux::Writer
and its action to execute the corresponding commands using the--prefix
argument (for all commandsuseradd
,userdel
,usermod
,groupadd
,groupdel
,groupmod
,passwd
,chpasswd
andchage
).Note for reviewer
This involved a previous refactoring to make easier to add new values to the
Linux::Writer
configuration. Review commit by commit if you want to easily follow the rationale of that refactoring.Testing