Blame SOURCES/pam-1.1.8-canonicalize-username.patch

f2fdff
diff -up Linux-PAM-1.1.8/modules/pam_selinux/pam_selinux.c.canonicalize Linux-PAM-1.1.8/modules/pam_selinux/pam_selinux.c
f2fdff
--- Linux-PAM-1.1.8/modules/pam_selinux/pam_selinux.c.canonicalize	2013-06-18 16:11:21.000000000 +0200
f2fdff
+++ Linux-PAM-1.1.8/modules/pam_selinux/pam_selinux.c	2014-03-06 12:03:54.429639972 +0100
f2fdff
@@ -491,12 +491,17 @@ compute_exec_context(pam_handle_t *pamh,
f2fdff
   char *level = NULL;
f2fdff
   security_context_t *contextlist = NULL;
f2fdff
   int num_contexts = 0;
f2fdff
+  const struct passwd *pwd;
f2fdff
 
f2fdff
   if (!(username = get_item(pamh, PAM_USER))) {
f2fdff
     pam_syslog(pamh, LOG_ERR, "Cannot obtain the user name");
f2fdff
     return PAM_USER_UNKNOWN;
f2fdff
   }
f2fdff
 
f2fdff
+  if ((pwd = pam_modutil_getpwnam(pamh, username)) != NULL) {
f2fdff
+    username = pwd->pw_name;
f2fdff
+  } /* ignore error and keep using original username */
f2fdff
+
f2fdff
   /* compute execute context */
f2fdff
 #ifdef HAVE_GETSEUSER
f2fdff
   if (!(service = get_item(pamh, PAM_SERVICE))) {