I've been trying to make my own sudo program in Python, but I don't want to have any dependencies (like su or pkexec). How would I gain root access? Ideas:
- Have the file always have root access (with chmod +[smth])
- Somehow login as root (maybe with subprocess)
- Use something built in (kind of a low-level dependency) and pass it the root password.
How would I do any of these or is there a different way? Or is Python even low level enough to do this?