Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ftpd chroot and pwd: (5 Items)
   
ftpd chroot and pwd  
Hi,

I've got FTPD setup on a target to chroot to a directory called /ftp when a user logs in.

Everything works in terms of accessing files, for example when I log into the server using another qnx ftp client, and 
try to download a file that is in a subdirectory of /ftp, it works.  i.e.:

Say the following is valid...

/ftp/cdrom/some_file.txt

From the ftp client I can use:
get /cdrom/som_file.txt

and it downloads the file.

HOWEVER.  If I use the pwd command, I get
"/ftp"  Instead of "/"

This confuses the heck out of graphical ftp clients.

How do I get ftpd, when it chroots to /ftp, to return "/" when using the pwd command?

The entry in the passwd file for the user is follows:
zod10HWL:x:100:90:DlmuFTPLogin:/ftp/./:/proc/boot/esh

The entry in the ftpchroot file is as follows:
zod10HWL /ftp/./

What am I missing?

Thanks
Kevin
RE: ftpd chroot and pwd  
IIRC this is fixed in 6.4.1.
 
Regards,
 
-seanb

________________________________

From: Kevin Stallard [mailto:community-noreply@qnx.com]
Sent: Fri 7/10/2009 2:16 PM
To: ostech-core_os
Subject: ftpd chroot and pwd



Hi,

I've got FTPD setup on a target to chroot to a directory called /ftp when a user logs in.

Everything works in terms of accessing files, for example when I log into the server using another qnx ftp client, and 
try to download a file that is in a subdirectory of /ftp, it works.  i.e.:

Say the following is valid...

/ftp/cdrom/some_file.txt

From the ftp client I can use:
get /cdrom/som_file.txt

and it downloads the file.

HOWEVER.  If I use the pwd command, I get
"/ftp"  Instead of "/"

This confuses the heck out of graphical ftp clients.

How do I get ftpd, when it chroots to /ftp, to return "/" when using the pwd command?

The entry in the passwd file for the user is follows:
zod10HWL:x:100:90:DlmuFTPLogin:/ftp/./:/proc/boot/esh

The entry in the ftpchroot file is as follows:
zod10HWL /ftp/./

What am I missing?

Thanks
Kevin


_______________________________________________
OSTech
http://community.qnx.com/sf/go/post33569



Attachment: Text winmail.dat 3.98 KB
Re: RE: ftpd chroot and pwd  
Sean,

Thanks, but I can't use QNX 6.4.1, I have to use 6.3.2.  Do you think it possible to use the code base for the ftpd 
server 6.4.1 on 6.3.2?

Thanks
Kevin
Re: RE: ftpd chroot and pwd  
FYI Even after a lot of effort we never did get chroot'ed FTP working properly using the QNX-supplied ftpd under 6.3.2

We ended-up porting Pure-FTPd since it provides a "virtual" chroot mode where it emulates a chroot-ed environment for 
the benefit of the client. It also has some other neat features like user-based disk quotas and bandwidth limits.

Rob Rutherford
Ruzz TV

RE: RE: ftpd chroot and pwd  
Hey Rob,

Yeah...it doesn't resolve the path correctly.  I actually modified the FTPD
code so that it would work correctly.  I'm good now...

Kevin


-----Original Message-----
From: Robert Rutherford [mailto:community-noreply@qnx.com] 
Sent: 2009-07-12 22:14
To: ostech-core_os
Subject: Re: RE: ftpd chroot and pwd

FYI Even after a lot of effort we never did get chroot'ed FTP working
properly using the QNX-supplied ftpd under 6.3.2

We ended-up porting Pure-FTPd since it provides a "virtual" chroot mode
where it emulates a chroot-ed environment for the benefit of the client. It
also has some other neat features like user-based disk quotas and bandwidth
limits.

Rob Rutherford
Ruzz TV



_______________________________________________
OSTech
http://community.qnx.com/sf/go/post33605