diff options
Diffstat (limited to 'src/libstore/ssh.cc')
-rw-r--r-- | src/libstore/ssh.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index 776ffdb83..7ff7a9bff 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -2,6 +2,17 @@ namespace nix { +SSHMaster::SSHMaster(const std::string & host, const std::string & keyFile, bool useMaster, bool compress, int logFD) + : host(host) + , keyFile(keyFile) + , useMaster(useMaster) + , compress(compress) + , logFD(logFD) +{ + if (host == "" || hasPrefix(host, "-")) + throw Error("invalid SSH host name '%s'", host); +} + void SSHMaster::addCommonSSHOpts(Strings & args) { for (auto & i : tokenizeString<Strings>(getEnv("NIX_SSHOPTS"))) |