~ubuntu-branches/ubuntu/vivid/clamav/vivid

« back to all changes in this revision

Viewing changes to debian/patches/0018-clamav-milter-add-additinal-SMFIF_-flags-before-invo.patch

  • Committer: Package Import Robot
  • Author(s): Sebastian Andrzej Siewior, Sebastian Andrzej Siewior, Scott Kitterman
  • Date: 2014-11-19 22:28:22 UTC
  • mfrom: (0.48.11 sid)
  • Revision ID: package-import@ubuntu.com-20141119222822-7ehs2eo3wtu99ev3
Tags: 0.98.5+dfsg-1
[ Sebastian Andrzej Siewior ]
* import new upsstream version, refresh patches:
  dropped:
   - LLVM-3.5-version-check-update.patch
   - add-support-for-LLVM-3.5.patch
   - fix-test-failure-on-powerpc-again.patch
  updated:
   - hardcode-LLVM-linker-flag-because-llvm-config-return
   - added "bb-10731-Allow-to-specificy-a-group-for-the-socket-o" as
     dependecy for "clamav-milter-add-additinal-SMFIF_-flags-before-invo"
  (Closes: #763300)
* Add "Bump-.so-version-number", likely the RPM version of 769384.
* Add "llvm-don-t-use-system-libs", since we don't link against .a libs, we
  don't need the deps either.

[ Scott Kitterman ]
* Update libclamav6: embedded-library lintian override for new libclamav6 so
  version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From ef4a9a712e15ffb2bb983cd8f337a7a4954332c6 Mon Sep 17 00:00:00 2001
2
 
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3
 
Date: Sun, 26 Oct 2014 12:11:09 +0100
4
 
Subject: clamav-milter: add additinal SMFIF_* flags before invoking
5
 
 smfi_register()
6
 
 
7
 
unfortunately after the shifting of the code (so that the socket could
8
 
be part of a group which is not part of the clamav user) I forgot (or
9
 
did not see it) to have the header flags added before the
10
 
smfi_register() was invoked. As a result the socket was working but it
11
 
was unable to add the X-Virus-Scanned &  X-Virus-Status flags. This
12
 
patch fixes the issue.
13
 
 
14
 
https://bugzilla.clamav.net/show_bug.cgi?id=10731
15
 
 
16
 
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
17
 
---
18
 
 clamav-milter/clamav-milter.c | 48 ++++++++++++++++++++++++-------------------
19
 
 1 file changed, 27 insertions(+), 21 deletions(-)
20
 
 
21
 
diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c
22
 
index 99e7fe7..22db98a 100644
23
 
--- a/clamav-milter/clamav-milter.c
24
 
+++ b/clamav-milter/clamav-milter.c
25
 
@@ -116,6 +116,33 @@ int main(int argc, char **argv) {
26
 
        }
27
 
     }
28
 
 
29
 
+    pt = optget(opts, "AddHeader")->strarg;
30
 
+    if (strcasecmp(pt, "No")) {
31
 
+       char myname[255];
32
 
+
33
 
+       if (((opt = optget(opts, "ReportHostname"))->enabled &&
34
 
+            strncpy(myname, opt->strarg, sizeof(myname))) ||
35
 
+           !gethostname(myname, sizeof(myname))) {
36
 
+
37
 
+           myname[sizeof(myname)-1] = '\0';
38
 
+           snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s",
39
 
+                    get_version(), myname);
40
 
+       } else {
41
 
+           snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s",
42
 
+                    get_version());
43
 
+       }
44
 
+       xvirushdr[sizeof(xvirushdr)-1] = '\0';
45
 
+
46
 
+       descr.xxfi_flags |= SMFIF_ADDHDRS;
47
 
+
48
 
+       if (strcasecmp(pt, "Add")) { /* Replace or Yes */
49
 
+           descr.xxfi_flags |= SMFIF_CHGHDRS;
50
 
+           addxvirus = 1;
51
 
+       } else { /* Add */
52
 
+           addxvirus = 2;
53
 
+       }
54
 
+    }
55
 
+
56
 
     if(!(my_socket = optget(opts, "MilterSocket")->strarg)) {
57
 
        logg("!Please configure the MilterSocket directive\n");
58
 
        logg_close();
59
 
@@ -323,27 +350,6 @@ int main(int argc, char **argv) {
60
 
        return 1;
61
 
     }
62
 
 
63
 
-    pt = optget(opts, "AddHeader")->strarg;
64
 
-    if(strcasecmp(pt, "No")) {
65
 
-       char myname[255];
66
 
-
67
 
-       if(((opt = optget(opts, "ReportHostname"))->enabled && strncpy(myname, opt->strarg, sizeof(myname))) || !gethostname(myname, sizeof(myname))) {
68
 
-           myname[sizeof(myname)-1] = '\0';
69
 
-           snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s", get_version(), myname);
70
 
-       } else
71
 
-           snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s", get_version());
72
 
-       xvirushdr[sizeof(xvirushdr)-1] = '\0';
73
 
-
74
 
-       descr.xxfi_flags |= SMFIF_ADDHDRS;
75
 
-
76
 
-       if(strcasecmp(pt, "Add")) { /* Replace or Yes */
77
 
-           descr.xxfi_flags |= SMFIF_CHGHDRS;
78
 
-           addxvirus = 1;
79
 
-       } else { /* Add */
80
 
-           addxvirus = 2;
81
 
-       }
82
 
-    }
83
 
-
84
 
     multircpt = optget(opts, "SupportMultipleRecipients")->enabled;
85
 
     
86
 
     if(!optget(opts, "Foreground")->enabled) {