Skip to content

Commit 2cfc35f

Browse files
committed
bug fix: command execution
1 parent f28402c commit 2cfc35f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plogical/processUtilities.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,15 @@ def sendCommand(command, user=None, dir=None):
241241
command = '%s-d %s %s' % (ProcessUtilities.token, dir, command)
242242
sock.sendall(command.encode('utf-8'))
243243
else:
244+
if command.startswith('sudo'):
245+
command = command.replace('sudo', '', 1) # Replace 'sudo' with an empty string, only once
246+
244247
if dir == None:
245248
command = '%s-u %s %s' % (ProcessUtilities.token, user, command)
246249
else:
247250
command = '%s-u %s -d %s %s' % (ProcessUtilities.token, user, dir, command)
248251

249-
if command.startswith('sudo'):
250-
command = command.replace('sudo', '', 1) # Replace 'sudo' with an empty string, only once
252+
251253

252254
if os.path.exists(ProcessUtilities.debugPath):
253255
if command.find('cat') == -1:

0 commit comments

Comments
 (0)