about summary refs log tree commit diff
path: root/src/download-via-ssh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-25T16·02+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-25T16·02+0200
commit67937907ca7e90bc8fe3019d3c4d6436a8eba7ed (patch)
tree0a06763ab72b6bb6704675ee6a35d001a29b2dc1 /src/download-via-ssh
parent71a20d4d95ad40060857d5da6b813f437267fbb2 (diff)
nix-daemon: Pass on the user's $SSH_AUTH_SOCK to the SSH substituter
Diffstat (limited to 'src/download-via-ssh')
-rw-r--r--src/download-via-ssh/download-via-ssh.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/download-via-ssh/download-via-ssh.cc b/src/download-via-ssh/download-via-ssh.cc
index 0fa089724d7f..466233c7a5e5 100644
--- a/src/download-via-ssh/download-via-ssh.cc
+++ b/src/download-via-ssh/download-via-ssh.cc
@@ -101,6 +101,11 @@ void run(Strings args)
 
     std::cout << std::endl;
 
+    /* Pass on the location of the daemon client's SSH authentication
+       socket. */
+    string sshAuthSock = settings.get("ssh-auth-sock");
+    if (sshAuthSock != "") setenv("SSH_AUTH_SOCK", sshAuthSock.c_str(), 1);
+
     string host = settings.sshSubstituterHosts.front();
     std::pair<FdSink, FdSource> pipes = connect(host);