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

20 Commits

Author SHA1 Message Date
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
David Sommerseth
8c94a8f774
copyright: Update to 2022
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-29 12:00:26 +02:00
James Yonan
ff7df50c39 SetUserGroup: extended to support Linux Capabilities
Added SetUserGroupRetainCap, which inherits from SetUserGroup,
and allows a privilege downgrade to retain one or more
Linux Capabilities.

Signed-off-by: James Yonan <james@openvpn.net>
2021-11-24 13:18:35 -07:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
James Yonan
f0e1f8aa42 logging: added basic components for logrotate
Added LogSetup, an abstract base class with a virtual method
reopen() that accomplishes the log file reopen.

Added RunContext::set_log_reopen() method that accepts
a LogSetup object and calls its reopen() method on
SIGHUP.

daemonize() and log_setup() methods in daemon.hpp
now return a LogSetup object.

Signed-off-by: James Yonan <james@openvpn.net>
2019-07-17 10:53:46 -06: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
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
6e8f2a73f8 Moved openvpn::to_string() to separate source file.
Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 15:46:45 -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
ac6c330dc7 UserGroup : Added strict flag to constructor to allow for
construction even when user/group lookup fails.

Updated calls to std::strerror() to use a saved version
of errno.

Added chown(), gid(), and additional defined() methods.

Use uid_t as the return type for uid().
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
93790ab02b usergroup : minor changes:
* Added uid() method.

* Removed "explicit" qualifier from constructors since it
  appears to be superfluous.

* Added "::" prefix to global libc functions.

* Added clarifying comment that SetUserGroup object does not
  own passwd and group objects, therefore *pw and *gr can
  change under us.
2016-07-12 22:02:37 -07:00
James Yonan
ba44de2911 In SetUserGroup (on Linux), retain core dumpability after
setgid/setuid.
2015-07-16 18:51:20 -07:00
James Yonan
56c07b1152 In class SetUserGroup, added invalidate() method.
Also added leading :: to some global functions.
2015-07-04 15:58:47 -06:00
James Yonan
35ac9f6229 Renamed types.hpp to size.hpp since it now only defines
size_t and ssize_t.
2015-05-17 13:27:34 -06:00
James Yonan
fe6fcefa61 C++11 : rename NULL to nullptr 2015-05-17 02:53:37 -06:00
James Yonan
d441693725 Added a second SetUserGroup constructor that accepts std::string
arguments instead of const char *.  Made both constructors
explicit.
2015-04-30 10:34:07 -06:00
James Yonan
69d0a9cefb Added SetUserGroup class for downgrading UID/GID. 2015-01-14 23:50:40 -07:00