You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/logshell/cvmshell

27 lines
488 B
Plaintext

#!/usr/bin/env python
import sys, subprocess, time
try:
if sys.argv[1] == "-c":
try:
command = sys.argv[2]
if command == 'su -s "/bin/bash" cvm':
interactive = True
else:
interactive = False
except:
exit(1)
else:
interactive = True
except IndexError:
interactive = True
if interactive == True:
returncode = subprocess.call(["sudo", "/home/cvm/logshell"])
else:
returncode = subprocess.call(["sudo", "/home/cvm/logcmd", command])
exit(returncode)