Bug 1758759

Summary: katello-certs-check must set LC_TIME for $(date) commands
Product: Red Hat Satellite Reporter: Andreas Bleischwitz <ableisch>
Component: CertificatesAssignee: Chris Roberts <chrobert>
Status: CLOSED CURRENTRELEASE QA Contact: Omkar Khatavkar <okhatavk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: chrobert, ehelms, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-18 01:30:13 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:
Description Flags
Fix for missing LC_TIME environment none

Description Andreas Bleischwitz 2019-10-05 12:29:41 UTC
Created attachment 1622733 [details]
Fix for missing LC_TIME environment

Description of problem:
When invoking katello-certs-check with LC_TIME set to anything else than "C" or "en_US", the comparison of dates will fail.

Version-Release number of selected component (if applicable):
# rpm -qf /usr/sbin/katello-certs-check 

How reproducible:

Steps to Reproduce:
1. export LC_TIME to i.e. "de_DE.utf8"
2. invoke 'katello-certs-check' with valid certs and keys

Actual results:
Checking server certificate encoding: 

date: ungültiges Datum „Okt 5 12:08:34 2019“
Checking expiration of certificate: /usr/sbin/katello-certs-check: Zeile 94: [: -gt: Einstelliger (unärer) Operator erwartet.


Checking expiration of CA bundle: /usr/sbin/katello-certs-check: Zeile 100: [: -gt: Einstelliger (unärer) Operator erwartet.


Expected results:
Checking server certificate encoding: 

Checking expiration of certificate: 

Checking expiration of CA bundle: 

Additional info:

Comment 3 Eric Helms 2020-11-18 01:30:13 UTC
I attempted to test this myself and have not been able to reproduce it. Perhaps there are other factors involved with the system's configuration:

Checking expiration of certificate: de_DE.utf8

Given this works for me against latest Satellite 6.8 I am going to opt to close current release. If you are able to reproduce on the latest release and can provide more details on if there is language differences involved with the generated certificates or how the locale is set on the system.