Commit fe1fd2ec authored by BrLi's avatar BrLi

enter_chroot.sh: add dirmngr socket to forward and bind

parent c9550f7c
......@@ -81,6 +81,7 @@ actual_chroot() {
local socket="$(gpgconf --list-dirs agent-socket)"
local extra_socket="$(gpgconf --list-dirs agent-extra-socket)"
local dirmngr="$(gpgconf --list-dirs dirmngr-socket)"
if [[ -S $socket && -S $extra_socket ]]; then
msg "Found $extra_socket"
......@@ -89,16 +90,16 @@ actual_chroot() {
msg "Could not find $extra_socket, using $socket"
local -n socket_to_bind=socket
else
msg "can't find any main socket"
msg "Can't find any main socket"
fi
if [[ -R socket_to_bind ]]; then
msg "bindind $socket_to_bind to container"
if [[ -R socket_to_bind && -S $dirmngr ]]; then
msg "Bindind $socket_to_bind and $dirmngr to container"
# Ideally we'd get that value from the chroots gpgconf but I don't
# want to actually run systemd-nspawn right here
local chroot_socket="/$gnupg_chroot/S.gpg-agent"
binds+=(--bind-ro="$socket_to_bind":"$chroot_socket")
binds+=(--bind-ro="$socket_to_bind":"/$gnupg_chroot/S.gpg-agent")
binds+=(--bind-ro="$dirmngr":/"$gnupg_chroot/S.dirmngr")
fi
else
msg "I can't find anything about $gnupg, exiting automatic bind process..."
......@@ -107,7 +108,7 @@ actual_chroot() {
local ssh=~/.ssh
if [[ -d $ssh ]]; then
msg "found $ssh, will bind it to container!"
msg "Found $ssh, will bind it to container!"
binds+=(--bind="$ssh":/chakra/.ssh)
if [[ -S "$SSH_AUTH_SOCK" ]]; then
local auth_sock_dir=$(dirname $SSH_AUTH_SOCK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment