Skip to content
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

ipa-replica-install: --setup-ca and *-cert-file are mutually exclusive #4802

Closed
wants to merge 2 commits into from

Conversation

flo-renaud
Copy link
Contributor

ipa-replica-install: --setup-ca and *-cert-file are mutually exclusive

ipa-replica-install currently accepts both --setup-ca and *-cert-file
even though the options should be mutually exclusive (either install
CA-less with *-cert-file options or with a CA).

Add a check enforcing the options are mutually exclusive.

Fixes: https://pagure.io/freeipa/issue/8366

ipatests: add a test for ipa-replica-install --setup-ca --http-cert-file

The options *-cert-file are used for a CA-less replica installation and
are mutually exclusive with --setup-ca.
Add a test for this use case.

Related: https://pagure.io/freeipa/issue/8366

@fcami
Copy link
Contributor

fcami commented Jun 10, 2020

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@flo-renaud flo-renaud added trivial needs review Pull Request is waiting for a review labels Jun 10, 2020
@flo-renaud
Copy link
Contributor Author

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@t-woerner t-woerner added the ipa-4-8 Mark for backport to ipa 4.8 label Jun 10, 2020
options.pkinit_cert_files]):
raise ScriptError("--setup-ca and *-cert-file options are "
"mutually exclusive")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've move this to the very top of the function. There is no point in doing all the other work without being able to move forward with the installation.

This actually tries to do an installation and fails:

# ipa-replica-install --setup-ca --http-cert-file=/tmp/foo --dirsrv-cert-file=/tmp/foo --no-pkinit
Configuring client side components
This program will set up FreeIPA client.
Version 4.9.0.dev202006101846+git27b2db9dc

One of password / principal / keytab is required.
The ipa-client-install command failed. See /var/log/ipaclient-install.log for more information
Removing client side components
IPA client is not configured on this system.
The ipa-client-install command failed.

Your system may be partly configured.
Run /usr/sbin/ipa-server-install --uninstall to clean up.

Configuration of client side components failed!
The ipa-replica-install command failed. See /var/log/ipareplica-install.log for more information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, implemented in the new commit.

@rcritten rcritten self-assigned this Jun 10, 2020
ipa-replica-install currently accepts both --setup-ca and *-cert-file
even though the options should be mutually exclusive (either install
CA-less with *-cert-file options or with a CA).

Add a check enforcing the options are mutually exclusive.

Fixes: https://pagure.io/freeipa/issue/8366
The options *-cert-file are used for a CA-less replica installation and
are mutually exclusive with --setup-ca.
Add a test for this use case.

Related: https://pagure.io/freeipa/issue/8366
@rcritten rcritten removed the needs review Pull Request is waiting for a review label Jun 11, 2020
@rcritten rcritten dismissed their stale review June 11, 2020 14:25

Changes applied

@rcritten
Copy link
Contributor

Changes look good. Please remove the temp commit.

@rcritten rcritten added the ack Pull Request approved, can be merged label Jun 12, 2020
@flo-renaud flo-renaud added the pushed Pull Request has already been pushed label Jun 12, 2020
@flo-renaud
Copy link
Contributor Author

master:

  • 51cb631 ipa-replica-install: --setup-ca and *-cert-file are mutually exclusive
  • 98c1017 ipatests: add a test for ipa-replica-install --setup-ca --http-cert-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged ipa-4-8 Mark for backport to ipa 4.8 pushed Pull Request has already been pushed trivial
Projects
None yet
4 participants