Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1063787

Summary: Custom info can be added to a system without provisioning entitlement via API and rhn-custom-info tool
Product: Red Hat Satellite 5 Reporter: Lukáš Hellebrandt <lhellebr>
Component: APIAssignee: Grant Gainey <ggainey>
Status: CLOSED CURRENTRELEASE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: dyordano, ggainey, tlestach
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.5.14-21-sat Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-18 14:43:05 UTC Type: Bug
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: 1358815    
Attachments:
Description Flags
patch
none
Updated patch to adjust to code changes none

Description Lukáš Hellebrandt 2014-02-11 12:35:19 UTC
Description of problem:
Custom info can be added to a system without provisioning entitlement via API and rhn-custom-info tool. It can be read via both API and tool and after adding provisioning entitlement, the value is visible via webUI.

How reproducible:

Always. Have a system registered to the satellite and an existing custom info key.

1. Remove the provisioning entitlement from the system
2. Add the custom value to the system via API or a rhn-custom-info tool

client.system.setCustomValues(session, sysID, {keyLabel: keyValue})
OR
rhn-custom-info -u <user> -p <password> -s http://<hostname>/rpc/api keyLabel keyValue

3. Add the provisioning entitlement to the system

Actual results:
The custom value is set

Expected results:
This shouldn't be possible without the provisioning entitlement

Additional info:
Test RHN-Tools/rhn-custom-info (currently workaround)

Comment 1 Dimitar Yordanov 2014-02-19 16:26:11 UTC
Created attachment 865154 [details]
patch

This patch fixes both issues described.

Comment 2 Grant Gainey 2016-02-09 19:30:09 UTC
Created attachment 1122504 [details]
Updated patch to adjust to code changes

Approach is sound, updated to reflect code changes and to add new reason-for-exception to docs

(NOTE: no matching spacewalk change, as spacewalk-master no longer has provisioning entitlements)

Comment 4 Lukáš Hellebrandt 2016-11-11 09:37:44 UTC
Verified with Satellite 5.8 compose and SW nightly from 2016-11-10 (in SW, you can not remove provisioning entitlement so I just checked custom info works).

Note: After setting custom info, removing Provisioning entitlement and returning it back, the custom info persists. I think that is ok.

Comment 5 Grant Gainey 2018-05-18 14:43:05 UTC
This fix was released as part of 5.8GA - closing