aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpclientauth.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-06-09 12:00:41 +0200
committerGitHub Enterprise <[email protected]>2025-06-09 12:00:41 +0200
commit6f87665745cd432f025215bb259a974dc434964e (patch)
tree6d2592c05d9f66283bf79e74550f3d14f66921d3 /src/zenhttp/httpclientauth.cpp
parentfix namespace picking up wrong argument (#425) (diff)
downloadzen-6f87665745cd432f025215bb259a974dc434964e.tar.xz
zen-6f87665745cd432f025215bb259a974dc434964e.zip
use unique tmp name for auth token file (#426)
* use Oid to generate unique name since std::tmpnam is not good practice
Diffstat (limited to 'src/zenhttp/httpclientauth.cpp')
-rw-r--r--src/zenhttp/httpclientauth.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp
index 916b25bff..39efe1d0c 100644
--- a/src/zenhttp/httpclientauth.cpp
+++ b/src/zenhttp/httpclientauth.cpp
@@ -7,6 +7,7 @@
#include <zencore/process.h>
#include <zencore/scopeguard.h>
#include <zencore/timer.h>
+#include <zencore/uid.h>
#include <zenhttp/auth/authmgr.h>
#include <ctime>
@@ -94,9 +95,8 @@ namespace zen { namespace httpclientauth {
CreateProcOptions ProcOptions;
- const std::string AuthTokenPath = ".zen-auth-oidctoken";
-
- auto _ = MakeGuard([AuthTokenPath]() { RemoveFile(AuthTokenPath); });
+ const std::filesystem::path AuthTokenPath(std::filesystem::temp_directory_path() / fmt::format(".zen-auth-{}", Oid::NewOid()));
+ auto _ = MakeGuard([AuthTokenPath]() { RemoveFile(AuthTokenPath); });
const std::string ProcArgs = fmt::format("{} --AuthConfigUrl {} --OutFile {} --Unattended={}",
OidcExecutablePath,