puppetlabs/mcollective-sshkey-security — pull request #6 by neoice (2014-09-23 18:15:09+00:00)
Title: don't use Etc.getlogin

I discovered that `mco` would become confused when called after a `su` or via Jenkins.

additionally, RDoc states: ["Returns the short user name of the currently logged in user. Unfortunately, it is often rather easy to fool getlogin(). Avoid getlogin() for security-related purposes."](http://ruby-doc.org/stdlib-1.9.3/libdoc/etc/rdoc/Etc.html#method-c-getlogin)

replacement code taken from https://github.com/embarkmobile/foreman_god/issues/1