Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: enter_chroot.sh

Issue 6250116: Avoid problems where PW prompt in enter_chroot.sh would block other terminals. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: enter_chroot.sh
diff --git a/enter_chroot.sh b/enter_chroot.sh
index 29ef561291cfc01f3ccc0d09c2c96a0486c8c60c..fd8b4f93e467811d34498c626ea0797453a97f06 100755
--- a/enter_chroot.sh
+++ b/enter_chroot.sh
@@ -107,6 +107,10 @@ sudo chmod 0777 "$FLAGS_chroot/var/lock"
LOCKFILE="$FLAGS_chroot/var/lock/enter_chroot"
function setup_env {
+ # Validate sudo timestamp before entering the critical section so that we
+ # don't stall for a password while we have the lockfile.
+ sudo -v
+
(
flock 200
echo $$ >> "$LOCKFILE"
@@ -223,6 +227,10 @@ function setup_env {
}
function teardown_env {
+ # Validate sudo timestamp before entering the critical section so that we
+ # don't stall for a password while we have the lockfile.
+ sudo -v
+
# Only teardown if we're the last enter_chroot to die
(
flock 200
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698