projects
/
grml-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
grml-chroot: use shell of target's root user
[grml-scripts.git]
/
usr_sbin
/
grml-chroot
diff --git
a/usr_sbin/grml-chroot
b/usr_sbin/grml-chroot
index
b3d1184
..
bdd6bc9
100755
(executable)
--- a/
usr_sbin/grml-chroot
+++ b/
usr_sbin/grml-chroot
@@
-89,7
+89,8
@@
mountit "proc" "proc"
mountit "sysfs" "sys"
mountit "/dev" "dev" "--bind"
if (( $# < 1 )); then
- chroot "$DEST_"
+ shell=$(awk '/^root:/{ split($0,a,":"); print a[7] }' < "$DEST_/etc/passwd")
+ chroot "$DEST_" "$shell"
RC=$?
else
chroot "$DEST_" "$@"