Bug 765816

Summary: [RFE] - Add an option into rhncfg-manager to allow file/directory to be uploaded without setting a SELinux context
Product: [Community] Spacewalk Reporter: Marcelo Moreira de Mello <mmello>
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.6CC: mmello, msuchy, slukasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rhncfg-5.10.22-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 770575 (view as bug list) Environment:
Last Closed: 2011-12-23 10:02:27 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: 737830    
Attachments:
Description Flags
Patch proposed
none
Patch proposed
none
Patch proposed none

Description Marcelo Moreira de Mello 2011-12-09 14:16:29 UTC
Description of problem:

Add an option into rhncfg-client to allow file/directory to be uploaded without setting a SELinux context. i.e. --no-selinux-context | --with-selinux-context=XXXXX

Version-Release number of selected component (if applicable):
Spacewalk 1.6

How reproducible:
100%

  
Actual results:
 
  Currently not able to update a file into a configuration channel without setting an SELinux context. 

Expected results:

 Be able to update a file into a configuration channel without setting an SELinux context. 

Additional info:

Comment 1 Marcelo Moreira de Mello 2011-12-11 13:41:06 UTC
  POC:

# rhncfg-manager add -c bz-selinux  --selinux-context="" /etc/hosts
2011-12-11 11:19:11 rpc_repository.__init__: 
2011-12-11 11:19:11 repository.__init__: server url https://spacewalk.example.com/CONFIG-MANAGEMENT-TOOL
2011-12-11 11:19:11 repository.__init__: ca cert /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
2011-12-11 11:19:12 rpc_repository.assert_repo_health: 
2011-12-11 11:19:12 rhncfg_add.run: 
2011-12-11 11:19:12 rpc_repository.config_channel_exists: bz-selinux
2011-12-11 11:19:12 rpc_repository.list_config_channels: 
Pushing to channel bz-selinux:
2011-12-11 11:19:12 rpc_repository._get_maximum_file_size: 
2011-12-11 11:19:12 rpc_repository.put_file: 
2011-12-11 11:19:12 rpc_repository._get_default_delimiters: 
DEBUG --> params {'size': 158, 'config_channel': 'bz-selinux', 'group': 'root', 'ctime': 1323570931, 'session': '160708x5efbb6e0a95f2c', 'delim_start': '{|', 'file_contents': 'MTI3LjAXXX', 'config_file_type_id': 1, 'delim_end': '|}', 'enc64': 1, 'user': 'root', 'mtime': 1263302902, 'path': '/etc/hosts', 'selinux_ctx': '', 'mode': 644}
Local file /etc/hosts -> remote file /etc/hosts
2011-12-11 11:19:12 rpc_repository.cleanup: 

  Working into this.

Comment 2 Marcelo Moreira de Mello 2011-12-12 18:17:49 UTC
Created attachment 545851 [details]
Patch proposed


  Hello team, 

    Sent to spacewalk-devel maillist  the proposed patches to allow a file to be uploaded overwriting the SELinux context. 

    Mail thread: https://www.redhat.com/archives/spacewalk-devel/2011-December/msg00035.html

 Best Regards, 
mmello

Comment 3 Marcelo Moreira de Mello 2011-12-12 18:18:33 UTC
Created attachment 545853 [details]
Patch proposed

Comment 4 Marcelo Moreira de Mello 2011-12-13 16:39:11 UTC
Created attachment 546276 [details]
Patch proposed

Hello, 

 Per Mirek notes, follow a new better looking patch. 

 Best, 
mmello

Comment 5 Miroslav Suchý 2011-12-13 21:29:45 UTC
commited to spacewalk.git as:
* 31c8dce 765816 - Added the option --selinux-context to rhncfg-manager which allows to overwrite the SELinux context from a fil

Comment 6 Milan Zázrivec 2011-12-23 10:02:27 UTC
Spacewalk 1.6 has been released.