Actions
Improvements #14040
openBuild warning: unsafe use of tmpnam in SslUtils.C
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/13/2025
Due date:
% Done:
0%
Estimated time:
Description
During the build process, the following warning was displayed:
/usr/bin/ld: CMakeFiles/test.wt.dir/utils/SslUtils.C.o: in function `SslUtils_readPrivateKey::test_method()':
SslUtils.C:(.text+0x71c): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
Impact:
The use of tmpnam is unsafe and can lead to race conditions when creating temporary files, posing a potential security risk.
Suggested action:
Replace tmpnam with mkstemp, which is the recommended and safer alternative according to the C/C++ documentation.
Steps to reproduce:
Run the full project build.
Observe the warning during the linking stage.
Environment:
$ uname -a
Linux instance-20250626-1716 6.14.0-1013-oracle #13~24.04.1-Ubuntu SMP Wed Sep 10 06:43:11 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
$ clang --version
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ cmake --version
cmake version 3.28.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
No data to display
Actions