858c76d
diff -up Linux-PAM-1.1.6/modules/pam_selinux/pam_selinux.c.manualctx Linux-PAM-1.1.6/modules/pam_selinux/pam_selinux.c
858c76d
--- Linux-PAM-1.1.6/modules/pam_selinux/pam_selinux.c.manualctx	2012-09-03 15:23:21.000000000 +0200
858c76d
+++ Linux-PAM-1.1.6/modules/pam_selinux/pam_selinux.c	2012-11-30 21:03:40.000000000 +0100
858c76d
@@ -161,81 +161,6 @@ query_response (pam_handle_t *pamh, cons
858c76d
   return rc;
858c76d
 }
858c76d
 
858c76d
-static security_context_t
858c76d
-manual_context (pam_handle_t *pamh, const char *user, int debug)
858c76d
-{
858c76d
-  security_context_t newcon=NULL;
858c76d
-  context_t new_context;
858c76d
-  int mls_enabled = is_selinux_mls_enabled();
858c76d
-  char *type=NULL;
858c76d
-  char *response=NULL;
858c76d
-
858c76d
-  while (1) {
858c76d
-    if (query_response(pamh,
858c76d
-		   _("Would you like to enter a security context? [N] "), NULL,
858c76d
-		   &response, debug) != PAM_SUCCESS)
858c76d
-	return NULL;
858c76d
-
858c76d
-    if ((response[0] == 'y') || (response[0] == 'Y'))
858c76d
-      {
858c76d
-	if (mls_enabled)
858c76d
-	  new_context = context_new ("user:role:type:level");
858c76d
-	else
858c76d
-	  new_context = context_new ("user:role:type");
858c76d
-
858c76d
-	if (!new_context)
858c76d
-              goto fail_set;
858c76d
-
858c76d
-	if (context_user_set (new_context, user))
858c76d
-              goto fail_set;
858c76d
-
858c76d
-	_pam_drop(response);
858c76d
-	/* Allow the user to enter each field of the context individually */
858c76d
-	if (query_response(pamh, _("role:"), NULL, &response, debug) == PAM_SUCCESS &&
858c76d
-	    response[0] != '\0') {
858c76d
-	   if (context_role_set (new_context, response))
858c76d
-              goto fail_set;
858c76d
-	   if (get_default_type(response, &type))
858c76d
-              goto fail_set;
858c76d
-	   if (context_type_set (new_context, type))
858c76d
-              goto fail_set;
858c76d
-	   _pam_drop(type);
858c76d
-	}
858c76d
-	_pam_drop(response);
858c76d
-
858c76d
-	if (mls_enabled)
858c76d
-	  {
858c76d
-	    if (query_response(pamh, _("level:"), NULL, &response, debug) == PAM_SUCCESS &&
858c76d
-		response[0] != '\0') {
858c76d
-	      if (context_range_set (new_context, response))
858c76d
-		goto fail_set;
858c76d
-	    }
858c76d
-	    _pam_drop(response);
858c76d
-	  }
858c76d
-
858c76d
-	/* Get the string value of the context and see if it is valid. */
858c76d
-	if (!security_check_context(context_str(new_context))) {
858c76d
-	  newcon = strdup(context_str(new_context));
858c76d
-	  context_free (new_context);
858c76d
-	  return newcon;
858c76d
-	}
858c76d
-	else
858c76d
-	  send_text(pamh,_("Not a valid security context"),debug);
858c76d
-
858c76d
-        context_free (new_context);
858c76d
-      }
858c76d
-    else {
858c76d
-      _pam_drop(response);
858c76d
-      return NULL;
858c76d
-    }
858c76d
-  } /* end while */
858c76d
- fail_set:
858c76d
-  free(type);
858c76d
-  _pam_drop(response);
858c76d
-  context_free (new_context);
858c76d
-  return NULL;
858c76d
-}
858c76d
-
858c76d
 static int mls_range_allowed(pam_handle_t *pamh, security_context_t src, security_context_t dst, int debug)
858c76d
 {
858c76d
   struct av_decision avd;
858c76d
@@ -606,11 +531,6 @@ compute_exec_context(pam_handle_t *pamh,
858c76d
       data->exec_context = context_from_env(pamh, data->default_user_context,
858c76d
 					    env_params, use_current_range,
858c76d
 					    debug);
858c76d
-  } else {
858c76d
-    if (seuser) {
858c76d
-      data->exec_context = manual_context(pamh, seuser, debug);
858c76d
-      free(seuser);
858c76d
-    }
858c76d
   }
858c76d
 
858c76d
   if (!data->exec_context) {