Bug 1398904 - firewall-cmd requiring root for bash autocompletition
Summary: firewall-cmd requiring root for bash autocompletition
Keywords:
Status: CLOSED DUPLICATE of bug 1375655
Alias: None
Product: Fedora
Classification: Fedora
Component: firewalld
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Garver
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-27 07:48 UTC by srakitnican
Modified: 2023-09-14 03:35 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-10 14:31:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description srakitnican 2016-11-27 07:48:21 UTC
Description of problem:
Trying to do autocompletion in bash results in polkit prompts for every completion.


Version-Release number of selected component (if applicable):
firewalld-0.4.3.3-1.fc25.noarch


How reproducible: By typing firewall-cmd as regular user and pressing <tab>.


Actual results: 
$ firewall-cmd Authorization failed.
    Make sure polkit agent is running or run the application as superuser.


Expected results: That firewall-cmd autocompletion does not require root password


Additional info: It seems stackexchange user icarus debugged it in detail
http://unix.stackexchange.com/questions/321478/disable-prompt-for-authentication-on-autocompletion-of-a-command-which-needs-roo/322871#322871

Comment 1 Sally 2017-10-04 03:40:28 UTC
I think the same issue is still with 

xfce-polkit-0.2-9.fc26.x86_64

I am using fedora 26 with XFCE environment.

Description of the problem:
When I want use firewall-cmd and then type tab to see which the options, or starting type -- then tab, I get "XFCE PolicyKit Agent" window, asking me the password of the root, after entering the password when I type another option for the same command it prompt again, that means I may have to enter root password 5 times till I finish typing the command with its options.

I don't know if the issue from polkit or xfce-polkit or bash-completion.

After reading the link up, and removed the line

    firewall-cmd --state 1> /dev/null || return
from the file
/usr/share/bash-completion/completions/firewall-cmd

There is some improvement in reducing the number of time of asking the password, but the issue is still there.

xfce-polkit-0.2-9.fc26.x86_64
polkit-libs-0.113-8.fc26.x86_64
polkit-pkla-compat-0.1-8.fc26.x86_64
polkit-0.113-8.fc26.x86_64
bash-completion-2.6-1.fc26.noarch

Comment 2 Fedora End Of Life 2017-11-16 18:38:34 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 3 srakitnican 2017-11-17 08:42:18 UTC
Still an issue in a fully updated Fedora 27 release.

Comment 4 Harald Pfeiffer 2018-01-26 14:07:49 UTC
As far as I can see this by researching on the web, the causing line is "firewall-cmd --state 2> /dev/null". For firewalld-0.4.4.5-3.fc27.noarch, this is on line 116 (116c116).

My thoughts right now:

On a Debian system with polkitd running this causes no issue ("sudo firewall-cmd <TAB><TAB> does not throw a polkitd exception even though the line is also existing in the bash completion script)), so this is option 1.

Option 2 is the question why this is coded in as a prerequisite - without this line firewall-cmd does work for unprivileged users as tab completion and an execution would still fail (see below, I had autocompleted "--state" and then got blocked by polkitd when firing the command, which I expected). Unless this is there for a security reason maybe this could be removed.

Comment 5 Harald Pfeiffer 2018-01-26 14:08:32 UTC
Forgot the example line:

15:03:12 pfeifferh@jango104 ~/git/xmart/personal/miscellany/linux-fixes/bash_completion # firewall-cmd --state 
Authorization failed.
    Make sure polkit agent is running or run the application as superuser.

Comment 6 Eric Garver 2018-08-10 14:31:13 UTC

*** This bug has been marked as a duplicate of bug 1375655 ***

Comment 7 Red Hat Bugzilla 2023-09-14 03:35:07 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.