mknod for BSD 4.3

Jamie Mason jmason at gpu.utcs.utoronto.ca
Mon Apr 22 17:52:07 AEST 1991


In article <9104220651.AA13912 at csufres.CSUFresno.EDU> quang at CSUFRES.CSUFRESNO.EDU (Quang Ngo) writes:
>The man page section 2 says that only super-user can access mknod().  Is 
>there any other funtion that does what mknod() does?  Our system doesn't
>have fifo().  /etc/mknod is not accessable by users. Too bad, I can't
>even do a system("/etc/mknod ....") call.

	I would be very surprised if the manual is correct, then.  On 
systems with named pipes, mknod() is not usually a root-only call.  
Rather, you can call mknod(), but mknod() will return EACESS if you try
to make a device with it.  This is from the MKNOD(2) man page of 
SunOS 4.1.1:

     mknod() may be invoked only by the super-user for file types
     other than FIFO special.


	SunOS is of the BSD flavour -- so I would expect that 4.3BSD
would act in basically the same way.  Why not try an mknod() call and
see if you get your named pipe?

	As for /usr/etc/mknod, that is just local policy, isn't it?  Even
if it *were* acessible to all users, I doubt it would be suid root,
therefore whether you use that, or a program of your own creation, is
irrelevant.  mknod(8) (the program) is just a stupid thing wrapper around
mknod(2) (the system call).

Jamie  ...  Segmentation fault (core dumped)
Written On  Monday, April 22, 1991  at  03:50:16am EDT



More information about the Comp.unix.questions mailing list