[net.unix-wizards] HP Fortran bug

phil@uiucme.UUCP (05/08/84)

#N:uiucme:3100003:000:577
uiucme!phil    May  8 11:13:00 1984


I have an HP9000 (please don't laugh).  And I'm not sure what's happening
in the following -

Scenario:
	My umask is 022.
	I become super-user.
	I type in a fortran compile.
		fc mine.f
	When the compile is done, I notice that /dev/null has gone from
	permission 0666 to 0644.  This has the side-effect of preventing
	others from using the fortran or pascal compilers.

Why does the permission change?  How can I prevent it?  I called Hewlett-
Packard and they said that I should avoid this situation...

Philip Gross
uiucdcs!uiucuxc!uiucme!phil
U of Illinois, Dept of M&IE

gwyn@brl-vgr.ARPA (Doug Gwyn ) (05/11/84)

Re: HP9000 changes /dev/null mode

HP said you should avoid this situation?  Hee, hee!  Call them back and
tell them that the only way you can avoid the situation is to change
your computer system vendor!

ajs@hpfcla.UUCP (05/28/84)

This is posted on behalf of the Hewlett Packard Computer  Languages Lab.
It is in response to an earlier  complaint  here about the HP9000 Series
500  FORTRAN  compiler.  Note that I  previously  posted a more  general
description of the bug in fopen(3s), USG System III version.

Alan Silverstein, Hewlett-Packard Fort Collins Systems Division, Colorado
{ihnp4 | hplabs}!hpfcla!ajs, 303-226-3800 x3053, N 40 31'31" W 105 00'43"

	Problem:   If a super-user with umask of 022 runs a FORTRAN 
		   compile (on the Series 500) such as "fc myfile.f", 
		   the root removes group and others write permission on 
		   /dev/null.  This has the effect of preventing non-
		   super-users from running the compiler.

	Reason:    An fopen("/dev/null","w+") call causes umask to be
		   applied to /dev/null's file permissions.  This is 
		   incorrect because /dev/null already exists.  Both
		   the FORTRAN and the Pascal compilers may make calls 
		   of this type to fopen.

	Solution:  Umask will not be applied to a file that already 
		   exists by an fopen "w+" (create for update) call
		   under HP-UX version 4.0.  Until then, a super-user
		   with a non-zero umask will usually have to reset the
		   file permissions ("chmod +rw /dev/null") after a 
		   FORTRAN or a Pascal compile.
   
                   From: CLL Technical Support Group