X-Git-Url: http://git.onelab.eu/?p=lxc-userspace.git;a=blobdiff_plain;f=lxcsu;fp=lxcsu;h=4c4bc04ec6873a31e78443724c985ed01e9d43f6;hp=85b1ff72826c38d005845c67ef5895a530c424fb;hb=c2b9fa70310e6fd5e55f70d69868254ee1881c9c;hpb=df40f9604c78752536de9314f1f03744531d7915 diff --git a/lxcsu b/lxcsu index 85b1ff7..4c4bc04 100755 --- a/lxcsu +++ b/lxcsu @@ -244,11 +244,13 @@ def main (): # we still want to drop capabilities, but don't want to switch UIDs exec_args = [arch,'/bin/sh','--login',]+args.command_to_run else: + # let's keep this check even though we don't use the uid + # as a way of checking the existence of the slice account uid = getuid (slice_name) if not uid: print "lxcsu could not spot %s in /etc/passwd - exiting"%slice_name exit(1) - exec_args = [arch,'/bin/sh','--uid=%s'%uid,'--login',]+args.command_to_run + exec_args = [arch,'/usr/bin/sudo','-u',slice_name,'/bin/sh','--login',]+args.command_to_run # once we can drop f12, it would be nicer to instead go for # exec_args = [arch,'/usr/sbin/capsh',cap_arg,'--user=%s'%slice_name,'--login',]+args.command_to_run else: