-
Notifications
You must be signed in to change notification settings - Fork 122
fix: Create consumer cert & key, when chown failed #3466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jirihnidek
commented
Oct 18, 2024
- When it wasn't possible to change group of consumer key.pem, due to missing SELinux rule, then consumer cert.pem was not created. rhsm.service should write only error log message to rhsm.log in this case
Coverage (computed on Fedora latest) •
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the same checks be added to managerlib.check_identity_cert_perms()
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jirihnidek I have the same question as Pino.
I see there's cert group permissions being set in check_identity_cert_perms
function.
subscription-manager/src/subscription_manager/managerlib.py
Lines 804 to 812 in 268f390
statinfo: os.stat_result = os.stat(cert) | |
if statinfo[stat.ST_UID] != 0 or statinfo[stat.ST_GID] != cert_guid: | |
os.chown(cert, 0, cert_guid) | |
log.warning("Corrected incorrect ownership of %s." % cert) | |
mode: int = stat.S_IMODE(statinfo[stat.ST_MODE]) | |
if mode != ID_CERT_PERMS: | |
os.chmod(cert, ID_CERT_PERMS) | |
log.warning("Corrected incorrect permissions on %s." % cert) |
Is this something that needs to also be updated? Otherwise, LGTM.
f5ded2e
to
a8acf29
Compare
The permission of
You are right that we should try to catch exception in |
* When it wasn't possible to change group of consumer `key.pem`, due to missing SELinux rule, then consumer `cert.pem` was not created. `rhsm.service` should write only error log message to `rhsm.log` in this case * When it is not possible to change ownership of `key.pem` or `cert.pem` later using `check_identity_cert_perms()`, then write only error message to log file
a8acf29
to
7d26a91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!