Skip to contentSkip to conversation

changing open mode of file handle

DISCUSSION Russell Coker 1 participant 1 message Aug 12, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

Currently I have cron jobs that create a temporary file in read-only mode, delete the file, then use the file descriptor as standard input for a process that runs "mail root".

The problem is that I don't want to give the mail program write access to the temporary file type, so I currently have to dontaudit the writes.

But I don't really like this, I'd rather just change the mode of the file handle to be read-only.

How can I change the open mode of a file handle for a deleted file to be read-only instead of read-write? I'm sure it's possible but can't work out how.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.