Allow group access to the IPC directory

And don't abort if we aren't permitted to chown() it.  The client might
still have the privileges to enter it.
This commit is contained in:
Ferenc Wágner 2019-04-18 13:20:38 +02:00 committed by Jonas Witschel
parent a8301de262
commit 700fb2b27e

View File

@ -660,11 +660,12 @@ handle_new_connection(struct qb_ipcs_service *s,
res = -errno;
goto send_response;
}
res = chown(c->description, c->auth.uid, c->auth.gid);
if (res != 0) {
if (chmod(c->description, 0770)) {
res = -errno;
goto send_response;
}
/* chown can fail because we might not be root */
(void)chown(c->description, c->auth.uid, c->auth.gid);
/* We can't pass just a directory spec to the clients */
strncat(c->description,"/qb", CONNECTION_DESCRIPTION);