summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@delfi.ee>2015-05-31 19:28:29 +0300
committerJoey Hess <joeyh@joeyh.name>2015-06-01 09:13:46 -0400
commit2e88d29b9be766f4cab787d2543197ee7e6afeda (patch)
treebfb3e07299e86ae86b5cb46413d9f40bd42283de
parente1a1ca0b2a7c2e8d104e03e95442d9a3cb528d01 (diff)
use getent(1) from glibc to retrieve user home
-rwxr-xr-xcommit.d/50vcs-commit2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit
index 7c6173f..1d9ade4 100755
--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -43,7 +43,7 @@ if [ "$VCS" = git ] && [ -d .git ]; then
if [ -n "$USER" ]; then
# Use user.name and user.email from the gitconfig belonging
# to the user who became root.
- USER_HOME="$(perl -e 'print ((getpwnam(shift()))[7])' "$USER")"
+ USER_HOME="$(getent passwd "$USER" | cut -d: -f6)"
if [ -n "$USER_HOME" ] && [ -e "$USER_HOME/.gitconfig" ]; then
if [ -z "$GIT_AUTHOR_NAME" ]; then
GIT_AUTHOR_NAME="$(git config -f "$USER_HOME/.gitconfig" user.name)" || true