All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: newrole O_NONBLOCK change (Was:  Re: policycoreutils patch)
Date: Tue, 20 Feb 2007 12:42:47 -0500	[thread overview]
Message-ID: <45DB3317.5010806@redhat.com> (raw)
In-Reply-To: <1171988261.14363.106.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Tue, 2007-02-20 at 09:50 -0500, Daniel J Walsh wrote:
>   
>> newrole hangs on a attached terminal device.  Nonblocking allows it to 
>> proceed.
>>     
>
> Won't this have side effects on programs run from the newrole'd shell?
> Should newrole open them with O_NONBLOCK and then clear it via fcntl
> before exec'ing the child shell
>   
Linda Knippers submitted this patch for bugzilla.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228102


I am not sure if setting it back to non blocking would still cause the hang.
>   
>> plain text document attachment (diff)
>> diff --exclude-from=exclude --exclude=sepolgen-1.0.0 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/newrole/newrole.c policycoreutils-2.0.1/newrole/newrole.c
>> --- nsapolicycoreutils/newrole/newrole.c	2007-01-24 10:03:59.000000000 -0500
>> +++ policycoreutils-2.0.1/newrole/newrole.c	2007-02-15 15:16:09.000000000 -0500
>> @@ -640,7 +640,7 @@
>>  	}
>>  
>>  	/* Re-open TTY descriptor */
>> -	fd = open(ttyn, O_RDWR);
>> +	fd = open(ttyn, O_RDWR|O_NONBLOCK);
>>  	if (fd < 0) {
>>  		fprintf(stderr, _("Error!  Could not open %s.\n"), ttyn);
>>  		return fd;
>> @@ -1131,13 +1131,13 @@
>>  		fprintf(stderr, _("Could not close descriptors.\n"));
>>  		goto err_close_pam;
>>  	}
>> -	fd = open(ttyn, O_RDONLY);
>> +	fd = open(ttyn, O_RDONLY|O_NONBLOCK);
>>  	if (fd != 0)
>>  		goto err_close_pam;
>> -	fd = open(ttyn, O_RDWR);
>> +	fd = open(ttyn, O_RDWR|O_NONBLOCK);
>>  	if (fd != 1)
>>  		goto err_close_pam;
>> -	fd = open(ttyn, O_RDWR);
>> +	fd = open(ttyn, O_RDWR|O_NONBLOCK);
>>  	if (fd != 2)
>>  		goto err_close_pam;
>>  
>>     
>
>   


--
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.

  reply	other threads:[~2007-02-20 17:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45DB0AB8.3070803@redhat.com>
2007-02-20 16:17 ` newrole O_NONBLOCK change (Was: Re: policycoreutils patch) Stephen Smalley
2007-02-20 17:42   ` Daniel J Walsh [this message]
2007-02-20 17:58   ` Linda Knippers
2007-02-20 16:22 ` chcat changes " Stephen Smalley
2007-02-20 17:56   ` Daniel J Walsh
2007-02-21 16:37     ` Karl MacMillan
2007-02-21 17:22 ` policycoreutils patch Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45DB3317.5010806@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.