--- libwebsockets-3.2.0.o/lib/misc/lws-struct-sqlite.c 2019-08-14 10:22:50.000000000 +0200 +++ libwebsockets-3.2.0/lib/misc/lws-struct-sqlite.c 2019-11-07 20:03:43.939423877 +0200 @@ -23,6 +23,7 @@ #include #include +#include /* * we get one of these per matching result from the query @@ -253,8 +254,9 @@ } lws_get_effective_uid_gid(context, &uid, &gid); - if (uid) - chown(sqlite3_path, uid, gid); + if (uid && chown(sqlite3_path, uid, gid) < 0) + lwsl_err("%s: Error setting ownership of %s: %s\n", + __func__, sqlite3_path, strerror(errno)); chmod(sqlite3_path, 0600); lwsl_notice("%s: created %s owned by %u:%u mode 0600\n", __func__,