[Twisted-Python] twisted.conch.ssh.session.SSHSession.request_subsystem

Tzury Bar Yochay tzury.by at gmail.com
Mon Dec 22 15:48:01 EST 2008

I managed to hack this by patching the _absPath method as follows:

# put in my main file

def absPath(self, path):
    # users is my own object which manages the users in the system
    profile = users.get(self.avatar.username)
    if profile:
        home = self.avatar.getHomeDir()
        abspath = os.path.abspath(os.path.join(home, path))
        if abspath.startswith(profile.home_path):
            return abspath

SFTPServerForUnixConchUser._absPath = absPath

Not elegant, but this is good enough for me to move on.

More information about the Twisted-Python mailing list