Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 590852 Details for
Bug 830679
[Patch] Make rhui-manager allows valid RHUI entitlement certificates w/ extension other than ".pem"
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Ensure valid certificates contain entitlements copied w/ '.pem' extension is added and not skipped during certs reload
0003-Ensure-valid-certificates-contain-entitlements-copie.patch (text/plain), 2.31 KB, created by
Satoru SATOH
on 2012-06-11 08:25:43 UTC
(
hide
)
Description:
Ensure valid certificates contain entitlements copied w/ '.pem' extension is added and not skipped during certs reload
Filename:
MIME Type:
Creator:
Satoru SATOH
Created:
2012-06-11 08:25:43 UTC
Size:
2.31 KB
patch
obsolete
>From a8d2a834e9011bb4f92e1f56bdeba28598f5a009 Mon Sep 17 00:00:00 2001 >From: Satoru SATOH <ssato@redhat.com> >Date: Mon, 11 Jun 2012 16:57:38 +0900 >Subject: [PATCH 3/3] Ensure valid certificates contain entitlements copied w/ > '.pem' extension is added and not skipped during certs > reload > >--- > src/rhui/tools/cert_manager.py | 39 +++++++++++++++++++++++++++++++++++++-- > 1 file changed, 37 insertions(+), 2 deletions(-) > >diff --git a/src/rhui/tools/cert_manager.py b/src/rhui/tools/cert_manager.py >index 2516e1b..da59d1c 100644 >--- a/src/rhui/tools/cert_manager.py >+++ b/src/rhui/tools/cert_manager.py >@@ -18,6 +18,7 @@ concatenated into the same file) are managable through this API. > import datetime > import logging > import os >+import os.path > import shutil > > from rhui.common import cert_utils >@@ -262,12 +263,16 @@ class CertificateManager: > # for use in the RHUI > entitlements = cert_utils.entitlements_in_cert(cert_filename) > >+ if not entitlements: # It indicates this certificate is not valid. >+ return >+ > for e in entitlements: > if not _is_valid_download_url(e.download_url): > raise InvalidEntitlement() >- >+ > # Copy the cert and its key to this instance's certificate dir >- shutil.copy(cert_filename, self.cert_dir) >+ dest = os.path.join(self.cert_dir, os.path.basename(_normalize_ext(cert_filename))) >+ shutil.copy(cert_filename, dest) > > # Do a full reload to normalize entitlements and the proper certificate > # that should provide them >@@ -292,3 +297,33 @@ def _is_valid_download_url(download_url): > return True > > return False >+ >+ >+def _normalize_ext(path, ext=CERT_EXTENSION): >+ """ >+ Returns path w/ its extension was replaced to $ext. >+ >+ @param path: filename path >+ @type path: str >+ >+ @param ext: file extension such like ".pem" >+ @type ext: str >+ >+ @return: Modified path >+ @rtype: str >+ >+ >>> _normalize_ext("/a/b/c.crt") >+ '/a/b/c.pem' >+ >>> _normalize_ext("/a/b/c.crt", ".cert") >+ '/a/b/c.cert' >+ >>> _normalize_ext("/a/b/c.pem", ".pem") >+ '/a/b/c.pem' >+ >>> _normalize_ext("/a/b/c/d") >+ '/a/b/c/d.pem' >+ """ >+ if path.endswith(ext): >+ return path >+ >+ (path0, _oext) = os.path.splitext(path) >+ return path0 + ext >+ >-- >1.7.10.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 830679
:
590843
|
590844
|
590845
| 590852