[Commits] [SCM] claws branch, master, updated. 3.14.1-113-g72625ef
wwp at claws-mail.org
wwp at claws-mail.org
Tue Jan 10 15:59:37 CET 2017
The branch, master has been updated
via 72625ef0e7aa36459e76733fb34ced337e17f748 (commit)
from 32955775f6308ccc9f09fb0fb2750574427df144 (commit)
Summary of changes:
src/plugins/clamd/libclamd/clamd-plugin.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 72625ef0e7aa36459e76733fb34ced337e17f748
Author: wwp <wwp at free.fr>
Date: Tue Jan 10 15:58:05 2017 +0100
Be more clear about what 108 means here towards the Unix socket
path value lenght: rely on UNIX_PATH_MAX and fallback to its common
value '108' in not defined in un.h (caution, on other systems, it could
be 104, etc. down to 92).
diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c
index 1f05c2c..a305229 100644
--- a/src/plugins/clamd/libclamd/clamd-plugin.c
+++ b/src/plugins/clamd/libclamd/clamd-plugin.c
@@ -301,9 +301,14 @@ static int create_socket() {
}
debug_print("socket file (create): %d\n", new_sock);
addr_u.sun_family = AF_UNIX;
- if (strlen(Socket->socket.path) > 108) {
- g_error("socket path longer than 108-char: %s", Socket->socket.path);
+#ifndef UNIX_PATH_MAX
+#define UNIX_PATH_MAX 108
+#endif
+ if (strlen(Socket->socket.path) > UNIX_PATH_MAX) {
+ g_error("socket path longer than %d-char: %s",
+ UNIX_PATH_MAX, Socket->socket.path);
new_sock = -2;
+#undef UNIX_PATH_MAX
} else {
memcpy(addr_u.sun_path, Socket->socket.path,
strlen(Socket->socket.path));
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list