You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.
Here is implementation (at least the most revelant part):
for user_group in groups:
self.execute('usermod -G %s %s' % (user_group, username), stdout=False, sudo=True)
If I call ensure_user_groups('foo', ['group1', 'group2']) following statements would be called:
usermod -G group1 foo
usermod -G group2 foo
While man usermod states:
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
...
If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be changed via the -a option, which appends the user to the current supplementary group list.
So this would result in foo being member of group1 as usermod -G group2 foo would remove foo from group1
The text was updated successfully, but these errors were encountered:
There is a serious error in mentioned method
Here is implementation (at least the most revelant part):
If I call
ensure_user_groups('foo', ['group1', 'group2'])
following statements would be called:While
man usermod
states:So this would result in
foo
being member ofgroup1
asusermod -G group2 foo
would removefoo
fromgroup1
The text was updated successfully, but these errors were encountered: