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

Puppet 3 fixes, cleanup #31

Merged
merged 2 commits into from
Jul 3, 2014
Merged

Puppet 3 fixes, cleanup #31

merged 2 commits into from
Jul 3, 2014

Conversation

foonix
Copy link
Contributor

@foonix foonix commented May 9, 2014

Puppet 3 does not preserve HOME environment variable, causing openssl command to bomb.

Corrected a typo in tests/x509_cert.pp.

@lathiat
Copy link

lathiat commented May 28, 2014

This happens to me with OpenSSL 1.0.1f on Ubuntu 12.04, the issue is not the OpenSSL version.

As the original filer states, Puppet is not setting HOME at all, so while it may be supported in OpenSSL, since it was never set by puppet, it's blank. You can confirm this by running the exact same command in a normal shell with the same template already copied by the puppet module, it succeeds.

The fix for this is to set a default value for HOME.

HOME = .
RANDFILE = $ENV::HOME/.rnd

Both of these lines, being outside any [section], are taken as defaults only if their values aren't otherwise set. So it won't override the real home. This is actually what is in the default openssl config, also shipped on Ubuntu and I presume other distros.

Completely leaving RANDFILE out also works, as it just uses the default.

From OpenSSL documentation ('man 5 config')
If a configuration file attempts to expand a variable that doesn't exist then an error is flagged and the file will not load. This can happen if an attempt is made
to expand an environment variable that doesn't exist. For example in a previous version of OpenSSL the default OpenSSL master configuration file used the value of
HOME which may not be defined on non Unix systems and would cause an error.

   This can be worked around by including a default section to provide a default value: then if the environment lookup fails the default value will be used instead. For
   this to work properly the default value must be defined earlier in the configuration file than the expansion. See the EXAMPLES section for an example of how to do
   this.

@temp
Copy link

temp commented Jun 30, 2014

+1
Stumbled upon this, with the HOME=. fix it works fine.

mcanevet added a commit that referenced this pull request Jul 3, 2014
Puppet 3 fixes, cleanup
@mcanevet mcanevet merged commit ca5bd6a into voxpupuli:master Jul 3, 2014
@mcanevet
Copy link
Member

mcanevet commented Jul 3, 2014

@foonix thaks for your contribution

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.

4 participants