#22: pam_mkhomedir uses user alias username instead of canonical name when creating home directories -------------------------------------------------+------------------------- Reporter: musicalvegan0 | Owner: pam- Type: defect | developers@… Priority: major | Status: new Version: 1.1.x | Component: modules Keywords: sssd, ipa, active directory, | Resolution: mkhomedir | Blocked By: Blocking: | -------------------------------------------------+-------------------------
Comment (by ldv):
OK, {{{pam_mkhomedir}}} essentially implements the following: - gets {{{NAME}}} via {{{pam_get_item(PAM_USER)}}}, it is the same {{{NAME}}} that was passed to {{{pam_start()}}} unless explicitly changed using {{{pam_set_item(PAM_USER)}}}; - if {{{getpwnam(NAME)->pw_dir}}} exists, exit; - if {{{getpwnam(getpwnam(NAME)->pw_name)->pw_dir}}} exists, exit; - create {{{getpwnam(getpwnam(NAME)->pw_name)->pw_dir}}} from the skeleton directory.
I agree this logic is somewhat flawed wrt {{{getpwnam(NAME)->pw_name}}} indirection which looks redundant here. But the problem described in sssd-users mailing list could arise due to {{{pam_mkhomedir}}} ''only if'' {{{getpwnam(NAME)->pw_dir}}} differs from {{{getpwnam(getpwnam(NAME)->pw_name)->pw_dir}}}, which is certainly not the wisest thing to do.