lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.15k stars 294 forks source link

better apparmor detection for dnsmasq access to config file #269

Closed mxvin closed 1 year ago

mxvin commented 1 year ago

Sorry I'm not following bug format, because it's just a simple request and I know where the problem is come from.

Some system have aa-complain instead of complain for AA management.

https://github.com/lakinduakash/linux-wifi-hotspot/blob/08305fb67a964d2dd6d3611b9003bf3e779eb32e/src/scripts/create_ap#L1882-L1886

My suggestions is just execute both quietly, so no if blocks needed. It gonna failed either one of it or all of it (no AA installed) and do nothing anyway. Inform to user if needed that AA status for dnsmasq is set to complain mode. Something like this:

aa-complain dnsmasq > /dev/null 2>&1
aa_chk=$?
complain dnsmasq > /dev/null 2>&1 
aa_chk2=$?
    if [[ $aa_chk -eq 0 ]] || [[ $aa_chk2 -eq 0 ]]; then
        echo "Apparmor for dnsmasq sets to complain mode. Dnsmasq needs this."
    fi
adrienrx commented 1 year ago

Yes, i stumbled on that issue today after updating my system.

I had to use this command ╰─ sudo aa-complain -d /etc/apparmor.d/ dnsmasq which isnt' idead.

The apparmor profile needs to be tuned as I suppose the command above isn't recommended security wise.

**Running Manjaro and this package was installed via an AUR