mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-12 23:21:31 +00:00
Remove pkexec from desktop
Add create_ap to execute without password with sudo
This commit is contained in:
parent
48d6928233
commit
93f64fa11e
@ -49,5 +49,6 @@ add_custom_target(uninstall_build
|
||||
COMMAND rm -rf $ENV{DESTDIR}${appdir}/${PROJECT_NAME}
|
||||
COMMAND rm -f $ENV{DESTDIR}${appbin}/${PROJECT_NAME}
|
||||
COMMAND rm -f $ENV{DESTDIR}${appdir}/applications/${PROJECT_NAME}.desktop
|
||||
COMMAND rm -f $ENV{DESTDIR}${appdir}/${PROJECT_NAME}/${PROJECT_NAME}.desktop
|
||||
COMMENT Unstalling files...
|
||||
)
|
@ -2,7 +2,7 @@
|
||||
Type=Application
|
||||
Name=WifiHotspot
|
||||
Icon=/usr/share/wihotspot/hotspot.png
|
||||
Exec=sh -c 'pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /usr/bin/wihotspot'
|
||||
Exec=sh -c 'env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/bin/wihotspot'
|
||||
Terminal=false
|
||||
Categories=System
|
||||
Keywords=Hotspot;WiFi
|
||||
|
@ -12,6 +12,7 @@ install:
|
||||
[ ! -d /lib/systemd/system ] || install -Dm644 create_ap.service $(DESTDIR)$(PREFIX)/lib/systemd/system/create_ap.service
|
||||
install -Dm644 bash_completion $(DESTDIR)$(PREFIX)/share/bash-completion/completions/create_ap
|
||||
install -Dm644 README.md $(DESTDIR)$(PREFIX)/share/doc/create_ap/README.md
|
||||
echo 'ALL ALL=NOPASSWD: /usr/bin/create_ap' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/create_ap
|
||||
|
||||
|
||||
uninstall:
|
||||
@ -20,3 +21,4 @@ uninstall:
|
||||
[ ! -f /lib/systemd/system/create_ap.service ] || rm -f $(DESTDIR)$(PREFIX)/lib/systemd/system/create_ap.service
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/create_ap
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/doc/create_ap/README.md
|
||||
rm -f /etc/sudoers.d/create_ap
|
||||
|
2
src/scripts/sudors_edit.sh
Normal file
2
src/scripts/sudors_edit.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#Execute create_ap without asking password
|
||||
echo 'ALL ALL=NOPASSWD: /usr/bin/create_ap' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/create_ap
|
@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define BUFSIZE 512
|
||||
|
||||
|
||||
#define SUDO "pkexec --user root"
|
||||
#define SUDO "sudo"
|
||||
#define CREATE_AP "create_ap"
|
||||
|
||||
#define MKCONFIG "--mkconfig"
|
||||
@ -184,7 +184,7 @@ const char* build_kill_create_ap_command(char* pid){
|
||||
|
||||
static int init_get_running(){
|
||||
|
||||
const char* cmd="pkexec --user root create_ap --list-running";
|
||||
const char* cmd="sudo create_ap --list-running";
|
||||
FILE *fp;
|
||||
|
||||
if ((fp = popen(cmd, "r")) == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user