I have been really trying to avoid implementing it into the user session, it requires superuser to run the commands and I don’t like the concept of hardcoding sudo paths using nopasswd
But I probably will end up having to do something similar in the user environment.
edit: Now that I think about it, I could probably just make the command path to the network command be authorized as no password on any user as I don’t really see a situation where the user logged in shouldn’t be able to manipulate the network it’s connected to.
Afaik you can make a particular script available without a password, via sudoers. I forget how exactly, but I’ve looked into this in the past.
Alternatively, you can set the owner of the script to root and set the setuid permission on it, so it runs as root regardless of who launches it.
In both cases, if you hardcode the necessary operations in the script, it shouldn’t be possible to do anything else with it other than connect to WiFi.
Of course, you can also try setting it as a service to run as late as possible, perhaps that would fix it. Idk how services are specified in Arch, but usually with oldstyle init systems it’s the numbers at the beginning of the filename, and if you name symlinks to the script something like ‘99-start-wifi’, it should run among the last services at the particular init level.
I have been really trying to avoid implementing it into the user session, it requires superuser to run the commands and I don’t like the concept of hardcoding sudo paths using nopasswd
But I probably will end up having to do something similar in the user environment.
edit: Now that I think about it, I could probably just make the command path to the network command be authorized as no password on any user as I don’t really see a situation where the user logged in shouldn’t be able to manipulate the network it’s connected to.
Afaik you can make a particular script available without a password, via sudoers. I forget how exactly, but I’ve looked into this in the past.
Alternatively, you can set the owner of the script to root and set the setuid permission on it, so it runs as root regardless of who launches it.
In both cases, if you hardcode the necessary operations in the script, it shouldn’t be possible to do anything else with it other than connect to WiFi.
Of course, you can also try setting it as a service to run as late as possible, perhaps that would fix it. Idk how services are specified in Arch, but usually with oldstyle init systems it’s the numbers at the beginning of the filename, and if you name symlinks to the script something like ‘99-start-wifi’, it should run among the last services at the particular init level.
I had forgotten about the set UID flag. That might actually fix the issue altogether without having to do a hard-coded sudo path.
And would mean I wouldn’t have to double check the commans to make sure that there’s no destructive subcommands that could be done as well.
I might try that later, thanks!