139
139
fixup_environ(req, script_path)
141
141
# usage: tramp uid jail_dir working_dir script_path
142
pid = subprocess.Popen(
143
[trampoline, str(uid), req.config['paths']['jails']['mounts'],
142
cmd_line = [trampoline, str(uid), req.config['paths']['jails']['mounts'],
144
143
req.config['paths']['jails']['src'],
145
144
req.config['paths']['jails']['template'],
146
jail_dir, working_dir, interpreter, script_path],
145
jail_dir, working_dir, interpreter, script_path]
146
# Popen doesn't like unicode strings. It hateses them.
147
cmd_line = [(s.encode('utf-8') if isinstance(s, unicode) else s)
149
pid = subprocess.Popen(cmd_line,
147
150
stdin=f, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
432
435
tramp_dir = os.path.split(tramp)[0]
434
437
# Fire up trampoline. Vroom, vroom.
435
proc = subprocess.Popen(
436
[tramp, str(user.unixid), config['paths']['jails']['mounts'],
438
cmd_line = [tramp, str(user.unixid), config['paths']['jails']['mounts'],
437
439
config['paths']['jails']['src'],
438
440
config['paths']['jails']['template'],
439
jail_dir, working_dir, binary] + args,
441
jail_dir, working_dir, binary] + args
442
# Popen doesn't like unicode strings. It hateses them.
443
cmd_line = [(s.encode('utf-8') if isinstance(s, unicode) else s)
445
proc = subprocess.Popen(cmd_line,
440
446
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
441
stderr=subprocess.PIPE, cwd=tramp_dir, close_fds=True)
447
stderr=subprocess.PIPE, cwd=tramp_dir, close_fds=True,
448
env={'HOME': os.path.join('/home', user.login),
449
'PATH': os.environ['PATH'],
451
'LOGNAME': user.login})
443
453
(stdout, stderr) = proc.communicate()
444
454
exitcode = proc.returncode