-
Notifications
You must be signed in to change notification settings - Fork 276
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
pam_mkhomedir: add copymode option to keep the mode of each subfiles/subfolders from skeleton #512
base: master
Are you sure you want to change the base?
Conversation
4cf13fe
to
3f9ab9c
Compare
Why do you suggest copying directory permissions from the skeleton directory? |
I made a mistake by wanting to copy sub-directories permissions from the default skeleton, directory. May I suggest checking if Do you agree with that @ldv-alt ? In that case I will change my PR 👍 |
I don't feel comfortable with changing a traditional behaviour like this. What do you think about adding a new option? Anyway, please make sure this new mode interacts with |
Tanks for your comment ! I fully agree to add a new option. I am going to update this request and add this new option following by this man documentation. |
d2bc420
to
c2e78c2
Compare
c2e78c2
to
e958158
Compare
Thank you for the review, and sorry for these mistakes, I was not able to see straight. I update the documentation and change the correct chmod(). |
e958158
to
1a82348
Compare
1a82348
to
17fb201
Compare
Sorry, I don't understand your latest changes. Why do you want to change umask every time Also, why do you change just the helper? Don't you think pam_mkhomedir needs an option, too? |
I was basing to what it was done for files. Especially here: https://github.com/linux-pam/linux-pam/blob/master/modules/pam_mkhomedir/mkhomedir_helper.c#L266. Where it keeps the same access permissions to the new file from the original one in the skeleton. Initially, I wanted to fix the linked issue. However, your are right, I should also expend this update to the pam_mkhomedir. If you agree with my latest changes, I will do the job to update mkhome_dir module. |
<replaceable>dir_mode</replaceable> defines the mode option for all | ||
home directory's subfolders. Put "<emphasis>copymode</emphasis>" to keep | ||
the same access permission as <replaceable>path-to-skel</replaceable>'s | ||
subfolders, otherwise it will keep the default value 0777. All directories | ||
access permissions are computed from the value of | ||
<replaceable>umask</replaceable>. |
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.
To be honest, this description looks confusing to me. It's not clear whether this parameter can be set yo anything besides copymode
, and how it interacts with umask
.
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.
Agree. I try to simplify this one with the last modifications
17fb201
to
40f328f
Compare
bcb2216
to
3092c3b
Compare
3092c3b
to
49fae9f
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.
Two minor style notes.
49fae9f
to
35380d8
Compare
* Option to keep same mode from all skeleton's subfiles to home's dir subfiles. * Add an usage example to the man of this helper. Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
* Use copymode option from the mkhomedir helper. Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
35380d8
to
aea9d3c
Compare
With the command
mkhomedir_helper $new_user $u_mask $skeleton_path
, the new user home directory is created from the skeleton, but without same permissions on sub directories.Fix #497
Signed-off-by: Valentin Lefebvre valentin.lefebvre@suse.com