Bug 683264 - Configuration file deployment creates extraneous directories
Summary: Configuration file deployment creates extraneous directories
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client
Version: 540
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Dimitar Yordanov
URL:
Whiteboard:
: 696283 704884 (view as bug list)
Depends On:
Blocks: sat541-blockers 703376 sat541-rhn-tools
TreeView+ depends on / blocked
 
Reported: 2011-03-08 23:00 UTC by Aron Parsons
Modified: 2018-11-14 13:42 UTC (History)
14 users (show)

Fixed In Version: rhncfg-5.9.27-16
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 703376 (view as bug list)
Environment:
Last Closed: 2011-06-16 16:53:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
temporary patch (1.46 KB, patch)
2011-04-14 08:44 UTC, Martin Osvald 🛹
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 688461 0 medium CLOSED Error when using the web UI to compare the differences between a file revision when SELinux is disabled in RHEL6 2021-02-22 00:41:40 UTC

Internal Links: 688461

Description Aron Parsons 2011-03-08 23:00:41 UTC
Description of problem:
With rhncfg-*-5.9.27-15, deploying configuration files creates the file's directory structure inside of each path component.

For example, a configuration channel has a file at /etc/openldap/cacerts/server.crt.  Deploying to a client creates the following directories and files:
/etc/openldap/cacerts/etc
/etc/openldap/cacerts/etc/openldap
/etc/openldap/cacerts/server.crt

Version-Release number of selected component (if applicable):
rhncfg-*-5.9.27-15.el5

How reproducible:
Always

Steps to Reproduce:
1. create a config channel that contains a file at /etc/openldap/cacerts/server.crt
2. deploy the configuration file to the client
3. run rhn_check on the client
  
Actual results:
/etc/openldap/cacerts/etc and /etc/openldap/cacerts/etc/openldap are created

Expected results:
Only the configuration file and its parent directories should be deployed


Additional info:
Possibly an artifact of bug 664677, part of RHBA-2011:0323.  Rolling back rhncfg-* versions to 5.9.27-1 alleviates the problem.

Comment 3 Michael Mráka 2011-04-12 09:44:15 UTC
Fixed in spacewalk master by
commit f12d4bcd1ee2e04740f30fb5225ce1d688142114
    don't make link target absolute
    fixing
     # pwd
     /root
     # ll /etc/openldap/cacerts/link
     lrwxrwxrwx 1 root root 10 Apr 11 10:09 /etc/openldap/cacerts/link -> server.crt
     # rhncfg-client diff /etc/openldap/cacerts/link
     Symbolic links differ.
     Channel: '/etc/openldap/cacerts/link' -> '/etc/openldap/cacerts/dir'
     System: '/etc/openldap/cacerts/link' -> '/root/server.crt'
commit 306e20b99fbe41693f83a2d9481612f2f642cbba
    683264 - fixed extraneous directory creation via rhncfg-manager
commit 06a1f13b03f569c6a251e5fbe45069e6b8bb0c9f
    fixed symlink deployment via rhn_check
    fixing
    Client execution returned "Failed deployment, /symlink already exists as a directory
commit f3ec0e4a87d21c72c2e8945f8c4fa272b4088da3
    683264 - rootdir is / when called from rhn_check
commit c10aec147ed9773fc48f140cf8526cd41d47faa0
    don't rollback transaction if symlink already exists
commit 455fecf78853740842ed3ebe5addcbc3779c9c2a
    made entry look nicer
commit 7627e804ad29d524f9cb50d2470a24daa15dc625
    fixed traceback during rollback
    fixing
    Failed rollback
    Traceback (most recent call last):
      File "/usr/bin/rhncfg-client", line 34, in ?
        sys.exit(Main().main() or 0)
      File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main
        handler.run()
      File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
        self.options.exclude)
      File "/usr/share/rhn/config_common/deploy.py", line 75, in deploy_files
        try_rollback(dep_trans, "Deploy failed, rollback successful")
      File "/usr/share/rhn/config_common/deploy.py", line 82, in try_rollback
        dep_trans.rollback()
      File "/usr/share/rhn/config_common/transactions.py", line 243, in rollback
        self._chown_chmod_chcon(d, d, val)
      File "/usr/share/rhn/config_common/transactions.py", line 111, in _chown_chmod_chc
        if file_info['filetype'] != 'symlink':
    KeyError: 'filetype'
commit 4b7aef0645d1535dc82eb0e018766fdafcfe62cb
    don't fail if link points to directory
    fixed
    Deploying //etc/openldap/cacerts/dir
    Failed rollback
    Traceback (most recent call last):
      File "/usr/bin/rhncfg-client", line 34, in ?
        sys.exit(Main().main() or 0)
      File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main
        handler.run()
      File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
        self.options.exclude)
      File "/usr/share/rhn/config_common/deploy.py", line 74, in deploy_files
        try_rollback(dep_trans, "Deploy failed, rollback successful")
      File "/usr/share/rhn/config_common/deploy.py", line 81, in try_rollback
        dep_trans.rollback()
      File "/usr/share/rhn/config_common/transactions.py", line 243, in rollback
        self._chown_chmod_chcon(d, d, val)
      File "/usr/share/rhn/config_common/transactions.py", line 111, in _chown_chmod_chc
        if file_info['filetype'] != 'symlink':
    KeyError: 'filetype'

Fixed spacewalk package rhncfg-5.9.53-1.

Comment 4 Michael Mráka 2011-04-12 09:46:38 UTC
Backported to SATELLITE-5.4 as
commit dc9f999befc0d2dee3d02180bf4196559211253a
    don't make link target absolute
    fixing
     # pwd
     /root
     # ll /etc/openldap/cacerts/link
     lrwxrwxrwx 1 root root 10 Apr 11 10:09 /etc/openldap/cacerts/link -> server.crt
     # rhncfg-client diff /etc/openldap/cacerts/link
     Symbolic links differ.
     Channel: '/etc/openldap/cacerts/link' -> '/etc/openldap/cacerts/dir'
     System: '/etc/openldap/cacerts/link' -> '/root/server.crt'
    (cherry picked from commit f12d4bcd1ee2e04740f30fb5225ce1d688142114)
commit 64aac311b88e4ac28f414769afb26e7ab092b967
    683264 - fixed extraneous directory creation via rhncfg-manager (cherry picked from commit 306e20b99fbe41693f83a2d9481612f2f642cbba)
commit f2baef79f945aa20d12c2412b07bd93e3e909d91
    fixed symlink deployment via rhn_check
    fixing
    Client execution returned "Failed deployment, /symlink already exists as a directory" (code 45)
    (cherry picked from commit 06a1f13b03f569c6a251e5fbe45069e6b8bb0c9f)
commit fe885556e014cc5419ce59c2b331671683733cd0
    683264 - rootdir is / when called from rhn_check (cherry picked from commit f3ec0e4a87d21c72c2e8945f8c4fa272b4088da3)
commit b3a1b23a889164bd9e3f4958853d0cb753599b9e
    don't rollback transaction if symlink already exists (cherry picked from commit c10aec147ed9773fc48f140cf8526cd41d47faa0)
commit 47763edb963be88567e60432db197411ea1e910b
    made entry look nicer (cherry picked from commit 455fecf78853740842ed3ebe5addcbc3779c9c2a)
commit 1f378c6f310fbfcc4baf89ba777b521d335a2739
    fixed traceback during rollback
    fixing
    Failed rollback
    Traceback (most recent call last):
      File "/usr/bin/rhncfg-client", line 34, in ?
        sys.exit(Main().main() or 0)
      File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main
        handler.run()
      File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
        self.options.exclude)
      File "/usr/share/rhn/config_common/deploy.py", line 75, in deploy_files
        try_rollback(dep_trans, "Deploy failed, rollback successful")
      File "/usr/share/rhn/config_common/deploy.py", line 82, in try_rollback
        dep_trans.rollback()
      File "/usr/share/rhn/config_common/transactions.py", line 243, in rollback
        self._chown_chmod_chcon(d, d, val)
      File "/usr/share/rhn/config_common/transactions.py", line 111, in _chown_chmod_chcon
        if file_info['filetype'] != 'symlink':
    KeyError: 'filetype'
    (cherry picked from commit 7627e804ad29d524f9cb50d2470a24daa15dc625)
commit f85f05b3821a822d54233f8f831d7916300dbc18
    don't fail if link points to directory
    fixed
    Deploying //etc/openldap/cacerts/dir
    Failed rollback
    Traceback (most recent call last):
      File "/usr/bin/rhncfg-client", line 34, in ?
        sys.exit(Main().main() or 0)
      File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main
        handler.run()
      File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
        self.options.exclude)
      File "/usr/share/rhn/config_common/deploy.py", line 74, in deploy_files
        try_rollback(dep_trans, "Deploy failed, rollback successful")
      File "/usr/share/rhn/config_common/deploy.py", line 81, in try_rollback
        dep_trans.rollback()
      File "/usr/share/rhn/config_common/transactions.py", line 243, in rollback
        self._chown_chmod_chcon(d, d, val)
      File "/usr/share/rhn/config_common/transactions.py", line 111, in _chown_chmod_chcon
        if file_info['filetype'] != 'symlink':
    KeyError: 'filetype'
    (cherry picked from commit 4b7aef0645d1535dc82eb0e018766fdafcfe62cb)

Comment 5 Milan Zázrivec 2011-04-14 08:15:59 UTC
*** Bug 696283 has been marked as a duplicate of this bug. ***

Comment 6 Martin Osvald 🛹 2011-04-14 08:44:19 UTC
Created attachment 491996 [details]
temporary patch

temporary patch to fix the problem before engineering release a correct/cleaner fix for it

Comment 7 Martin Osvald 🛹 2011-04-14 08:50:32 UTC
please, see duplicate BZ #696283 for more details to the patch

Comment 10 Dimitar Yordanov 2011-05-04 12:21:59 UTC
Verified on RHEL4, RHEL5 and RHEL6.

Comment 12 Miroslav Suchý 2011-05-31 19:56:48 UTC
*** Bug 704884 has been marked as a duplicate of this bug. ***

Comment 14 Milan Zázrivec 2011-06-03 13:52:27 UTC
Verified in stage w/ rhncfg-5.9.27-17 -> release pending.

Comment 15 Clifford Perry 2011-06-16 16:53:54 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0878.html

Comment 16 Martin Philippi 2011-07-25 17:58:58 UTC
Hi, 

take a look at RHBA-2011:0878 shows me, that NOT all packages are linked to the RHEL 4 ES channels : 10 RPM's are linked to the AS channels and only 4 are linked to the ES channels : 

Red Hat Network Tools for RHEL AS (v.4 for AMD64/Intel EM64T)
md5:5f8c74cc96a58d48b2ff2563ddf1b719 koan-2.0.7-11.el4sat-noarch
md5:81fe97d2153bb9442d045c4f7be4dbed python-urlgrabber-2.9.8-2.el4-noarch
md5:dd715f7f01031923d4f08ad68e715084 rhncfg-5.9.27-17.el4-noarch
md5:58677f706c6a96d395b0b8c71112ae87 rhncfg-actions-5.9.27-17.el4-noarch
md5:cac4513769924a47e8ddbf24a68a8c24 rhncfg-client-5.9.27-17.el4-noarch
md5:ebc8b228355d6a3b6219ca96d66d2076 rhncfg-management-5.9.27-17.el4-noarch
md5:e75930845daf65855a73eac0b825f037 rhnmd-5.3.7-1.el4sat-noarch
md5:b1b6fcdfbeb95a524b6b4a6825fe317a spacewalk-koan-0.2.7-7.el4sat-noarch
md5:de72749d9f844ff885acdef9437c7b9f spacewalk-proxy-installer-1.1.2-7.el4sat-noarch
md5:8482ab01b42a7a34c2225c9952cb36f1 spacewalk-remote-utils-1.0.2-6.el4sat-noarch

Red Hat Network Tools for RHEL AS (v.4 for x86)
md5:5f8c74cc96a58d48b2ff2563ddf1b719 koan-2.0.7-11.el4sat-noarch
md5:81fe97d2153bb9442d045c4f7be4dbed python-urlgrabber-2.9.8-2.el4-noarch
md5:dd715f7f01031923d4f08ad68e715084 rhncfg-5.9.27-17.el4-noarch
md5:58677f706c6a96d395b0b8c71112ae87 rhncfg-actions-5.9.27-17.el4-noarch
md5:cac4513769924a47e8ddbf24a68a8c24 rhncfg-client-5.9.27-17.el4-noarch
md5:ebc8b228355d6a3b6219ca96d66d2076 rhncfg-management-5.9.27-17.el4-noarch
md5:e75930845daf65855a73eac0b825f037 rhnmd-5.3.7-1.el4sat-noarch
md5:b1b6fcdfbeb95a524b6b4a6825fe317a spacewalk-koan-0.2.7-7.el4sat-noarch
md5:de72749d9f844ff885acdef9437c7b9f spacewalk-proxy-installer-1.1.2-7.el4sat-noarch
md5:8482ab01b42a7a34c2225c9952cb36f1 spacewalk-remote-utils-1.0.2-6.el4sat-noarch

Red Hat Network Tools for RHEL ES (v.4 for AMD64/Intel EM64T)
md5:81fe97d2153bb9442d045c4f7be4dbed python-urlgrabber-2.9.8-2.el4-noarch
md5:e75930845daf65855a73eac0b825f037 rhnmd-5.3.7-1.el4sat-noarch
md5:b1b6fcdfbeb95a524b6b4a6825fe317a spacewalk-koan-0.2.7-7.el4sat-noarch
md5:8482ab01b42a7a34c2225c9952cb36f1 spacewalk-remote-utils-1.0.2-6.el4sat-noarch

Red Hat Network Tools for RHEL ES (v.4 for x86)
md5:81fe97d2153bb9442d045c4f7be4dbed python-urlgrabber-2.9.8-2.el4-noarch
md5:e75930845daf65855a73eac0b825f037 rhnmd-5.3.7-1.el4sat-noarch
md5:b1b6fcdfbeb95a524b6b4a6825fe317a spacewalk-koan-0.2.7-7.el4sat-noarch
md5:8482ab01b42a7a34c2225c9952cb36f1 spacewalk-remote-utils-1.0.2-6.el4sat-noarch 

I think this needs to be fixed.
Our systems RHEL 4 ES don't see the new rhncfg-... packages !

Comment 17 Jan Blazek 2011-07-26 09:41:27 UTC
The missing packages were linked to RHEL 4 ES channels.


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