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

Fixes #11755: Validate absolute path for custom certificates #58

Merged
merged 1 commit into from
Sep 14, 2015

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Apr 15, 2015

No description provided.

@ehelms ehelms force-pushed the remove-validate-present branch from 5be33fe to 6e8b4cb Compare April 15, 2015 20:06
@ehelms
Copy link
Member Author

ehelms commented Jul 9, 2015

@iNecas would you mind reviewing this change?

@@ -112,7 +112,7 @@
) inherits certs::params {

if $server_cert {
validate_file_exists($server_cert, $server_cert_req, $server_key, $server_ca_cert)
validate_absolute_path([$server_cert, $server_cert_req, $server_key, $server_ca_cert])
Copy link
Member

Choose a reason for hiding this comment

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

This is not the same: we need to check that the file really exists. On the other hand, even more checks happen now in https://github.com/Katello/katello-installer/blob/master/hooks/pre/20-certs_update.rb#L62, so I don't have that much issues then

@ehelms ehelms force-pushed the remove-validate-present branch from 6e8b4cb to 6bdb653 Compare September 9, 2015 18:28
@ehelms ehelms changed the title Remove use of functions from puppet-common in favor of stdlib. Fixes #11755: Validate absolute path for custom certificates Sep 9, 2015
@ehelms
Copy link
Member Author

ehelms commented Sep 9, 2015

@iNecas I re-purposed this PR to instead add absolute path validation for custom certificates since this is a common pitfall.

@iNecas
Copy link
Member

iNecas commented Sep 10, 2015

Can there be a case, where the validate_absolute_path would fail and validate_file_exists would pass and the input would be not suitable for the installation?

@ehelms
Copy link
Member Author

ehelms commented Sep 10, 2015

I don't follow the question. If the absolute path check fails, then it
would fail all together?
On Sep 10, 2015 2:44 AM, "Ivan Necas" notifications@github.com wrote:

Can there be a case, where the validate_absolute_path would fail and
validate_file_exists would pass and the input would be not suitable for
the installation?


Reply to this email directly or view it on GitHub
#58 (comment).

@iNecas
Copy link
Member

iNecas commented Sep 10, 2015

I mean if it would not pass the validate_absolute_path criteria, but the check woudln't be there. Basically my question is, what are the now-invalid data that cause the installer to fail, when this patch it not applied?

@ehelms
Copy link
Member Author

ehelms commented Sep 10, 2015

One situation is where you have specified these parameters without an absolute path, and you re-run it from a different location. This is probably less a problem with normal puppet workflows, but when used with something like kafo, if you re-run an installer it will complain about not finding these certs since they are not absolute.

@iNecas
Copy link
Member

iNecas commented Sep 14, 2015

Ok, if this is the case, I agree this will fix it, given it will properly report the error message so that the user knows to use absolute path instead

@ehelms
Copy link
Member Author

ehelms commented Sep 14, 2015

@iNecas is that an ACK or are you asking for something else in addition?

@iNecas
Copy link
Member

iNecas commented Sep 14, 2015

Sry for not being explicit, ACK :)

@ehelms
Copy link
Member Author

ehelms commented Sep 14, 2015

Thanks @iNecas

ehelms added a commit that referenced this pull request Sep 14, 2015
Fixes #11755: Validate absolute path for custom certificates
@ehelms ehelms merged commit 86fc44e into theforeman:master Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants