0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00
Commit Graph

17 Commits

Author SHA1 Message Date
Heiko Hund
bf6d373c93 require a strong PRNG for temp filename generation
Since predictable names for temporary files can potentially cause a
security issue, require such filenames to be generated with
unpredictable randomness.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2023-11-22 04:49:31 +01:00
David Sommerseth
dde1574596
Reformatting source code to new coding style
This is the result after running 'clang-format -i' on all C++ files and
headers, with the defined formatting rules in .clang-format.

Only the openvpn/common/unicode-impl.hpp has been excluded, as that is
mostly a copy of an external project.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-01-18 19:24:15 +01:00
James Yonan
37d312d3e6 write_binary_atomic(): factored out temporary filename creation into new function tmp_filename()
Signed-off-by: James Yonan <james@openvpn.net>
2022-06-29 08:39:22 -06:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
James Yonan
7496383002 write_binary_atomic: reduce the length of the temporary filename
Linux has a filename maximum of 255 chars, but we need to
be careful about the composition of the temporary filename
so that we don't exceed this limitation on the temporary,
even when the original is within the limit.

Signed-off-by: James Yonan <james@openvpn.net>
2019-09-06 22:24:56 -06:00
James Yonan
6ab3793235 write_binary_atomic: remove temporary file on move failure
Signed-off-by: James Yonan <james@openvpn.net>
2018-12-12 23:26:12 -07:00
James Yonan
1eb9cd657c unix file utils: added mtime_ns parameter to write_binary_unix() and write_binary_atomic()
mtime_ns is nanoseconds-since-epoch.

Signed-off-by: James Yonan <james@openvpn.net>
2018-08-30 13:00:27 +03:00
James Yonan
02e786bc92
write_binary_atomic: support ConstBuffer
Signed-off-by: James Yonan <james@openvpn.net>
2018-03-10 02:28:31 +08:00
David Sommerseth
16b10559f2 [OVPN3-140] Update company names in copyrights
OpenVPN Technologies, Inc. change their name to OpenVPN Inc. during the
autumn of 2017.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
David Sommerseth
6caca2c313 [OVPN3-140] Relicense back to AGPLv3
This is essentially a revert of commit 04b2a3c9b7 and commit
ef42e59e05.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
James Yonan
76ee5875a9 write_binary_atomic(): added tmpdir (temporary directory) parameter
Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
1e855667a1 Use openvpn::strerror_str() instead of std::strerror().
std::strerror() doesn't claim to be thread-safe, so
add openvpn::strerror_str() which is thread-safe by
virtue of the fact that it backs to strerror_r().

Signed-off-by: James Yonan <james@openvpn.net>
2017-04-22 17:54:01 -06:00
James Yonan
b2cd82a5bf copyright: updated to 2017.
Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 13:11:09 -06:00
James Yonan
4de93d5f65 write_binary_atomic() changes:
1. now uses write_binary_unix() for performance
2. use a leading '.' in generated temporary filenames
2017-03-18 12:24:54 -06:00
Samuli Seppänen
04b2a3c9b7 Switch from AGPLv3 to GPLv3
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
2017-03-16 14:43:55 +02:00
James Yonan
971abda88f copyright : updated to 2016 2016-09-03 23:29:23 -06:00
James Yonan
fb4a31b9c1 file utilities : added write_binary_atomic() method. 2016-07-12 21:29:50 -07:00