On Wed, 2011-08-24 at 02:14 +0000, Osborn Chan wrote: > Hi Michal, > > Actually, I was running the example under root. (sudo) > I was able to list/put/get file for my non-root user after login. > However, listing (ls) doesn't work on top level directory (e.g. /home/ychan), > but it works fine anywhere else. > > The following shows the issue. > > ychan@ubuntu:~/sandbox$ sftp -P 2200 localhost > ychan@localhost's password: > Connected to localhost. > sftp> ls > Couldn't read directory: Permission denied > > I guess there may be some issue related to my machine, and I may check it > later.
Your home folder most probably contains some special files/pipes for which Twisted can not read the attributes. When listing a folder, twisted FTP and SFTP servers are querying for file attributes and they will return permission denied if one of the file attributes can not be retrieved. I am not sure if this is a bug or a feature. Cheers, Adi > Osborn > > From: Michal Mach <[email protected]<mailto:[email protected]>> > Reply-To: Twisted general discussion > <[email protected]<mailto:[email protected]>> > Date: Wed, 24 Aug 2011 03:14:25 +0200 > To: Twisted general discussion > <[email protected]<mailto:[email protected]>> > Subject: Re: [Twisted-Python] SFTP Server sample > > e server needs to execute all subsequent > commands as this user (e.g. when you upload a file this file should be owned > by the user "foo") > and therefore temporary changing to user "foo" > > _______________________________________________ > Twisted-Python mailing list > [email protected] > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python _______________________________________________ Twisted-Python mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
