Date: Fri, 28 Aug 1998 21:14:04 +0200 From: Neil Blakey-Milner <nbm@rucus.ru.ac.za> To: Luigi Rizzo <luigi@labinfo.iet.unipi.it>, Craig Anderson <chanders@timing.com> Cc: freebsd-hackers@FreeBSD.ORG, brhall@timing.com Subject: Re: Help with passing fd on FreeBSD Message-ID: <19980828211404.A18096@rucus.ru.ac.za> In-Reply-To: <199808281628.SAA05374@labinfo.iet.unipi.it>; from Luigi Rizzo on Fri, Aug 28, 1998 at 06:28:36PM %2B0200 References: <199808281722.LAA10931@count.timing.com> <199808281628.SAA05374@labinfo.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri 1998-08-28 (18:28), Luigi Rizzo wrote: > > > Can someone give me pointers on passing open file descriptors on FreeBSD? > > still, this looks to me one of the most obscure interfaces in the OS. > Does any real application use that ? In the Stevens book, he says: "1. A process forks a child process and the child then execs another process to open a particular file. The execed process does whatever it has to do to open the file and then passes the open file descriptor back to the original process, since the execed process is a child process of the orifinal process, there s no way for it to pass an open file back to the parent, other than passing an open file as we describe in this section." "2. A connection server can be incoked to handle all network connections. Instead of using fork and exec as described above, this secario requires any client process to connect with a well-known server. The client writes its request to the server using this connection (a Unix domain stream socket, for example), and the server responds with an open file descriptor or an error indication." I think this could be used to point children towards files to read for further input, or something like that. I'm not terribly sure, but the children may then need not be run as root to read files not owned by their process id (one assumes the child uses set[gu]id). Of course, I'm sure there are better ways of doing these things. I'm not sure how apache logs to files owned by other users (apache set[gu]id's its children), this may be the way. Neil -- Neil Blakey-Milner nbm@rucus.ru.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980828211404.A18096>