mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
It had used `id -un`, but it is not always equal to `Etc.getlogin`.
`id` returns the current user of the process, and `Etc.getlogin` returns
the user name logged in on the controlling terminal of the process.
This change uses `logname` by default. `id` remains as a fallback since
there seem to be some platforms where `logname` is not available:
|
||
|---|---|---|
| .. | ||
| shared | ||
| endgrent_spec.rb | ||
| endpwent_spec.rb | ||
| getgrent_spec.rb | ||
| getgrgid_spec.rb | ||
| getgrnam_spec.rb | ||
| getlogin_spec.rb | ||
| getpwent_spec.rb | ||
| getpwnam_spec.rb | ||
| getpwuid_spec.rb | ||
| group_spec.rb | ||
| nprocessors_spec.rb | ||
| struct_group_spec.rb | ||
| struct_passwd_spec.rb | ||