From 3017b50a07beb5107871e15221c65cf8e93c56e9 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 10 Oct 2026 09:57:57 -0500 Subject: [PATCH] Preserve native runner shell arguments through systemd Disable systemd environment expansion so the shell receives its identity marker variables and positional arguments unchanged. Co-Authored-By: Paperclip --- server/src/modules/computers/adapters/boat.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/modules/computers/adapters/boat.ts b/server/src/modules/computers/adapters/boat.ts index 433c4841161..c6a34faaf20 100644 --- a/server/src/modules/computers/adapters/boat.ts +++ b/server/src/modules/computers/adapters/boat.ts @@ -231,7 +231,8 @@ with open(os.path.join(root,'lock'),'a') as lock: active=subprocess.run(['systemctl','--user','is-active',unit],capture_output=True,text=True).stdout.strip()=='active' if active and old['nonce']!=claim['nonce']:print(json.dumps({'error':'conflict'}));sys.exit(0) with open(marker,'w') as f:json.dump(claim,f) - payload=p['input'];args=['systemd-run','--user','--unit='+unit,'--slice='+slice,'--collect','--property=KillMode=control-group','--working-directory='+payload.get('cwd','/home/user')] + # Shell launch scripts own expansion of their positional arguments and identity markers. + payload=p['input'];args=['systemd-run','--user','--expand-environment=no','--unit='+unit,'--slice='+slice,'--collect','--property=KillMode=control-group','--working-directory='+payload.get('cwd','/home/user')] for key,value in payload.get('env',{}).items():args.append('--setenv='+key+'='+value) state=subprocess.run(['systemctl','--user','is-active',unit],capture_output=True,text=True).stdout.strip() if state!='active':