projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e29722
)
unixsock: check return value of chmod
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Sat, 5 Dec 2015 14:16:36 +0000
(15:16 +0100)
committer
Florian Forster
<octo@collectd.org>
Sat, 5 Dec 2015 20:45:57 +0000
(21:45 +0100)
CID #37948
Signed-off-by: Florian Forster <octo@collectd.org>
src/unixsock.c
patch
|
blob
|
history
diff --git
a/src/unixsock.c
b/src/unixsock.c
index
2c1665f
..
8b2f339
100644
(file)
--- a/
src/unixsock.c
+++ b/
src/unixsock.c
@@
-122,7
+122,16
@@
static int us_open_socket (void)
return (-1);
}
- chmod (sa.sun_path, sock_perms);
+ status = chmod (sa.sun_path, sock_perms);
+ if (status == -1)
+ {
+ char errbuf[1024];
+ ERROR ("unixsock plugin: chmod failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ close (sock_fd);
+ sock_fd = -1;
+ return (-1);
+ }
status = listen (sock_fd, 8);
if (status != 0)