Bug 633400

Summary: rhncfg-client lists lower-ranked config channel for file
Product: [Community] Spacewalk Reporter: Balazs Zachar <balazs.zachar>
Component: ClientsAssignee: Marcelo Moreira de Mello <mmello>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.5CC: josh.mullis, jpazdziora, mmello
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: spacewalk-backend-1.5.40-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 700527 (view as bug list) Environment:
Last Closed: 2011-07-21 14:43:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 695242, 700527    
Attachments:
Description Flags
Patch proposed none

Description Balazs Zachar 2010-09-13 17:38:33 UTC
Description of problem:
I am using two central configuration channel for one file (/etc/sudoers):
1 I have a common-linux channel, that includes a common sudoers file.
2 I have a sudoers-spacewalk channel that includes a sudoers file for my spacewalk server

My spacewalk server is subscribed on both channels and the sudoers-spacewalk channel has higher rank (so that sudoers file will be deployed).

The file deploying is working fine but if I list (or elist) the configured files with rhcfg-client than the common-linux channel is listed:
[root@spacewalk ~]# rhncfg-client elist
Mode          Owner Group          Size Rev      Config Channel    File
-r--r-----     root root           4445   1      common-configs    /etc/sudoers
-r--------     root root           1228   3      common-configs    /root/.ssh/authorized_keys


Version-Release number of selected component (if applicable):
[root@spacewalk ~]# rpm -qf /usr/bin/rhncfg-client
rhncfg-client-5.9.27-1.el5


Steps to Reproduce:
1. Configure A channel with X file
2. Configure B channel with X file
3. Configure B channel with higher rank
4. try to use the rhncfg-client list/elist command on the client
  
Actual results:
A channel is listed as the "source" channel of the X file

Expected results:
B channel is listed as the "source" channel of the X file

Comment 1 Jan Pazdziora (Red Hat) 2010-11-19 16:03:11 UTC
Mass-moving to space13.

Comment 2 Miroslav Suchý 2011-04-11 07:31:52 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 3 Miroslav Suchý 2011-04-11 07:36:32 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 4 Marcelo Moreira de Mello 2011-07-13 00:12:22 UTC
Created attachment 512541 [details]
Patch proposed

Howdy folks, 
 
 We created a patch which fix the rhncfg-client to honor the highest
rank for configuration files.

  cfg_sfdc-00437809     <--- highest rank
-----------
   * /etc/sfdc-00437809/file1  * locally managed
   * /etc/sfdc-00437809/file2
   * /etc/sfdc-00437809/duplicate

  cfg_sfdc-00437809_dup_LOW <--- lowest rank
-----------
    * /etc/sfdc-00437809/duplicate

Before applying the patch, rhncfg-client elist does not honor the rank
levels: 

# rhncfg-client elist
Mode          Owner Group          Size Rev                 Config Channel    File
drw-r--r--     root root             *0   1              cfg_sfdc-00437809    /etc/sfdc-00437809
-rw-r--r--     root root             81   5      cfg_sfdc-00437809_dup-LOW    /etc/sfdc-00437809/duplicate
-rw-r--r--     root root             53   3                     1000010002    /etc/sfdc-00437809/file1
-rw-r--r--     root root             61   2              cfg_sfdc-00437809    /etc/sfdc-00437809/file2

After applying the patch and restarting the Spacewalk services, the
issue is solved


# rhncfg-client elist
Mode          Owner Group          Size Rev         Config Channel    File
drw-r--r--     root root             *0   1      cfg_sfdc-00437809    /etc/sfdc-00437809
-rw-r--r--     root root             81   5      cfg_sfdc-00437809    /etc/sfdc-00437809/duplicate
-rw-r--r--     root root             53   1             1000010002    /etc/sfdc-00437809/file1
-rw-r--r--     root root             61   2      cfg_sfdc-00437809    /etc/sfdc-00437809/file2

 Cheers, 
Marcelo Moreira de Mello

Comment 5 Marcelo Moreira de Mello 2011-07-13 00:13:13 UTC
Patch sent to spacewalk-devel maillist 
 
   Mail Thread: 
       https://www.redhat.com/archives/spacewalk-devel/2011-July/msg00010.html

Cheers, 
mmello

Comment 6 Jan Pazdziora (Red Hat) 2011-07-13 11:49:04 UTC
(In reply to comment #5)
> Patch sent to spacewalk-devel maillist 
> 
>    Mail Thread: 
>        https://www.redhat.com/archives/spacewalk-devel/2011-July/msg00010.html
> 
> Cheers, 
> mmello

Committed to Spacewalk master, 46830082e095a9273ef2e5fe6fcd3a91eb14a952.

Tagged as spacewalk-backend-1.5.40-1.

Comment 7 Jan Pazdziora (Red Hat) 2011-07-13 11:52:00 UTC
*** Bug 702127 has been marked as a duplicate of this bug. ***

Comment 8 Jan Pazdziora (Red Hat) 2011-07-19 19:36:43 UTC
This bugzilla is currently MODIFIED, so we believe the fix is in the Spacewalk nightly yum repository at http://spacewalk.redhat.com/yum/nightly/

Therefore, moving ON_QA.

Comment 9 Jan Pazdziora (Red Hat) 2011-07-21 14:43:09 UTC
Spacewalk 1.5 was released.