1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

16 commits

Author SHA1 Message Date
Andy Green
5d8cf03221 logs: log contexts 2021-07-01 05:20:53 +01:00
Pavel Otchertsov
9453d246d9 unix: fix usage of getpwnam_r and friends
These functions can return 0 code but still store NULL in result, if no matching group or username found.
Also the buffer of 64 size could be too small to store all string fields in result.
2021-03-25 08:40:52 +00:00
Andy Green
b9ee27f3c5 unix: use getpwnam_r and friends
Figure out if the threadsafe versions are available on the platform and
use them if so
2021-03-25 08:40:52 +00:00
Andy Green
9ed9a04870 unix-caps: switch to unsigned mode for Wconversion 2021-01-19 06:43:27 +00:00
Andy Green
c9731c5f17 type comparisons: fixes
This is a huge patch that should be a global NOP.

For unix type platforms it enables -Wconversion to issue warnings (-> error)
for all automatic casts that seem less than ideal but are normally concealed
by the toolchain.

This is things like passing an int to a size_t argument.  Once enabled, I
went through all args on my default build (which build most things) and
tried to make the removed default cast explicit.

With that approach it neither change nor bloat the code, since it compiles
to whatever it was doing before, just with the casts made explicit... in a
few cases I changed some length args from int to size_t but largely left
the causes alone.

From now on, new code that is relying on less than ideal casting
will complain and nudge me to improve it by warnings.
2021-01-05 10:56:38 +00:00
Andy Green
0ff5a1df75 ctest: sspc proxy minimal
CTest does not directly support daemon spawn as part of the test flow,
we have to specify it as a "fixture" dependency and then hack up daemonization
in a shellscript... this last part unfortunately limits its ability to run to
unix type platforms.

On those though, if the PROXY_API cmake option is enabled, the ctest flow will
spawn the proxy and run lws-minimal-secure-strems-client against it
2020-12-01 15:38:20 +00:00
Andy Green
e2dcbdc81a coverity: 49785: confirm initgroups worked 2020-08-19 07:21:55 +01:00
Andy Green
c4ab815aaf _GNU_SOURCE: only define if not already defined
https://github.com/warmcat/libwebsockets/issues/1803
2019-12-22 18:17:45 +00:00
Andy Green
d7f0521aeb private.h: rename to contain dir
Having unique private header names is a requirement of a particular
platform build system it's desirable to work with
2019-08-15 10:49:52 +01:00
Andy Green
26319663f7 license: switch LGPLv2.1+SLE parts to MIT 2019-08-14 10:44:38 +01:00
Andy Green
80135635bb permissions: adapt drop permissions plat function to do uid and gid lookup separately 2019-05-02 09:28:25 +01:00
Andy Green
1062370f07 unix skt: allow control over skt user:group
If you're providing a unix socket service that will be proxied / served by another
process on the same machine, the unix fd permissions on the listening unix socket fd
have to be managed so only something running under the server credentials
can open the listening unix socket.
2019-03-26 14:54:49 +08:00
Andy Green
ce1f395ead context: add info members to drop privileges using user and group name strings
Up until now if you wanted to drop privs, a numeric uid and gid had to be
given in info to control post-init permissions... this adds info.username
and info.groupname where you can do the same using user and group names.

The internal plat helper lws_plat_drop_app_privileges() is updated to directly use
context instead of info both ways it can be called, and to be able to return fatal
errors.

All failures to lookup non-0 or -1 uid or gid names from uid, or to look up
uid or gid from username or groupnames given, get an err message and fatal exit.
2019-03-26 14:54:49 +08:00
Andy Green
9bed6d6fc6 clean: general whitespace cleanup 2018-11-23 08:47:56 +08:00
Andy Green
33a6034875 codacy: minor fixes 2018-10-13 08:16:27 +08:00
Andy Green
df1d60fc1a plat: refactor private headers and split files
Also remove LWS_VISIBLE that are not necessary from plat apis
2018-06-20 16:41:27 +08:00