Closed chrimsonite closed 5 years ago
We tested our lws client on an Ubuntu machine (version 18.04) with libwebsockets version 3.2.99 (self compiled) and libssl version 1.1.1 (distro supplied) and it ran as expected.
Good. 3.2.99 just means it's master "after v3.2 and before the next release", it probably doesn't matter for this but FYI you need to look at the git hash to determine what it actually is.
[2019/08/28 14:06:10:0299] E: lws_plat_drop_app_privileges: unknown groupname '�'
int
lws_plat_drop_app_privileges(struct lws_context *context, int actually_drop)
{
struct passwd *p;
struct group *g;
/* if he gave us the groupname, align gid to match it */
if (context->groupname) { <<<<<=========
g = getgrnam(context->groupname);
if (g) {
lwsl_info("%s: group %s -> gid %u\n", __func__,
context->groupname, g->gr_gid);
context->gid = g->gr_gid;
} else {
lwsl_err("%s: unknown groupname '%s'\n", __func__, <<<<======
context->groupname);
return 1;
}
}
...
context->groupname
is set to info->groupname
from the context creation info struct (conetxt.c)
context->username = info->username;
context->groupname = info->groupname;
This and the code you have are saying contradictory things... info.groupname
should be NULL from the memset, but apparently it isn't. Maybe dump info.groupname before the call to context create and at the code I pasted (lib/plat/unix/unix-caps.c) to try to see what happened. Your memset() is somehow a NOP?
... another possibility, the libwebsockets.h and friends you built your app against are not the ones from the library but significantly older. The memset is happening but the info struct it has been told about is smaller than the one the library was built for.
You are right! I mistakenly mentioned path to an old version's directory in the makefile for device build. Thanks for your kind help.
Hello,
We are developing an application on an embedded device running Linux, which will use libwebsockets. For testing the library we implemented an lws client to connect to an echo server (wss://echo.websocket.org) and send a random number every second and receive the echoed result.
Following is the code we tested -
cacert.pem is a certificate file we obtained from libcurl's website - https://curl.haxx.se/docs/caextract.html
We tested our lws client on an Ubuntu machine (version 18.04) with libwebsockets version 3.2.99 (self compiled) and libssl version 1.1.1 (distro supplied) and it ran as expected.
On testing the same code on our embeded deivce (ARM9 chip and Linux Kernel version 3.18.20) with libwebsockets version 3.2.99 (self compiled) and libssl version 1.1.1 (self compiled), the code experienced a segfault during context creation, i.e. on calling lws_create_context.
Following is the LWS log when the code was tested on the embedded device at log level 4095 -