Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1791666

Summary: PKI parameter -P with null value i.e '' should generate use friendly exception like nullpointer exception instead Traceback error
Product: Red Hat Enterprise Linux 8 Reporter: Pritam Singh <prisingh>
Component: pki-coreAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED UPSTREAM QA Contact: PKI QE <bugzilla-pkiqe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: ascheel, edewata
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-03 18:25:17 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:

Description Pritam Singh 2020-01-16 10:46:15 UTC
Description of problem:
pki parameter -P with null value i.e '' should generate user-friendly exception like null pointer exception instead Traceback error

Failure Param:
pki parameter -P with null value i.e -P ''

Command 1:
[root@pki1 ~]# pki -d /root/nssdb/ -c SECret.123 -P 'http' -p 20080 -n "PKI CA Administrator for Example.Org" ca
Commands:
 ca-authority                      CA management commands
 ca-audit                          Audit management commands
 ca-cert                           Certificate management commands
 ca-feature                        Feature management commands
 ca-group                          Group management commands
 ca-kraconnector                   KRA Connector management commands
 ca-profile                        Profile management commands
 ca-selftest                       Selftest management commands
 ca-user                           User management commands

Command 2:
[root@pki1 ~]# pki -d /root/nssdb/ -c SECret.123 -P '' -p 20080 -n "PKI CA Administrator for Example.Org" ca
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.6/site-packages/pki/cli/main.py", line 255, in <module>
    cli.execute(sys.argv)
  File "/usr/lib/python3.6/site-packages/pki/cli/main.py", line 161, in execute
    if args[i][0] != '-':
IndexError: string index out of range

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

[root@pki1 ~]# rpm -qi pki-ca
Name        : pki-ca
Version     : 10.8.0
Release     : 0.4.module+el8.2.0+5228+a2bc7b32
Architecture: noarch
Install Date: Fri 10 Jan 2020 10:53:42 PM IST
Group       : Unspecified
Size        : 2466776
License     : GPLv2 and LGPLv2
Signature   : RSA/SHA256, Sat 14 Dec 2019 02:59:02 AM IST, Key ID 199e2f91fd431d51
Source RPM  : pki-core-10.8.0-0.4.module+el8.2.0+5228+a2bc7b32.src.rpm
Build Date  : Sat 14 Dec 2019 12:26:29 AM IST
Build Host  : arm64-036.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://www.dogtagpki.org/
Summary     : PKI CA Package


How reproducible:
Very

Steps to Reproduce:
1. See Description Section

Actual results:
It is generating Traceback error

Expected results:
if -P is null i.e -P '' It should throw a null exception

Additional info:

Comment 1 Endi Sukma Dewata 2020-03-03 18:25:17 UTC
This issue will be addressed upstream:
https://pagure.io/dogtagpki/issue/3128