2011/7/12 Petey <efr...@gmail.com>:
> --
> You received this message because you are subscribed to the "Python FTP
> server library" project group:
> http://code.google.com/p/pyftpdlib/
> To post to this group, send email to pyft...@googlegroups.com
> To unsubscribe from this group, send email to
> pyftpdlib-...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/pyftpdlib
If you are on Windows and want to share different folders then you
have to put them in the home directory.
Regards,
Giampaolo
2011/7/13 Petey <efr...@gmail.com>:
> I want to share files from more locations (folders or drives).
>
> Will there be a way around?
>
Would using Junction Points (the Windows equivalent of symlinks) solve
the OP's question?
http://en.wikipedia.org/wiki/NTFS_junction_point
Andrew
- resolving all paths via os.path.realpath (hence symlinks are
resolved to their effective destination)
http://code.google.com/p/pyftpdlib/source/browse/tags/release-0.6.0/pyftpdlib/ftpserver.py#1417
- checking whether the path escapes the user home directory, in which
case the server denies access to that path
http://code.google.com/p/pyftpdlib/source/browse/tags/release-0.6.0/pyftpdlib/ftpserver.py#1303
I think we can eventually add an option to disable this behavior so
that symlinks can be used but we gotta pay attention because there
have been security related issues in the past:
http://code.google.com/p/pyftpdlib/issues/detail?id=9
http://code.google.com/p/pyftpdlib/issues/detail?id=55
2011/7/13 Andrew Scheller <gc...@loowis.durge.org>:
If Junction Points are the exact equivalent of UNIX symlinks then the
answer is no, at least by using base AbstractedFS.
AbstractedFS class has the peculiarity of:
- resolving all paths via os.path.realpath (hence symlinks are
resolved to their effective destination)
http://code.google.com/p/pyftpdlib/source/browse/tags/release-0.6.0/pyftpdlib/ftpserver.py#1417
- checking whether the path escapes the user home directory, in which
case the server denies access to that path
http://code.google.com/p/pyftpdlib/source/browse/tags/release-0.6.0/pyftpdlib/ftpserver.py#1303
I think we can eventually add an option to disable this behavior so
that symlinks can be used but we gotta pay attention because there
have been security related issues in the past:
http://code.google.com/p/pyftpdlib/issues/detail?id=9
http://code.google.com/p/pyftpdlib/issues/detail?id=55
from pyftpdlib.ftpserver import FTPHandler, FTPServer,
DummyAuthorizer, AbstractedFS
class UnjailedAbstractedFS(AbstractedFS):
"""
Same as base AbstractedFS but the user can escape its
home directory and follow symlinks pointing outside
of it.
"""
def realpath(self, path):
return path
def validpath(self, path):
return True
def main():
authorizer = DummyAuthorizer()
authorizer.add_user('user', '12345', '.', perm='elradfmw')
authorizer.add_anonymous('.')
handler = FTPHandler
handler.authorizer = authorizer
handler.abstracted_fs = UnjailedAbstractedFS
ftpd = FTPServer(('', 21), handler)
ftpd.serve_forever()
if __name__ == '__main__':
main()
...except hardlinks only work for files, and the OP explicitly asked
for multiple directories ;)
Andrew