Package: libpam-mklocaluser
Version: 0.10
Severity: important
User: [email protected]
Usertags: debian-edu

When logging in a LDAP user into kdm for the first time on a freshly
installed Roaming Workstation based on Debian Edu Jessie, the login went
fine but instead of being told that a local user was created, I was told
that the user had no home directory and the login failed.

These are the related messages in /var/log/auth.log:

Sep  4 19:32:08 thinkpadx200 kdm: :0[2256]: pam_unix(kdm:auth): authentication 
failure; logname= uid=0 euid
=0 tty=:0 ruser= rhost=  user=pere
Sep  4 19:32:08 thinkpadx200 kdm: :0[2256]: pam_sss(kdm:auth): authentication 
success; logname= uid=0 euid=
0 tty=:0 ruser= rhost= user=pere
Sep  4 19:32:08 thinkpadx200 kdm: :0[2256]: pam_unix(kdm:session): session 
opened for user pere by (uid=0)
Sep  4 19:32:08 thinkpadx200 systemd-logind[1735]: New session 1 of user pere.
Sep  4 19:32:08 thinkpadx200 systemd-logind[1735]: Linked /tmp/.X11-unix/X0 to 
/run/user/1000/X11-display.
Sep  4 19:32:08 thinkpadx200 systemd: pam_unix(systemd-user:session): session 
opened for user pere by (uid=
0)
Sep  4 19:32:08 thinkpadx200 pam_mklocaluser[3283]: Creating local 
passwd/shadow entry uid=1000(pere) gid=1
000(pere) gecos='Petter Reinholdtsen' home=/home/pere
Sep  4 19:32:08 thinkpadx200 pam_mklocaluser[3283]: Creating local home 
directory for user 'pere'
Sep  4 19:32:08 thinkpadx200 pam_mklocaluser[2256]: 
pam_ck_connector(kdm:session): nox11 mode, ignoring PAM
_TTY :0
Sep  4 19:32:08 thinkpadx200 pam_mklocaluser[3283]: Failure while creating 
local user: Conversation error
Sep  4 19:32:08 thinkpadx200 pam_mklocaluser[3283]: 
pam_ck_connector(systemd-user:session): cannot determin
e display-device
Sep  4 19:33:11 thinkpadx200 kdm: :0[2256]: pam_unix(kdm:session): session 
closed for user pere
Sep  4 19:33:17 thinkpadx200 systemd-logind[1735]: Removed session 1.

The new user is present in /etc/passwd and /etc/shadow, so I expect the
python script crashed when trying to send a message back to kdm, but it
could have happend earlier too.  The mklocaluser.d/ fragment in place
seem to have executed as it should (~pere/.local/share/user-places.xbel
is correct).

      syslog.syslog("Creating local home directory for user '%s'" % user)
      # Copy content of /etc/skel
      shutil.copytree("/etc/skel/.", newhomedir, True)

      # Change perm of new home dir
      os.chmod(newhomedir, dirmode)
      chown_recursive(newhomedir, uid, gid)

      # Flush nscd cache to get rid of original user entry
      if os.access("/usr/sbin/nscd", os.X_OK):
        runcmd(pamh, "/usr/sbin/nscd -i passwd")

      # Hook for adjusting the freshly created home directory
      # FIXME Should be rewritten in python, I guess
      runcmd(pamh, "if [ -d /etc/mklocaluser.d ]; then ORIGHOMEDIR='%s' 
USER='%s' /bin/run-parts /etc/mklocaluser.d ; fi" % (homedir, user))

      # Let the user know what is going on
      msg = pamh.Message(pamh.PAM_TEXT_INFO,
                         "Local user created in /home/, please log in again to 
start using it.")
      pamh.conversation(msg)

      # Throw out user, as the log process cached the home directory
      # and need to be restarted.
      return pamh.PAM_TRY_AGAIN

No idea what could go wrong here.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]

Reply via email to