From: "R. Steven Rainwater" <srainwater@ncc.com>
To: SELinux@tycho.nsa.gov
Subject: Re: dumb newbie questions
Date: Mon, 20 Jun 2005 10:21:19 -0500 [thread overview]
Message-ID: <1119280879.30000.48.camel@rodan.ncc.com> (raw)
In-Reply-To: <a1025d74050620061231e65d7d@mail.gmail.com>
Thanks for your comments, Trevor. I think you've helped me stumble into
the answer (or at least into the right questions).
On Mon, 2005-06-20 at 08:12, Trevor Vaughan wrote:
> Basically, it looks like you have a PERL script running
> from within the Apache context (i.e. run by Apache) and
> the script is attempting to write to a character device
Actually, the script is one that I run from a terminal to manually
perform certain types of maintenance on the website. It's designed to be
called remotely through Apache or run from the command line, in which
case it spits out status messages to stdout. That's why I wrote the
one-liner "hello world" test script to track down the problem. Shouldn't
the root user be able to run a script that writes to stdout?
> 1. Run the script from your home directory as a
> normal user. (This should work).
Wow, amazingly, it did. I moved the script to my home directory changed
the owner to me, ran it, and it printed "hello world" with no errors. I
changed the owner back to root and ran it from my home directory - it
still works. Looks like the owner setting doesn't make any difference. I
moved the script back to within the /var/www area where it normally
lives and I could no longer run it as myself or as root.
This is totally bizarre - why would the directory location affect it? Is
this normal or a bug in my setup? Is there a way to tell selinux that a
user (or root) should be able to run a Perl script that uses stdout
regardless of it's physical location? A rule like that might fix me up.
Failing that, is there an easy way to get a list of directories where
selinux won't allow programs using stdout to run?
Not to complain but if selinux breaks (fixes?) something as universal as
the ability of a program to use stdout, there should be a big red
warning label in the docs, saying "Look out! Programs that use stdout
will not work unless you put them in certain directories!" But that's
just me...
> 2. Write a PERL script, to be run from within Apache,
> that writes a file that is inside the web directory
Yes, this was already working in most cases. The above discovery looks
to be the source of my problems. If I can't figure out how to fix it, I
could move copies of the non-working scripts to a directory where
they'll run. Or maybe use symlinks if selinux allows it. One copy in the
/var/www tree to be run by Apache and one copy somewhere else to be run
locally when needed. Yuck.
> Also, are you running in strict or targeted mode?
My /etc/selinux/config file says:
SELINUX=enforcing
SELINUX=targeted
Just for kicks I tried setting it to SELINUX=disabled and rebooted.
There was no discernable difference in speed. Valdis indicated the error
messages should die down after a few days, so maybe permissive is the
way to go. I'll keep beating on it today and maybe I can get things
working with selinux. If not, I can use permissive as Plan B.
-Steve
--
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.
next prev parent reply other threads:[~2005-06-20 15:21 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-17 20:01 SELinux Integrated Logging Tool Brandon Pollet
2005-06-17 23:43 ` James Morris
2005-06-18 15:39 ` Steve G
2005-06-18 23:38 ` dumb newbie questions R. Steven Rainwater
2005-06-19 6:45 ` Ivan Gyurdiev
2005-06-19 16:40 ` Casey Schaufler
2005-06-19 19:51 ` Ivan Gyurdiev
2005-06-19 20:14 ` Casey Schaufler
2005-06-19 20:57 ` Ivan Gyurdiev
2005-06-19 21:31 ` Casey Schaufler
2005-06-19 22:10 ` Luke Kenneth Casson Leighton
2005-06-20 0:28 ` Casey Schaufler
2005-06-19 22:13 ` Luke Kenneth Casson Leighton
2005-06-20 0:16 ` Casey Schaufler
2005-06-20 19:21 ` Luke Kenneth Casson Leighton
2005-06-20 20:41 ` Casey Schaufler
2005-06-20 21:01 ` Valdis.Kletnieks
2005-06-20 21:36 ` Casey Schaufler
2005-06-22 9:48 ` Christopher Warner
2005-06-19 20:41 ` Ivan Gyurdiev
2005-06-20 3:34 ` R. Steven Rainwater
2005-06-20 4:45 ` Valdis.Kletnieks
2005-06-20 14:45 ` R. Steven Rainwater
2005-06-20 15:14 ` Ivan Gyurdiev
2005-06-20 15:29 ` R. Steven Rainwater
2005-06-20 15:44 ` Ivan Gyurdiev
2005-06-20 16:40 ` R. Steven Rainwater
2005-06-20 16:59 ` Ivan Gyurdiev
2005-06-20 17:35 ` Karl MacMillan
2005-06-20 18:06 ` R. Steven Rainwater
2005-06-20 18:18 ` Daniel J Walsh
2005-06-24 6:22 ` Russell Coker
2005-06-20 18:06 ` Daniel J Walsh
2005-06-20 18:57 ` Luke Kenneth Casson Leighton
2005-06-20 15:56 ` Stephen Smalley
2005-06-20 19:05 ` Luke Kenneth Casson Leighton
2005-06-20 16:28 ` Stephen Smalley
2005-06-20 18:49 ` Luke Kenneth Casson Leighton
2005-06-19 22:17 ` Luke Kenneth Casson Leighton
2005-06-20 4:11 ` Ivan Gyurdiev
2005-06-20 13:12 ` Trevor Vaughan
2005-06-20 15:21 ` R. Steven Rainwater [this message]
2005-06-20 15:40 ` Ivan Gyurdiev
2005-06-20 16:20 ` Stephen Smalley
2005-06-30 22:11 ` cgiemail and senmail policy R. Steven Rainwater
2005-07-03 14:21 ` Daniel J Walsh
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=1119280879.30000.48.camel@rodan.ncc.com \
--to=srainwater@ncc.com \
--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.