X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=lib%2Fbup%2Fclient.py;h=a5762ae4b652c4f552beae6d92ee593a09fa8941;hb=b7a524ccb662c9ed3ebd786da0f45f459929ef45;hp=7b3e7c35700dbc914f5301c35e872f42e43082a1;hpb=dbc9e3ec44b765860e7769d2084c609dfa246230;p=bup.git diff --git a/lib/bup/client.py b/lib/bup/client.py index 7b3e7c3..a5762ae 100644 --- a/lib/bup/client.py +++ b/lib/bup/client.py @@ -39,12 +39,16 @@ class Client: """ % escapedir argv = ['ssh', host, '--', cmd.strip()] #log('argv is: %r\n' % argv) + def setup(): + if fixenv: + fixenv() + os.setsid() (self.host, self.dir) = (host, dir) self.cachedir = git.repo('index-cache/%s' % re.sub(r'[^@\w]', '_', "%s:%s" % (host, dir))) try: - self.p = p = Popen(argv, stdin=PIPE, stdout=PIPE, preexec_fn=fixenv) + self.p = p = Popen(argv, stdin=PIPE, stdout=PIPE, preexec_fn=setup) except OSError, e: raise ClientError, 'exec %r: %s' % (argv[0], e), sys.exc_info()[2] self.conn = conn = Conn(p.stdout, p.stdin)