]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: rhbz#443667
authorTomas Mraz <tm@t8m.info>
Tue, 22 Apr 2008 19:21:37 +0000 (19:21 +0000)
committerTomas Mraz <tm@t8m.info>
Tue, 22 Apr 2008 19:21:37 +0000 (19:21 +0000)
Purpose of commit: bugfix

Commit summary:
---------------
2008-04-22  Tomas Mraz <t8m@centrum.cz>

        * modules/pam_selinux/pam_selinux.c(pam_sm_close_sesion): Fix
        regression from the change from 2008-03-20. setexeccon() must be
        called also with NULL prev_context.

ChangeLog
modules/pam_selinux/pam_selinux.c

index c8901a4d24a0288a73698145a10e2bb5b0082d8f..f1537404352139f248bce6186a8e23638fb1fe1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-22  Tomas Mraz <t8m@centrum.cz>
+
+       * modules/pam_selinux/pam_selinux.c(pam_sm_close_sesion): Fix
+       regression from the change from 2008-03-20. setexeccon() must be
+       called also with NULL prev_context.
+
 2008-04-21  Thorsten Kukuk  <kukuk@thkukuk.de>
 
        * modules/pam_access/access.conf.5.xml: Document changed behavior
index f679e33d3c6dc9f02b01a3e8b869933fa6f08c41..da49f3f9fe5a52792460b74c7f7fa0cc6ea2a67f 100644 (file)
@@ -702,21 +702,21 @@ pam_sm_close_session(pam_handle_t *pamh, int flags UNUSED,
     free(ttyn);
     ttyn=NULL;
   }
-  if (prev_user_context) {
-    if (setexeccon(prev_user_context)) {
+
+  if (setexeccon(prev_user_context)) {
       pam_syslog(pamh, LOG_ERR, "Unable to restore executable context %s.",
-              prev_user_context);
+              prev_user_context ? prev_user_context : "");
       if (security_getenforce() == 1)
          status = PAM_AUTH_ERR;
       else
          status = PAM_SUCCESS;
-    }
+  } else if (debug)
+      pam_syslog(pamh, LOG_NOTICE, "Executable context back to original");
+
+  if (prev_user_context) {
     freecon(prev_user_context);
     prev_user_context = NULL;
   }
 
-  if (debug)
-    pam_syslog(pamh, LOG_NOTICE, "setcontext back to orginal");
-
   return status;
 }