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

(FACT-1373) Prevent fact calls from external facts #1328

Conversation

HAIL9000
Copy link

@HAIL9000 HAIL9000 commented May 9, 2016

Prior to this commit, it was possible to make a facter call from
within an external fact. This would result in a fork bomb where
facter would be constantly calling into itself. In order to prevent
this, set an environment variable that allows us to ensure facter
is not already running when we make the call to evaluate external
facts.

environment::get("INSIDE_FACTER", inside_facter);

if (inside_facter == "true") {
LOG_WARNING("Facter was called recursively, skipping external facts. Add '--no-external-facts' to silence this warning");
Copy link

@MikaelSmith MikaelSmith May 9, 2016

Choose a reason for hiding this comment

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

It might be worth mentioning that we detected this because INSIDE_FACTER was set to true, in case (somehow) someone accidentally has that in their environment. Or maybe we should just document that somewhere.

@puppetcla
Copy link

CLA signed by all contributors.

@HAIL9000 HAIL9000 force-pushed the issue/master/FACT-1373_prevent_external_fact_fork_bomb branch from 9f03658 to 31ca619 Compare May 9, 2016 23:28
Prior to this commit, it was possible to make a facter call from
within an external fact. This would result in a fork bomb where
facter would be constantly calling into itself. In order to prevent
this, set an environment variable that allows us to ensure facter
is not already running when we make the call to evaluate external
facts.
@HAIL9000 HAIL9000 force-pushed the issue/master/FACT-1373_prevent_external_fact_fork_bomb branch from 31ca619 to 9b104fc Compare May 10, 2016 23:45
@kylog kylog merged commit 15df612 into puppetlabs:master May 11, 2016
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.

None yet

4 participants