Research Menu

.
Skip Search Box

SELinux Mailing List

Re: launching apps at level (MLS) and polyinstantiation

From: Stephen Smalley <sds_at_tycho.nsa.gov>
Date: Thu, 03 May 2007 09:49:08 -0400


On Thu, 2007-05-03 at 08:11 -0500, Xavier Toth wrote:

--- policycoreutils-1.33.12/newrole/newrole.c	2007-05-03 08:03:44.000000000 -0500
+++ policycoreutils-1.33.12.new/newrole/newrole.c	2007-05-03 08:03:27.000000000 -0500
@@ -1025,7 +1134,25 @@  

         printf(_("Authenticating %s.\n"), pw.pw_name);  #ifdef USE_PAM

-	pam_status = pam_start(SERVICE_NAME, pw.pw_name, &pam_conversation,
+	/*

+ Are we being asked to execute a process in a new context?
+ */ + if (app_service_names != NULL && optind < argc) {
+ /*
+ See if there is a pam configuration specific to the executable.
+ */
+ char *cmd = strtok(argv[optind+1], " \t");

Actually, here you don't want to use strtok() since it mutates the argument (inserting NUL separator), which will cause any subsequent arguments after the command to be effectively lost.

Please update the man page as well to show the proper way to execute commands via newrole.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
Received on Thu 3 May 2007 - 09:49:10 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service