File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2031,7 +2031,7 @@ def execute_privileged_command(payload, command):
2031
2031
2032
2032
2033
2033
def get_sudo_l_output ():
2034
- """Gets the output of sudo -l command in a python 2.* and 3.* compatible way .
2034
+ """Gets the output of sudo -l command.
2035
2035
2036
2036
Returns:
2037
2037
str: Output of sudo -l command.
@@ -2046,13 +2046,17 @@ def get_sudo_l_output():
2046
2046
break
2047
2047
else :
2048
2048
process .kill ()
2049
- log . error ("Command timed out. User may need to enter a password." )
2049
+ print ("Command timed out. User may need to enter a password." )
2050
2050
return
2051
2051
2052
2052
stdout , _ = process .communicate ()
2053
+
2054
+ if sys .version_info [0 ] >= 3 :
2055
+ stdout = stdout .decode ('utf-8' )
2056
+
2053
2057
return stdout
2054
2058
except Exception as e :
2055
- log . error ("Error: " + str (e ))
2059
+ print ("Error: " + str (e ))
2056
2060
return
2057
2061
2058
2062
You can’t perform that action at this time.
0 commit comments