Code: Alles auswählen
su jailed -c dmd -of…
subprocess-Ansatz:
Code: Alles auswählen
In [10]: p = Popen(['su', 'jailed', '-c', 'dmd'], stdout=PIPE, stdin=PIPE, stderr=PIPE, shell=True)
In [11]: p.communicate('none')
Out[11]: ('', 'standard in must be a tty\n')
Code: Alles auswählen
In [14]: os.setuid(1002)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
/home/dav1d/workspaces/python/irc/irc/<ipython-input-14-126e5d825996> in <module>()
----> 1 os.setuid(1002)
OSError: [Errno 1] Operation not permitted
Ich bin leider aufgeschmissen …
Idee: statt subprocess pexpect? Weitere Idee aus dem IRC "nphg | evtl. liefert os.openpty() was brauchbares".
Also, wie wechsle UID des Python-Prozesses (am besten nur vorübergehend)?