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 1232668 - ‘ cman_tool status ‘ fails when it is executed by non root user.
Summary: ‘ cman_tool status ‘ fails when it is executed by non root user.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cluster
Version: 6.2
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Christine Caulfield
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-17 09:25 UTC by deenajos
Modified: 2016-01-28 21:35 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-18 08:45:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description deenajos 2015-06-17 09:25:53 UTC
Description of problem:
When a non root user executes 'cman_tool status' , it fails with following error :
[nonroot@xxx]$ /usr/sbin/cman_tool status
/usr/sbin/cman_tool: Cannot open connection to cman, permission denied.

On using strace, it was found that the failure was due to a permission issue with the file '/var/run/cman_client'.

STRACE output for the command:
      socket(PF_FILE, SOCK_STREAM, 0)         = 3
      fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
      connect(3, {sa_family=AF_FILE, path="/var/run/cman_client"}, 110) = -1 EACCES (Permission denied)
      close(3)                                = 0
      write(2, "/usr/sbin/cman_tool: ", 21/usr/sbin/cman_tool: )   = 21

Similar issue is seen when 'cman_tool nodes' is run by the non root user. However, the command 'cman_tool services' is successfully executed by the same non root user.

1. Is this because root permissions are required by to execute the above commands?
2. If yes, how can this be made to work for a non root user?.


Version-Release number of selected component (if applicable):
cman-3.0.12.1-49.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.log in to the cluster as non root user  .
2.Run 'cman_tool status'.


Actual results:
[nonroot@xxx]$ /usr/sbin/cman_tool status
/usr/sbin/cman_tool: Cannot open connection to cman, permission denied.

Expected results:
'cman_tool status' should give same results for the non root user as  it does for the root/administrator.

Additional info:

Comment 2 Christine Caulfield 2015-06-18 08:45:23 UTC
The permissions on the cman client socket are deliberate - we really don't want any old process accessing the cluster manager.

The socket permissions are 0660 which means you should be able to grant access to non-root processes by giving them access the appropriate group. The group defaults to 'root' too, but is easily changed.

Comment 3 stephenfmarshall 2016-01-28 21:35:46 UTC
(In reply to Christine Caulfield from comment #2)
> The permissions on the cman client socket are deliberate - we really don't
> want any old process accessing the cluster manager.
> 
> The socket permissions are 0660 which means you should be able to grant
> access to non-root processes by giving them access the appropriate group.
> The group defaults to 'root' too, but is easily changed.

I'm experiencing the same problem as the original poster.  I can solve the problem temporarily by changing the group ownership on the cman socket file.  However, this solution is only temporary; it needs to be repeated if the system is rebooted or cman is restarted.  Is there a way to configure cman so it will create its socket with group permissions other than root (e.g. with group haclient)?

Below shows the details of the temporary solution, which may be useful for testing a more permanent solution.

This command shows the problem.  Executing this as a privileged user (e.g. root) has no errors.
cman_tool nodes -F id,name
cman_tool: Cannot open connection to cman, permission denied.

The permissions on the cman socket file are exactly as the original poster described (writable to user and group, but user and group are both "root").
ls -ltr /var/run/cman_client 
srw-rw----. 1 root root 0 Jan 22 16:38 /var/run/cman_client

I am able to fix the problem by changing the group permissions on the cman socket file, e.g.
  sudo chgrp haclient /var/run/cman_client

Now users that are part of the haclient group can run this command successfully:
cman_tool nodes -F id,name
1 qc-sfc-obs1 
2 qc-sfc-obs2


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