Commit 28c8a65
committed
(GH-552) Fix home directory evaluation
Prior to this commit the module would fail when executed under the
context of systemd.
This was because Dir.home tries to expand `~` when
no UID is passed.
However the HOME environment variable is not available
when the agent is executed by systemd resulting in the following error:
`Could not evaluate: couldn't find login name -- expanding ~`
This commit fixes this by reverting to using Etc.getpwuid so that we can
retrieve the home dir from the uid of the current process.
For consistency, retrieval of home dirs for a given user has also been
changed to use Etc.getpwnam.1 parent c23a38e commit 28c8a65
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
| 653 | + | |
654 | 654 | | |
| 655 | + | |
655 | 656 | | |
656 | | - | |
| 657 | + | |
657 | 658 | | |
658 | 659 | | |
659 | 660 | | |
| |||
0 commit comments