[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Broken pipe with loginfo in a chroot jail

From: Geoff Beier
Subject: Re: Broken pipe with loginfo in a chroot jail
Date: Fri, 7 Nov 2003 10:28:35 -0400

On Fri, 7 Nov 2003 10:05:10 +0100, Maarten de Boer wrote
> > Sorry if this is a silly question, but have you put a shell in your jail?
> >
> No, I haven't, but why would I? What I execute from loginfo is a standalone
> application, it should not need a shell at all.

Sorry... I thought the link made it clear enough. When you run cvs with the -t
flag, you see a line like the following when loginfo is processed:
-> run_popen( yourLogProgram )

If you look at the cvs sources, you can see on line 396 of run.c that, as its
name would imply, run_popen() uses the popen() call to invoke your "standalone

return (popen (cmd, mode));

Even though yourLogProgram is "standalone", a quick trip to popen(3) reveals:
     The popen() function ``opens'' a process by creating a pipe, forking, and
     invoking the shell.  Since a pipe is by definition unidirectional, the
     type argument may specify only reading or writing, not both; the result-
     ing stream is correspondingly read-only or write-only.

Notice that the "invoking the shell" part is not optional. Therefore, to use
popen() in a chroot jail (which is required for loginfo) you require a shell.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]