def __init__(self, fsroot): self._fs_root = fsroot self.uploadfilesystem = UploadFileSystem(tempfile.mkdtemp()) self._current_upload = self.uploadfilesystem.rootpath os.chmod(self._current_upload, 0770) self._log = logging.getLogger("poppy-sftp") self.hook = Hooks(self._fs_root, self._log, "ubuntu", perms='g+rws', prefix='-ftp') self.hook.new_client_hook(self._current_upload, 0, 0) self.hook.auth_verify_hook(self._current_upload, None, None) super(PoppyAnonymousShell, self).__init__(filepath.FilePath(self._current_upload))
def __init__(self, avatar, fsroot): provideHandler(self.connectionClosed) self._avatar = avatar self._fs_root = fsroot self.uploadfilesystem = UploadFileSystem(tempfile.mkdtemp()) self._current_upload = self.uploadfilesystem.rootpath os.chmod(self._current_upload, 0770) self._log = logging.getLogger("poppy-sftp") self.hook = Hooks(self._fs_root, self._log, "ubuntu", perms='g+rws', prefix='-sftp') self.hook.new_client_hook(self._current_upload, 0, 0) self.hook.auth_verify_hook(self._current_upload, None, None)