[openssl-users] Session params output fails via cron

Jordan Brown openssl at jordan.maileater.net
Fri Jan 4 18:16:03 UTC 2019


On 1/4/2019 9:15 AM, Salz, Rich via openssl-users wrote:
>     Jakob - you’re a star! Thanks so much, your suggestion works. So I added
>     </dev/null to now give:
> ...
>     I’m wondering if this would be something worthy of attention in openssl?
>    
> Maybe open an issue to catch this.  Seems like the apps could check and redirect to /dev/null if the FD isn't valid.


All kinds of Bad Stuff will happen if file descriptors {0,1,2} aren't
set up right.  Start with, say, an application opening a database,
getting fd  2 because that happens to be the first available, and then
for some reason writing an error message to stderr.

I'd be shocked if cron starts an application without *something*
reasonable on {0,1,2}.  I'd consider it to be a very serious bug in
cron.  (I can't speak to anything else, but Solaris cron has 0 on
/dev/null and 1 and 2 leading to a temporary file that gets mailed to
the user if non-empty.)

Whether an application should try to cope with such a broken
environment... shrug.  Few if any do.

If you want to, what you want is something like:

	int fd;
	do {
		fd = open("/dev/null", O_RDWR);
	} while (fd < 3);
	close(fd);

(That's strictly not quite right, since it leaves 0 open writable and 1
and 2 open readable, but that's pretty harmless.)

-- 
Jordan Brown, Oracle Solaris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20190104/37679a7c/attachment.html>


More information about the openssl-users mailing list