Check for root password
#1
Hello.

I want to do do simple thing. I need to execute "echo pass | sudo -S echo" and get return code. It working in a script started from shell but it not working if i use the same code in the plugin.

Quote: p = subprocess.Popen(["sudo", "-S", "echo"], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdin = p.stdin
stdout = p.stdout
stderr = p.stderr
p.communicate("%s\n" % aPassword)

try :
if (p.poll() == None) :
p.wait()
except :
pass

With this code I get such error. OSError 10: No child processes
Reply

Logout Mark Read Team Forum Stats Members Help
Check for root password0