puppet-accounts icon indicating copy to clipboard operation
puppet-accounts copied to clipboard

Bad group when creating user home

Open eleanorcuallado opened this issue 3 years ago • 0 comments

We are using the accounts 1.5.3 version with RHEL 7/8 (puppet 6), and found out that when creating a user with a custom group, the initial initializing of the home folder will be done before the user is added to said group, and so the initial files are created with a dummy group.

MicrosoftTeams-image (4) In this example, the nolio user was created with a custom nolio group with a custom gid, and while part of the files are created with the nolio file, the initial home files (the shell stuff) are created with the initial dummy group 12002.

I looked around in the code, and it would seem that since creating the group requires the users to be done, the home folder will have been created first (or at least part of it) and so the wrong group is assigned to it.

I suppose fixing it would require either creating the groups first and then assign the users, or making sure to chown the whole folder to the primary group (though the later might prove complex depending on the other puppet classes applied)

eleanorcuallado avatar Jul 13 '21 11:07 eleanorcuallado