summaryrefslogtreecommitdiff
path: root/net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch')
-rw-r--r--net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch b/net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch
new file mode 100644
index 000000000000..3dafd60e7315
--- /dev/null
+++ b/net-libs/libwebsockets/files/libwebsockets-3.2.0-check_chown_result.patch
@@ -0,0 +1,22 @@
+--- 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 <core/private.h>
+
+ #include <sqlite3.h>
++#include <string.h>
+
+ /*
+ * 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__,