Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 1997 04:05:13 +0100
From:      gjm11@dpmms.cam.ac.uk
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/3572: virtualpaper-1.4 port attempts to call mknod()
Message-ID:  <E0wQ2TB-0001rj-00@g.pet.cam.ac.uk>
Resent-Message-ID: <199705100310.UAA13524@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3572
>Category:       ports
>Synopsis:       virtualpaper-1.4 port attempts to call mknod()
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May  9 20:10:00 PDT 1997
>Last-Modified:
>Originator:     Gareth McCaughan
>Organization:
all too little
>Release:        FreeBSD 2.2-RELEASE i386
>Environment:

	Bog-standard FreeBSD 2.2 system

>Description:

	The virtualpaper-1.4 port contains the following, in
	buildlectern/src/POSIX/OSUtilsPosix.m3 :

	IF Unix.mknod(M3toC.TtoS(p), Mode, 0) < 0 THEN
	  OSErrorPosix.Raise();
	END;

	Unfortunately, only root is supposed to call mknod(),
	so this is not a good idea. Calling mkfifo() instead
	(this is in a procedure called CreateFifo) seems to
	work.

>How-To-Repeat:

	Install virtualpaper-1.4 and type "BuildLectern foo.ps zog.lect".

>Fix:
	
	Declare an <*EXTERNAL*> procedure called mkfifo with the
	right type, and call that instead. The following lines of
	code do this, but I know just enough Modula-3 to be
	certain that they don't belong in the place where, in
	search of a quick fix, I put them. :-)


	in an interface file somewhere, insert:

	FROM Ctypes IMPORT char_star, int;
	FROM Utypes IMPORT mode_t;
	<*EXTERNAL*> PROCEDURE mkfifo(p: char_star; m: mode_t): int;


	in OSUtilsPosix.m3: replace the definition of CreateFifo with:

	PROCEDURE CreateFifo(p: TEXT) RAISES {OSError.E} =
	  CONST Mode = Unix.MROWNER + Unix.MWOWNER;
	  BEGIN
	    <* ASSERT pFifo=NIL *>
	    IF mkfifo(M3toC.TtoS(p), Mode) < 0 THEN
	      OSErrorPosix.Raise();
	    END;
	    pFifo := p;
	  END CreateFifo;
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0wQ2TB-0001rj-00>