A good place could be a file in =/etc/profile= inside the container(s) you use.
 
 {subsubsection:An alternative workaround}
-Note that if your =sshd= is recent enough and understands =SetEnv= (should be the case starting from versions >=7.8), you could also patch =/usr/libexec/condor/condor_ssh_to_job_sshd_setup= instead and inject the =XAUTHORITY= location via =SetEnv=. In that script, =${base_dir}= refers to the execute directory. This solution has not yet been tested, but should also achieve the expected result.
-However, you will still need the above =condor_xauth_wrapper= for now, to transport over the =DISPLAY= variable by hooking into =sshd=. But as soon as HTCondor learns this in a future version, the lengthy script can be dropped.
+Note that if your =sshd= is recent enough and understands =SetEnv= (should be the case starting from versions >=7.8), you could additionally patch =/usr/libexec/condor/condor_ssh_to_job_sshd_setup=, for example, you could add:
+----
+{verbatim}
+echo "SetEnv JOB_WORKING_DIR=${base_dir}" >> ${sshd_config}
+{endverbatim}
+----
+directly after the =sshd_config= is generated from the template.
+You can then simplify the =/usr/local/bin/condor_xauth_wrapper= script to the much less error-prone code:
+----
+{verbatim}
+#!/bin/bash
+
+# Ugly hack needed with HTCondor 8.8.10 which does not yet pass through DISPLAY.
+echo "export DISPLAY=${DISPLAY}" > ${JOB_WORKING_DIR}/.display
+
+export XAUTHORITY=${JOB_WORKING_DIR}/.Xauthority
+
+/usr/bin/xauth "$@" </dev/stdin
+{endverbatim}
+----
+Note that we can not =SetEnv= the variable =XAUTHORITY= directly with =SetEnv=, it is overwritten by =sshd= after setting the defined environment variables.