tMerge branch 'fix_user_home_search' - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 72fcc7c2f5c0d3a51073c241321f7fe11339767a
DIR parent 5d54a3b1212678dc725d63abfdc966684c175b46
HTML Author: Jaromil <jaromil@dyne.org>
Date: Wed, 26 Oct 2011 11:58:19 +0200
Merge branch 'fix_user_home_search'
Diffstat:
M src/tomb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/src/tomb b/src/tomb
t@@ -724,7 +724,7 @@ exec_safe_bind_hooks() {
fi
local MOUNTPOINT="${1}"
local ME=${SUDO_USER:-$(whoami)}
- local HOME=$(grep $ME /etc/passwd | sed "s/^${ME}:.*:.*:.*:.*:\([\/a-z]*\):.*$/\1/" 2>/dev/null)
+ local HOME=$(awk -v a="$ME" -F ':' '{if ($1 == a) print $6}' /etc/passwd 2>/dev/null)
if [ $? -ne 0 ]; then
error "how pitiful! A tomb, and no HOME"
return 1