No functional change.
We are going to use this in a moment.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
if oe.errno != os.errno.ENOENT: raise oe
return False
if oe.errno != os.errno.ENOENT: raise oe
return False
- def _sock_dir(d, target_euid):
+ def _sock_dir(d, target_euid, target_root):
run_dir = '/run/user/%d' % target_euid
if d._exists(run_dir):
return run_dir + '/fishdescriptor'
run_dir = '/run/user/%d' % target_euid
if d._exists(run_dir):
return run_dir + '/fishdescriptor'
def fish(d, fds):
# -> list of fds in our process
def fish(d, fds):
# -> list of fds in our process
+ target_root = '/proc/%d/root' % d.pid
+ if not d._exists(target_root):
+ target_root = ''
+
- sockdir = d._sock_dir(euid)
+ sockdir = d._sock_dir(euid, target_root)
d.mkdir(sockdir)
sockname = '%s/%s,%d' % (sockdir, os.uname().nodename, d.pid)
d.mkdir(sockdir)
sockname = '%s/%s,%d' % (sockdir, os.uname().nodename, d.pid)
- target_root = '/proc/%d/root' % d.pid
- if not d._exists(target_root):
- target_root = ''
-
our_sockname = target_root + sockname
s = None
our_sockname = target_root + sockname
s = None