wtf icon indicating copy to clipboard operation
wtf copied to clipboard

update firewall module to use sudo ufw status properly

Open docsmooth opened this issue 1 year ago • 2 comments

This re-orders the "ufw status" logic to assume it's being run as a regular user, and use "sudo /usr/sbin/ufw status". If the username is root, then instead use simply "ufw status".

This update does NOT take variable elevation commands like pbrun/dzdo/pbsudo into account. I may add that in a future update.

docsmooth avatar Jul 19 '24 16:07 docsmooth

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 15 '25 21:01 stale[bot]

Why was this marked wontfix? The UFW status comes up empty on Ubuntu as a regular user without, do I need to reference an issue?

docsmooth avatar Jan 16 '25 20:01 docsmooth

I tried testing out this PR and it hangs my WTF instance. Not sure what's going on right now but I can try to revisit sometime soon.

FelicianoTech avatar Jun 21 '25 03:06 FelicianoTech

@FelicianoTech do you have a NOPASSWD entry in your sudoers for the ufw command? If not, it's hanging for your password

docsmooth avatar Jun 21 '25 04:06 docsmooth

@docsmooth I did not. I would love to figure out a way to notify the user that that's the problem rather than just locking up. I don't want to hold up this PR though so that can happen latter.

Verified this works. Thank you for contributing.

FelicianoTech avatar Jun 22 '25 00:06 FelicianoTech

@FelicianoTech that's a great point. I'll think about this, I have some thoughts

docsmooth avatar Jun 22 '25 01:06 docsmooth