Re: Chrooted sftp-server and /dev/null

2006-06-21 Thread Joshua Sandbrook
Can anyone help here? Ive played wih fcntl's FD_CLOEXEC and what not.. it was set to 0, and yeah... If someone can help solve this mystery then there is one less file required in the chroot environment. A cleaner scponly shell :) On Wednesday 21 June 2006 09:41, Joshua Sandbrook wrote: > Gidday

Re: Chrooted sftp-server and /dev/null

2006-06-22 Thread Joachim Schipper
On Wed, Jun 21, 2006 at 09:41:42AM +1200, Joshua Sandbrook wrote: > Gidday > > Im writing a shell at the moment that chroots into a users home dir and then > runs only the sftp-server program ( which is in the uses home dir ). > > Anyway, it wont work unless /dev/null is present in the chroot...

Re: Chrooted sftp-server and /dev/null

2006-06-22 Thread Joshua Sandbrook
Thanks for the reply... It is sftp-server that tries to open /dev/null. As I dont want to modify sftp-server or anything like that, I think im going to just populate each chroot environment with a /dev/null. However, as I dont want /home to have any devices on it, is there a way to have some s

Re: Chrooted sftp-server and /dev/null

2006-06-23 Thread Joachim Schipper
On Fri, Jun 23, 2006 at 12:00:17PM +1200, Joshua Sandbrook wrote: > On Thursday 22 June 2006 22:26, Joachim Schipper wrote: > > A quick grep through /usr/src/usr.bin/ssh suggests that ssh (and, most > > likely, sftp) interacts with /dev/null quite a bit. It might be possible > > to change the code

Re: Chrooted sftp-server and /dev/null

2006-07-07 Thread Joshua Sandbrook
On Friday 23 June 2006 22:24, Joachim Schipper wrote: > > You could set up a named pipe (mkfifo(1)), and have a process > continually drain it (cat /home/john/dev/null >/dev/null &); however, > while this would work for the most likely use (writing to /dev/null), it > wouldn't allow for reading. >

[Fwd: Re: Chrooted sftp-server and /dev/null]

2006-06-23 Thread Richard Wilson
Joshua Sandbrook wrote: Gidday Im writing a shell at the moment that chroots into a users home dir and then runs only the sftp-server program ( which is in the uses home dir ). Anyway, it wont work unless /dev/null is present in the chroot... I am using execve to run sftp-server, and I am

Re: [Fwd: Re: Chrooted sftp-server and /dev/null]

2006-06-23 Thread Bastiaan Jacques
On Friday 23 June 2006 16:42, Richard Wilson wrote: > The only small fly in the ointment, is that according to > http://pizzashack.org/rssh/platforms.shtml it doesn't work on *BSD, > as it requires the missing wordexp() function. However, the page > dates back to 2003, and I haven't the skills to c