(Backport 50175) Add root parameter to useradd, shadow and groupadd - #54955
Merged
Conversation
(cherry picked from commit 7f72b56)
Use the root parameter in the rest of the public API. Refactor the code to remove duplicate code. (cherry picked from commit d0d9b86)
(cherry picked from commit bdd2246)
Refactor the code to avoid duplications, and use the alternative spwd functions when a different root is set. (cherry picked from commit 09d9da9)
In Python 3 the fields for name and password for the spwd module are different that in Python 2. This patch makes sure to explore first the Python 2 name and later check the Python 3 if is not found. (cherry picked from commit 21e59fb)
(cherry picked from commit 3c62e47)
(cherry picked from commit 79e621c)
In some places of the code gpasswd and usermod are used depending on the plataform. One use -Q and other use -R to indicate a different root parameter. This patch unify this, using --root parameter. Partially fix saltstack#43131 (cherry picked from commit 27372ee)
aplanas
force-pushed
the
backport_50175
branch
from
December 3, 2019 10:33
6a340c5 to
c60fbdb
Compare
Contributor
Author
|
Uau, this is huge. Thanks a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add root parameter to useradd and shadow execution modules
Tests written?
Yes
(backport #50175, already merged in develop)