Bug 713098

Summary: adding config file with strict permissions fails when adding into config channel
Product: Red Hat Satellite 5 Reporter: Petr Sklenar <psklenar>
Component: ClientAssignee: Michael Mráka <mmraka>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: high    
Version: 540CC: cperry, dyordano, jhutar, lpramuk
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-20 13:57:44 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: 819027    

Description Petr Sklenar 2011-06-14 10:07:28 UTC
Description of problem:
adding config file with special character fails when adding into config channel

Version-Release number of selected component (if applicable):
rhncfg-management-5.9.27-17.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. have a file with special char, try /etc/shadow
2. rhncfg-manager add -c created-from-ppc-machine /etc/shadow
  
Actual results:
# rhncfg-manager add -c created-from-ppc-machine /etc/shadow
Pushing to channel created-from-ppc-machine:
Traceback (most recent call last):
  File "/usr/bin/rhncfg-manager", line 46, in <module>
    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_management/rhncfg_add.py", line 111, in run
    delim_end=delim_end)
  File "/usr/share/rhn/config_management/rpc_repository.py", line 145, in put_file
    delim_start=delim_start, delim_end=delim_end)
  File "/usr/share/rhn/config_common/repository.py", line 199, in _make_file_info
    params.update(self.make_stat_info(local_path, file_stat))
  File "/usr/share/rhn/config_common/repository.py", line 104, in make_stat_info
    ret['mode'] = deci_to_octal(ret['mode'] & 07777)
  File "/usr/share/rhn/config_common/repository.py", line 51, in deci_to_octal
    return int(oct_str)
ValueError: invalid literal for int() with base 10: '

Expected results:
file is added

Additional info:
this is not Regression

Comment 2 Petr Sklenar 2011-06-14 10:12:20 UTC
it looks like its issue with permssions, when rhncfg cannot read the file (etc/shadow=chmod 0700)

# touch /tmp/a
# chmod a-rw /tmp/a
# ll /tmp/a
----------. 1 root root 0 Jun 14 06:09 /tmp/a
# rhncfg-manager add -c created-from-ppc-machine /tmp/a 
Pushing to channel created-from-ppc-machine:
Traceback (most recent call last):
  File "/usr/bin/rhncfg-manager", line 46, in <module>
    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_management/rhncfg_add.py", line 111, in run
    delim_end=delim_end)
  File "/usr/share/rhn/config_management/rpc_repository.py", line 145, in put_file
    delim_start=delim_start, delim_end=delim_end)
  File "/usr/share/rhn/config_common/repository.py", line 199, in _make_file_info
    params.update(self.make_stat_info(local_path, file_stat))
  File "/usr/share/rhn/config_common/repository.py", line 104, in make_stat_info
    ret['mode'] = deci_to_octal(ret['mode'] & 07777)
  File "/usr/share/rhn/config_common/repository.py", line 51, in deci_to_octal
    return int(oct_str)
ValueError: invalid literal for int() with base 10: ''

Comment 3 Jan Pazdziora (Red Hat) 2012-03-15 15:19:54 UTC
*** Bug 738963 has been marked as a duplicate of this bug. ***

Comment 6 Lukas Pramuk 2013-06-20 13:57:44 UTC

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