bug fix: command execution

This commit is contained in:
usmannasir 2024-02-09 23:53:02 +05:00
parent f28402cebb
commit 2cfc35fc0d
1 changed files with 4 additions and 2 deletions

View File

@ -241,13 +241,15 @@ class ProcessUtilities(multi.Thread):
command = '%s-d %s %s' % (ProcessUtilities.token, dir, command)
sock.sendall(command.encode('utf-8'))
else:
if command.startswith('sudo'):
command = command.replace('sudo', '', 1) # Replace 'sudo' with an empty string, only once
if dir == None:
command = '%s-u %s %s' % (ProcessUtilities.token, user, command)
else:
command = '%s-u %s -d %s %s' % (ProcessUtilities.token, user, dir, command)
if command.startswith('sudo'):
command = command.replace('sudo', '', 1) # Replace 'sudo' with an empty string, only once
if os.path.exists(ProcessUtilities.debugPath):
if command.find('cat') == -1: