Issue #10949 has been reported by Tim Bishop.
----------------------------------------
Bug #10949: Changing groups on a user doesn't remove them from old groups
https://projects.puppetlabs.com/issues/10949
Author: Tim Bishop
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
When changing the group of a user they are not removed from old groups. I'm not
sure whether this is intended behaviour or a bug. Example:
<pre>
user { "test1":
ensure => present,
gid => "users",
groups => "mail",
}
</pre>
User is created:
<pre>
debug: User[test1](provider=useradd): Executing '/usr/sbin/useradd -g users -G
mail -M test1'
</pre>
And in group `mail`:
<pre>
# grep test1 /etc/group
mail:x:12:mail,postfix,test1
</pre>
Change the user's groups:
<pre>
user { "test1":
ensure => present,
gid => "users",
groups => "dialout",
}
</pre>
User is added to group `dialout` but not removed from `mail`:
<pre>
debug: User[test1](provider=useradd): Executing '/usr/sbin/usermod -G
dialout,mail test1'
notice: /Stage[main]//Node[osiris]/User[test1]/groups: groups changed 'mail' to
'dialout,mail'
</pre>
<pre>
# grep test1 /etc/group
mail:x:12:mail,postfix,test1
dialout:x:18:test1
</pre>
I've confirmed this behaviour on both RedHat and FreeBSD, so it's happening at
a higher level than the user providers. I couldn't find the relevant code
though.
I'm not sure whether I think this is correct behaviour or not. In the example
I've given it would be surprising for the user not to be removed from the group
`mail`. However, if the user was added to a group outside of Puppet it might
also be surprising to see them get removed when a change to their groups
happens.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.