Commit 11732e7a authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Get tmp dir from environment (also check TMP and TEMP)

parent 2fcbd536
Pipeline #775831 passed with stage
in 1 minute and 48 seconds
......@@ -43,6 +43,20 @@ TJAlien::TJAlien (const char* gridUrl, const char* uId, const char* passwd,
fGrid = "alien";
gGrid = this;
if (getenv("HOME") != NULL)
homedir = getenv("HOME");
else
homedir = "~";
if (getenv("TMPDIR") != NULL)
tmpdir = getenv("TMPDIR");
else if (getenv("TMP") != NULL)
tmpdir = getenv("TMP");
else if (getenv("TEMP") != NULL)
tmpdir = getenv("TEMP");
else
tmpdir = P_tmpdir;
CreateConnection();
}
......@@ -69,16 +83,6 @@ void TJAlien::CreateConnection()
readBuffer = "";
// Load certificate
if (getenv("HOME") == NULL)
homedir = "~";
else
homedir = getenv("HOME");
if (getenv("TMPDIR") == NULL)
tmpdir = P_tmpdir;
else
tmpdir = getenv("TMPDIR");
std::stringstream tokencert_s, tokenkey_s;
tokencert_s << tmpdir << "/tokencert_" << getuid() << ".pem";
......
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