-
Notifications
You must be signed in to change notification settings - Fork 453
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
sudo ohai reports root as current_user instead of the value of SUDO_USER #451
Comments
Yes that was the intent of the PR. |
Thanks @lamont-granquist Is there a recommended way to determine the SUDO_USER within a chef recipe? We used to rely on node['current_user'] for this. Should we use `ENV['SUDO_USER'] or is there an attribute exposed for this? The convenient thing about the old behavior is that it permitted a run list with a mix of recipes that require sudo and recipes that don't. |
Commented on #386 as well, fwiw. |
ENV['SUDO_USER'] is most likely what you want, i think that's better than the old code for current_user for your use case. |
ENV['SUDO_USER'] appears to work well for Sprout, closing this issue. Thanks! |
This behavior appears to have changed in fec9467. Unfortunately the change breaks nearly all the recipes in Pivotal Sprout, which is normally run with sudo on OS X.
Was this change intentional?
Previously:
Now:
The text was updated successfully, but these errors were encountered: