diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenhttp/httpclientauth.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b35eb650d..b9fb237fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Improvement: Optimized check for modified files when verifying state of scavenged paths - Improvement: Process report now indicates if it is pausing or aborting - Improvement: Don't report OOD or OOM errors to Sentry when running `zen builds` commands +- Improvement: Use unique temporary file name when calling OidcToken executable to generate auth token - Bugfix: Zen CLI now initializes Sentry after command line options parsing, so that the options can be propetly taken into account during init - Bugfix: Revert: `zen builds upload` now use the system temp directory for temporary files leaving the source folder untouched - Bugfix: Use selected subcommand when displaying help for failed command line options in zen builds 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, |