mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-12-22 18:18:59 +00:00
fix to username parsing in passwd
now using getent, light edit of hellekin's fix in #198
This commit is contained in:
parent
b752980939
commit
b07224beab
15
tomb
15
tomb
@ -1828,10 +1828,10 @@ mount_tomb() {
|
||||
tombhost=$(_cat ${tombmount}/.host)
|
||||
tomblast=$(_cat ${tombmount}/.last)
|
||||
tombuid=$(_cat ${tombmount}/.uid | tr -d ' ')
|
||||
for e in ${(f@)mapfile[/etc/passwd]}; do
|
||||
[[ "$e" =~ ":$tombuid:" ]] && {
|
||||
tombuser="${e[(ws@:@)1]}" }
|
||||
done
|
||||
|
||||
tombuser=$(getent passwd $tombuid)
|
||||
tombuser=${tombuser[(ws@:@)1]}
|
||||
|
||||
_message "Last visit by ::1 user::(::2 tomb build::) from ::3 tty:: on ::4 host::" $tombuser $tombuid $tombtty $tombhost
|
||||
_message "on date ::1 date::" "`date --date=@${tomblast} +%c`"
|
||||
}
|
||||
@ -1993,10 +1993,9 @@ awk "/mapper/"' { print $2 ";" $3 ";" $4 ";" $5 }'`
|
||||
tombtty=$(_cat ${tombmount}/.tty)
|
||||
tombhost=$(_cat ${tombmount}/.host)
|
||||
tombuid=$(_cat ${tombmount}/.uid | tr -d ' ')
|
||||
for ee in ${(f@)mapfile[/etc/passwd]}; do
|
||||
[[ "$ee" =~ ":${tombuid}:" ]] && {
|
||||
tombuser="${ee[(ws@:@)1]}" }
|
||||
done
|
||||
|
||||
tombuser=$(getent passwd $tombuid)
|
||||
tombuser=${tombuser[(ws@:@)1]}
|
||||
}
|
||||
|
||||
{ option_is_set --get-mountpoint } && { print $tombmount; continue }
|
||||
|
Loading…
Reference in New Issue
Block a user