Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1456607 - ipa-server-certinstall mangles arguments to certutil
Summary: ipa-server-certinstall mangles arguments to certutil
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: freeipa
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Krizek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-29 20:47 UTC by James
Modified: 2017-12-12 10:47 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:47:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description James 2017-05-29 20:47:09 UTC
Description of problem:
I was attempting to update my IPA (web) server's certificate with:

  ipa-server-certinstall -v -w new-cert.pem

but I keep getting:

ipa: DEBUG: Starting external process
ipa: DEBUG: args=/usr/bin/certutil -d /etc/httpd/alias -D -n 'skipper.cb.ettle'
ipa: DEBUG: Process finished, return code=255
ipa: DEBUG: stdout=
ipa: DEBUG: stderr=certutil: could not find certificate named "'skipper.cb.ettle'": SEC_ERROR_BAD_DATABASE: security library: bad database.

ipa.ipaserver.install.ipa_server_certinstall.ServerCertInstall: DEBUG:   File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 172, in execute
    return_value = self.run()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_server_certinstall.py", line 113, in run
    self.install_http_cert()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_server_certinstall.py", line 145, in install_http_cert
    'restart_httpd')
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_server_certinstall.py", line 211, in import_cert
    cdb.delete_cert(old_cert)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/certs.py", line 493, in delete_cert
    self.nssdb.delete_cert(nickname)
  File "/usr/lib/python2.7/site-packages/ipapython/certdb.py", line 487, in delete_cert
    self.run_certutil(["-D", "-n", nick])
  File "/usr/lib/python2.7/site-packages/ipapython/certdb.py", line 142, in run_certutil
    return ipautil.run(new_args, stdin, **kwargs)
  File "/usr/lib/python2.7/site-packages/ipapython/ipautil.py", line 515, in run
    raise CalledProcessError(p.returncode, arg_string, str(output))

ipa.ipaserver.install.ipa_server_certinstall.ServerCertInstall: DEBUG: The ipa-server-certinstall command failed, exception: CalledProcessError: Command '/usr/bin/certutil -d /etc/httpd/alias -D -n 'skipper.cb.ettle'' returned non-zero exit status 255
ipa.ipaserver.install.ipa_server_certinstall.ServerCertInstall: ERROR: Command '/usr/bin/certutil -d /etc/httpd/alias -D -n 'skipper.cb.ettle'' returned non-zero exit status 255
ipa.ipaserver.install.ipa_server_certinstall.ServerCertInstall: ERROR: The ipa-server-certinstall command failed.


This seems to be to do with the '' around the host name (skipper.cb.ettle). If I hack /usr/lib/python2.7/site-packages/ipaserver/install/ipa_server_certinstall.py in install_http_cert to strip the '', the cert seems to update OK.

(Note though now when I do /usr/bin/certutil -d /etc/httpd/alias -L I see a full  "E=...CN=..." nickname, so I might have inadvertently bodged up my nssdb....)


Version-Release number of selected component (if applicable):
freeipa-server-4.4.4-1.fc25.x86_64

Comment 1 Martin Babinsky 2017-05-30 11:32:42 UTC
Hi Jim,

I think you hit https://pagure.io/freeipa/issue/6460 which was fixed in FreeIPA 4.5 that was released to Fedora Rawhide.

Comment 2 James 2017-05-30 17:28:17 UTC
Any chance of a backport to 4.4?

Comment 3 Tomas Krizek 2017-05-31 07:19:48 UTC
The patch from comment#1 applies cleanly to 4.4, the backport should be easy. 

Upstream ticket: https://pagure.io/freeipa/issue/6991

Comment 4 Petr Vobornik 2017-06-16 15:25:24 UTC
ipa-4-4:

    e4363c5c26982f9126e7df16ba7a1a060cdb8721 Fix the installutils.set_directive docstring
    e40f9a5183fc3ebe160ea6b6ae4fb5c3190c1462 installutils: improve directive value parsing in get_directive
    67c8f5fd4e50283e7680e7ded142e3234c7ab5f1 Delegate directive value quoting/unquoting to separate functions
    60a05de4122a26f3a9d148b8c014668d296229fc Explicitly handle quoting/unquoting of NSSNickname directive

Comment 5 Fedora Update System 2017-06-29 09:26:59 UTC
freeipa-4.4.4-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7f9288e6d7

Comment 6 Fedora Update System 2017-06-29 16:42:13 UTC
freeipa-4.4.4-4.fc25 softhsm-2.2.0-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-30c570630b

Comment 7 Fedora Update System 2017-06-29 16:42:41 UTC
freeipa-4.4.4-4.fc25 softhsm-2.2.0-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-30c570630b

Comment 8 Fedora Update System 2017-06-30 02:25:09 UTC
freeipa-4.4.4-4.fc25, softhsm-2.2.0-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-30c570630b

Comment 9 Fedora End Of Life 2017-11-16 19:20:57 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 10 Fedora End Of Life 2017-12-12 10:47:28 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.