Bug 1375655

Summary: Tab completion with sudo firewall-cmd is broken; prompts for root password
Product: [Fedora] Fedora Reporter: Devin Henderson <devin>
Component: firewalldAssignee: Eric Garver <egarver>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: jedringt, martin, samuel.rakitnican, sukulkar, twoerner
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-28 22:06:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Devin Henderson 2016-09-13 15:32:50 UTC
If I type:
]$ sudo firewall-cmd --list-a[TAB][TAB]

Instead of completing the command switch it pops up an authentication dialog asking for my root password. If I hit cancel it then says:

Authorization failed.
    Make sure polkit agent is running or run the application as superuser.

This is as of the 0.4.3.3-1.fc24 firewalld update.

Comment 1 Martin Stefany 2017-01-29 17:00:03 UTC
(In reply to Devin Henderson from comment #0)
> If I type:
> ]$ sudo firewall-cmd --list-a[TAB][TAB]
> 
> Instead of completing the command switch it pops up an authentication dialog
> asking for my root password. If I hit cancel it then says:
> 
> Authorization failed.
>     Make sure polkit agent is running or run the application as superuser.
> 
> This is as of the 0.4.3.3-1.fc24 firewalld update.

I have a similar issue while accessing Fedora 25 server over SSH, but instead of showing the dialog, it just directly throws the error:

$ sudo firewall-cmd --add-service=[TAB][TAB]Authorization failed.
    Make sure polkit agent is running or run the application as superuser.

$ cat /etc/fedora-release 
Fedora release 25 (Twenty Five)

$ systemctl list-units *polkit*
UNIT           LOAD   ACTIVE SUB     DESCRIPTION
polkit.service loaded active running Authorization Manager

Comment 2 Martin Stefany 2017-01-29 17:28:24 UTC
(In reply to Martin Stefany from comment #1)
> (In reply to Devin Henderson from comment #0)
> > If I type:
> > ]$ sudo firewall-cmd --list-a[TAB][TAB]
> > 
> > Instead of completing the command switch it pops up an authentication dialog
> > asking for my root password. If I hit cancel it then says:
> > 
> > Authorization failed.
> >     Make sure polkit agent is running or run the application as superuser.
> > 
> > This is as of the 0.4.3.3-1.fc24 firewalld update.
> 
> I have a similar issue while accessing Fedora 25 server over SSH, but
> instead of showing the dialog, it just directly throws the error:
> 
> $ sudo firewall-cmd --add-service=[TAB][TAB]Authorization failed.
>     Make sure polkit agent is running or run the application as superuser.
> 
> $ cat /etc/fedora-release 
> Fedora release 25 (Twenty Five)
> 
> $ systemctl list-units *polkit*
> UNIT           LOAD   ACTIVE SUB     DESCRIPTION
> polkit.service loaded active running Authorization Manager


Just to add more info, this happens also on CentOS/RHEL 7.3, where firewalld was rebased from 0.3.9 to 0.4.3, and here is upstream ticket from github:
https://github.com/t-woerner/firewalld/issues/111

$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core) 

$ firewall-cmd --zone=external --list-all
Authorization failed.
    Make sure polkit agent is running or run the application as superuser.

The problem is not really with the completion (=bash-completion should be OK), but with firewall-cmd not working OK with polkit and/or DBUS what is needed for execution as unprivileged user.

Comment 3 Fedora End Of Life 2017-07-25 23:01:04 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Devin Henderson 2017-07-25 23:03:17 UTC
This is still an issue on F26.

Comment 5 Fedora End Of Life 2017-08-08 17:20:13 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 John Edrington 2017-09-29 23:41:34 UTC
I'm still seeing this on F25 and comment #4 says this is also on F26. Going to reopen. 

Providing a specific (and valid) command to firewall-cmd on F25 works as a non-root user, but tab complete just endlessly prompts for polkit authentication, whereas tab complete works as root.

Comment 7 Fedora End Of Life 2018-05-03 08:30:05 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 8 John Edrington 2018-05-03 18:49:31 UTC
This is still present in F27.

Comment 9 Eric Garver 2018-08-10 14:31:13 UTC
*** Bug 1398904 has been marked as a duplicate of this bug. ***

Comment 10 Devin Henderson 2018-08-10 14:33:21 UTC
By the way, this is still present on F28

Comment 11 Ben Cotton 2019-05-02 21:10:27 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2019-05-28 22:06:00 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.