[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Török Edvin edwin at clamav.net
Sun Apr 4 01:17:27 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit cb9a7b448d9995c875cdc61754c14ec13d2a577e
Author: Török Edvin <edwin at clamav.net>
Date:   Wed Jan 27 10:54:35 2010 +0200

    Improve error message when no ancillary data is received (bb #1700).
    
    On Linux show a message that SELinux/AppArmor might be blocking the file
    descriptor.

diff --git a/clamd/others.c b/clamd/others.c
index aab3d47..f47e8a3 100644
--- a/clamd/others.c
+++ b/clamd/others.c
@@ -282,8 +282,21 @@ static int read_fd_data(struct fd_buf *buf)
       n = recvmsg(buf->fd, &msg, 0);
       if (n < 0)
 	  return -1;
-      if ((msg.msg_flags & MSG_TRUNC) || (msg.msg_flags & MSG_CTRUNC)) {
-	  logg("^Control message truncated");
+      if (msg.msg_flags & MSG_TRUNC) {
+	  logg("^Message truncated at %d bytes\n", n);
+	  return -1;
+      }
+      if (msg.msg_flags & MSG_CTRUNC) {
+	  if (msg.msg_controllen > 0)
+	      logg("^Control message truncated at %d bytes, %d data read\n",
+		   msg.msg_controllen, n);
+	  else
+	      logg("^Control message truncated, no control data received, %d bytes read"
+#ifdef C_LINUX
+		   "(Is SELinux/AppArmor enabled, and blocking file descriptor passing?)"
+#endif
+		   "\n",
+		   n);
 	  return -1;
       }
       if (msg.msg_controllen) {

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list