RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1247556 - Insufficient rights to stop service failed with errno 1 "Interactive authentication required"
Summary: Insufficient rights to stop service failed with errno 1 "Interactive authenti...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-28 10:14 UTC by Yongcheng Yang
Modified: 2016-06-02 08:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-02 08:56:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yongcheng Yang 2015-07-28 10:14:39 UTC
Description of problem:
Test the "Insufficient rights" in current RHEL-7.2, the return status has changed from "4" to "1", and the warning messages also changed.

As the LSB said, the non-zero status code has different meanings:
"1	generic or unspecified error (current practice)"
"4	user had insufficient privilege"

So maybe we should still use the errno "4" for insufficient rights error.

And RHEL-7.1 does not has this issue.

Version-Release number of selected component (if applicable):
RHEL-7.2 with kernel-3.10.0-295.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. useradd test
2. su test -c "service nfs stop"

Actual results:
[root@hp-dl385pg8-03 ~]#  su test -c "service nfs stop"
Redirecting to /bin/systemctl stop  nfs.service
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address (polkit-error-quark, 0)
Failed to stop nfs.service: Interactive authentication required.
[root@hp-dl385pg8-03 ~]# echo $?
1
^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<< RHEL-7.2 kernel-3.10.0-295.el7.x86_64
[root@hp-dl385pg8-03 ~]# 


Expected results:
[root@hp-dl580g7-04 ~]# id testuserqa
uid=1001(testuserqa) gid=1001(testuserqa) groups=1001(testuserqa)
[root@hp-dl580g7-04 ~]# su testuserqa -c "service nfs-idmapd stop"
Redirecting to /bin/systemctl stop  nfs-idmapd.service
Failed to issue method call: Access denied
[root@hp-dl580g7-04 ~]# echo $?
4
^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<< RHEL-7.1 kernel-3.10.0-229.el7.x86_64
[root@hp-dl580g7-04 ~]# 

Additional info:
http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic.html#INISCRPTACT

Comment 2 Lukáš Nykrýn 2015-07-30 14:04:58 UTC
Yes this behavior has changed because now we support polkit authentication.

Comment 3 Yongcheng Yang 2016-06-02 08:56:57 UTC
According to comment 2, this is the expected result.

So close this bug as NOTABUG, please correct me if there's any concern.


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