summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-20 02:27:05 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-20 02:31:54 +0200
commit049f86421bfe8afcbb00c7ee5a76fd14841f8bbf (patch)
tree9c98fae9a15b7cd57054a49ce658f55cd6b88c04 /src/socket.c
parentc4e2ceae941d02de5574becbfd3b4db15de2eda3 (diff)
selinux: properly query policy for FIFO files
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/socket.c b/src/socket.c
index 7510a6d6de..d0568c9b52 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -724,15 +724,10 @@ static int socket_open_fds(Socket *s) {
SocketPort *p;
int r;
char *label = NULL;
+ bool know_label = false;
assert(s);
- if ((r = socket_instantiate_service(s)) < 0)
- return r;
-
- if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
- return r;
-
LIST_FOREACH(port, p, s->ports) {
if (p->fd >= 0)
@@ -740,6 +735,17 @@ static int socket_open_fds(Socket *s) {
if (p->type == SOCKET_SOCKET) {
+ if (!know_label) {
+
+ if ((r = socket_instantiate_service(s)) < 0)
+ return r;
+
+ if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
+ return r;
+
+ know_label = true;
+ }
+
if ((r = socket_address_listen(
&p->address,
s->backlog,
@@ -760,7 +766,6 @@ static int socket_open_fds(Socket *s) {
p->path,
s->directory_mode,
s->socket_mode,
- label,
&p->fd)) < 0)
goto rollback;