# User username
SSH_REMOTE_HOST=notmuch
- SSH_CONTROL_PATH="-o ControlPath=/tmp/notmuch-remote.${USER}.%r@%h:%p"
+
+ # Note: for security reasons the control socket is placed in ~/.ssh
+ SSH_CONTROL_PATH='-o ControlPath=~/.ssh/notmuch-remote.%r@%h:%p'
# Start a background master connection if one isn't running yet
ssh ${SSH_CONTROL_PATH} -O check ${SSH_REMOTE_HOST} 2>/dev/null ||
# This requires the bash version of printf (bashism)
printf -v ARGS "%q " "$@"
- ssh ${SSH_CONTROL_PATH} ${SSH_REMOTE_HOST} notmuch ${ARGS}
+ exec ssh ${SSH_CONTROL_PATH} ${SSH_REMOTE_HOST} notmuch ${ARGS}