My program runs with root privileges, but I need a portion to run as an unprivileged user.
Basically, webbrowser.open(SITE) doesn't work as root. My code needs to run as root other than this. I've tried the following:
subprocess.call("sudo -u " + getpass.getuser() + " " + webbrowser.open("https://github.com/codywd/WiFiz/issues"))
It causes the following error:
Traceback (most recent call last):
File "main.py", line 364, in OnReport
subprocess.call("sudo -u " + getpass.getuser() + " " + webbrowser.open("https://github.com/codywd/WiFiz/issues"))
TypeError: cannot concatenate 'str' and 'bool' objects
START /usr/bin/chromium "https://github.com/codywd/WiFiz/issues"
[7250:7250:0201/231848:ERROR:chrome_browser_main_extra_parts_gtk.cc(50)] Startup refusing to run as root.
I understand WHY this error is happening, but I don't know how else to execute this code.
Thanks in advance guys!