Open Luciogi opened 3 months ago
Good suggestion, though i don't think it's a good idea to hard code sudo
command like that. Any other solution is welcome
We can make Variable PRIVILEGE_CMD="sudo"
.
There are other alternatives for sudo like doas
to handle that we can make condition as in pseudo code
if ( PRIVILEGE_CMD is empty):
PRIVILEGE_CMD="sudo"
else:
PRIVILEGE_CMD=readFromEnvironment()
I have not searched how can be this useful for gui apps with polkit to get root privileges
The library was designed to be a little easier to use, if possible the decorate user_is_root
returns Json, is there a way you can use the returned json to determine how to use sudo?
@user_is_root
exits control beforescan_command(...)
is executed (which run sudo nmap ...)And https://github.com/nmmapper/python3-nmap/blob/3de136bc48ea8a00ae3b5074728185c67414f685/nmap3/nmap3.py#L93 should be as