GUFW Firewall not opening

I’m having an issue with the GUFW Firewall on my new Manjaro KDE installation. When I start it and type in my password, it does nothing, just doesn’t start. When I tried typing “sudo gufw” into the terminal, I got this output:

“/usr/bin/gufw: line 2: [: =: unary operator expected”

Does anybody know how to fix this?

Let’s make sure you have read this first:
https://wiki.manjaro.org/index.php?title=Firewalls

So, is the ufw service enabled?
Did you avoid using iptables in that case?

Please don’t do that. You could eventually try:
gufw-pkexec

If ufw is enabled and running, it might be the issue with /usr/bin/gufw-pkexec

Please read: FS#66556 : [gufw] Gufw won't start

Has _G_UFW not fixed itself?
It used to do some silly legacy stuff that didnt jive and you needed to manually augment for display source and polkit and such … is it still like that ?
(old forum has handful of my own posts on the subject directly)

2 Likes

I found that my firewall settings also don’t work. After clicking on the firewall settings application in manjaro Gnome, I am prompted to enter the password, but then nothing happens.

I tried to modify the file: / bin / gufw - I added the text:
gksudo python3 /usr/lib/python3.7/site-packages/gufw/gufw.py

This method does not work. Please, how to solve the problem? Thank you

OK I found it …

Comment out the last line of /usr/bin/gufw and add a new one, so it looks like this on the last 2 lines:

#pkexec gufw-pkexec $c_user
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gufw-pkexec $c_user

And all is good.

There is still the bug referenced FS#66556 : [gufw] Gufw won't start

It is an error with /usr/bin/gufw-pkexec file under certain languages. The following is a quick fix.
This time its the first line of the script we want to comment out and replace. The top 3 lines would become:

#!/bin/bash
#LOCATIONS=`ls -ld /usr/lib/python*/site-packages/gufw/gufw.py | awk '{print $9}'` # from source
LOCATIONS=`echo /usr/lib/python*/site-packages/gufw/gufw.py`                      # from cscs
2 Likes

@oircz @mkey

Patched gufw package is now moving through Unstable and Testing branches.
Should see fixes in Stable branch on next round of updates.

2 Likes

I am experiencing the same issue.

Advice is wait?

deleted

dont do that.
The issue is with gufw and its terrible executable script.
To fix it we patched the package.
The idea is to make it work with polkit correctly … not bruteforce sudo on the GUI.
(which you shouldnt do)
It should already work from the regular package.

4 Likes

I wasn’t aware, I will edit out the post.

At long last - it has appeared in front of my eyes and I love it.

Oh. I thought it was pushed through. But maybe it came with the Stable branch update recently.

I have this issue, too. Gufw worked last night, even after installing the recent update. But this morning, it won’t launch anymore.

When I run

sudo ufw enable

I get

    WARN: uid is 0 but '/usr/bin' is owned by 1
Firewall is active and enabled on system startup

And if you run gufw ?

gufw

(gufw.py:66819): Gtk-WARNING **: 09:11:42.668: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(gufw.py:66819): Gtk-WARNING **: 09:11:42.668: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(gufw.py:66819): Gtk-WARNING **: 09:11:42.668: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/gufw/gufw.py", line 30, in <module>
gufw = Gufw(controler.get_frontend())
  File "/usr/lib/python3.8/site-packages/gufw/gufw/view/gufw.py", line 80, in __init__
self._set_initial_values()
  File "/usr/lib/python3.8/site-packages/gufw/gufw/view/gufw.py", line 283, in _set_initial_values
self.listening = ListeningReport(self)
  File "/usr/lib/python3.8/site-packages/gufw/gufw/view/listening.py", line 35, in __init__
self._show_report()
  File "/usr/lib/python3.8/site-packages/gufw/gufw/view/listening.py", line 48, in _show_report
self._view_report(report, self.previous_report)
  File "/usr/lib/python3.8/site-packages/gufw/gufw/view/listening.py", line 83, in _view_report
self.gufw.listening_model.set_value(iter_row, 1, int(line_split[1].strip())) # port
ValueError: invalid literal for int() with base 10: 'WARN:'

Care to also show the contents of /usr/bin/gufw and /usr/bin/gufw-pkexec ?

cat usr/bin/gufw | curl -F 'clbin=<-' https://clbin.com
cat usr/bin/gufw-pkexec | curl -F 'clbin=<-' https://clbin.com
cat usr/bin/gufw | curl -F 'clbin=<-' https://clbin.com
cat: usr/bin/gufw: No such file or directory
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="//netfree.link/img/block-favicon.png"/>
    </head>
    <body>
        <iframe id="netfree_block_iframe" name="netfree-block-iframe" src="https://netfree.link/block/#%7B%22block%22%3A%22unknown%22%2C%22sourceStatusCode%22%3A200%2C%22page_info%22%3A%7B%22url%22%3A%22https%3A%2F%2Fclbin.com%2F%22%7D%7D" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; "></iframe>
    </body>
</html>

shmuel@shmuel-Manjaro:~$ cat usr/bin/gufw-pkexec | curl -F 'clbin=<-' https://clbin.com
cat: usr/bin/gufw-pkexec: No such file or directory
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="//netfree.link/img/block-favicon.png"/>
    </head>
    <body>
        <iframe id="netfree_block_iframe" name="netfree-block-iframe" src="https://netfree.link/block/#%7B%22block%22%3A%22unknown%22%2C%22sourceStatusCode%22%3A200%2C%22page_info%22%3A%7B%22url%22%3A%22https%3A%2F%2Fclbin.com%2F%22%7D%7D" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; "></iframe>
    </body>
</html>

I see “netfree” in the output, it is a root certificate that filters internet traffic. It seems to be blocking something.

Oops … I forgot the preceding /

cat /usr/bin/gufw | curl -F 'clbin=<-' https://clbin.com
cat /usr/bin/gufw-pkexec | curl -F 'clbin=<-' https://clbin.com
cat /usr/bin/gufw | curl -F 'clbin=<-' https://clbin.com
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="//netfree.link/img/block-favicon.png"/>
    </head>
    <body>
        <iframe id="netfree_block_iframe" name="netfree-block-iframe" src="https://netfree.link/block/#%7B%22block%22%3A%22unknown%22%2C%22sourceStatusCode%22%3A200%2C%22page_info%22%3A%7B%22url%22%3A%22https%3A%2F%2Fclbin.com%2F%22%7D%7D" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; "></iframe>
    </body>
</html>

shmuel@shmuel-Manjaro:~$ cat /usr/bin/gufw-pkexec | curl -F 'clbin=<-' https://clbin.com
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="//netfree.link/img/block-favicon.png"/>
    </head>
    <body>
        <iframe id="netfree_block_iframe" name="netfree-block-iframe" src="https://netfree.link/block/#%7B%22block%22%3A%22unknown%22%2C%22sourceStatusCode%22%3A200%2C%22page_info%22%3A%7B%22url%22%3A%22https%3A%2F%2Fclbin.com%2F%22%7D%7D" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; "></iframe>
    </body>
</html>

shmuel@shmuel-Manjaro:~$ cat /usr/bin/gufw-pkexec | curl -F 'clbin=<-' https://clbin.com
<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="//netfree.link/img/block-favicon.png"/>
    </head>
    <body>
        <iframe id="netfree_block_iframe" name="netfree-block-iframe" src="https://netfree.link/block/#%7B%22block%22%3A%22unknown%22%2C%22sourceStatusCode%22%3A200%2C%22page_info%22%3A%7B%22url%22%3A%22https%3A%2F%2Fclbin.com%2F%22%7D%7D" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; "></iframe>
    </body>
</html>

I am trying to get Netfree to unblock the url