mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
enter_chroot: skip ssh agent dir if it is invalid
On long running systems, the ssh-agent dir might go stale. This should not prevent entering the cros chroot though, so skip it if it's invalid. BUG=None TEST=`cros_sdk` enters with ssh-agent dir bind mounted TEST=`rm -rf /tmp/ssh-*/; cros_sdk` enters with ssh-agent dir skipped Change-Id: I923b031612c0d37a896437c7355cac6c448eef82 Reviewed-on: https://gerrit.chromium.org/gerrit/12758 Reviewed-by: David James <davidjames@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
a63da3a776
commit
9de707f77e
@ -257,8 +257,12 @@ function setup_env {
|
||||
# Ignore errors as some people won't have these files to copy.
|
||||
cp "${HOME}"/.ssh/{known_hosts,*.pub} "${TARGET_DIR}/" 2>/dev/null || :
|
||||
copy_ssh_config "${TARGET_DIR}"
|
||||
|
||||
# Don't try to bind mount the ssh agent dir if it has gone stale.
|
||||
ASOCK=${SSH_AUTH_SOCK%/*}
|
||||
queue_mount "${ASOCK}" "--bind" "${ASOCK}"
|
||||
if [ -d "${ASOCK}" ]; then
|
||||
queue_mount "${ASOCK}" "--bind" "${ASOCK}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user