Commit 9c81f567 authored by Antoine Catton's avatar Antoine Catton

Add the ability to run a command line in shellinabox

parent 83fbc4ea
...@@ -28,6 +28,7 @@ from getpass import getpass ...@@ -28,6 +28,7 @@ from getpass import getpass
import pwd import pwd
import grp import grp
import os import os
import shlex
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
...@@ -38,7 +39,9 @@ def login_shell(args): ...@@ -38,7 +39,9 @@ def login_shell(args):
if entered_password != password: if entered_password != password:
return 1 return 1
else: else:
os.execl(args['shell'], args['shell']) commandline = shlex.split(args['shell'])
path = commandline[0]
os.execv(path, commandline)
def shellinabox(args): def shellinabox(args):
certificate_dir = args['certificate_dir'] certificate_dir = args['certificate_dir']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment