From: Michal Sojka Date: Sun, 10 May 2009 11:09:55 +0000 (+0200) Subject: proto_unix: Set socket permission rw-rw-rw X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/forb.git/commitdiff_plain/5e67bfa5eb821f2bbd3f223a45f729e5d9f1e14d proto_unix: Set socket permission rw-rw-rw This allows processes of different users to communicates each with the other. --- diff --git a/src/proto_unix.c b/src/proto_unix.c index d8b386d..edf8fbb 100644 --- a/src/proto_unix.c +++ b/src/proto_unix.c @@ -51,6 +51,7 @@ #include #include #include +#include /** * @file proto_unix.c @@ -212,6 +213,7 @@ forb_unix_port_init(struct forb_port_desc *port_desc, const forb_server_id *serv unix_server_to_addr(&pd->addr, server); /* unlink(pd->addr.sun_path); */ /* TODO: What to do when the socket already exist? */ ret = bind(pd->socket, (struct sockaddr*)&pd->addr, sizeof(pd->addr)); + chmod(pd->addr.sun_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (ret == -1) goto err; port_desc->proto = &proto_unix;