enter_chroot.sh: bind mount cidb credentials into chroot

Build slaves will store cidb access credentials, which need to be
accessible from inside the chroot.

BUG=chromium:387755
TEST=Entered chroot and verified that credentials directory in my home
directory appeared in chroot home directory.

Change-Id: Ic3379cb22c009c5f8b545f8a46b8cb464e11f36b
Reviewed-on: https://chromium-review.googlesource.com/209684
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index 443d563..1852a6d 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -330,6 +330,11 @@
       chmod 0644 "${p}"
     fi
 
+    if [ -d "${SUDO_HOME}/.cidb_creds" ]; then
+      setup_mount "${SUDO_HOME}/.cidb_creds" --bind \
+        "/home/${SUDO_USER}/.cidb_creds"
+    fi
+
     if [ $FLAGS_ssh_agent -eq $FLAGS_TRUE ]; then
       # Clean up previous ssh agents.
       rmdir "${FLAGS_chroot}"/tmp/ssh-* 2>/dev/null