Bug#577545: cyrus-imapd-2.2: cyrmaster -j (janitor) segfault because of 13-master_process_handling.dpatch

Gonéri Le Bouder goneri at rulezlan.org
Mon Apr 12 15:40:46 UTC 2010


Package: cyrus-imapd-2.2
Version: 2.2.13-19
Severity: important

Hi,

The 13-master_process_handling.dpatch patch breaks the -j option
root at aofr08093:/home/goneri/tmp/cyrus-imapd-2.2-2.2.13# cyrmaster -j
Erreur de segmentation
root at aofr08093:/home/goneri/tmp/cyrus-imapd-2.2-2.2.13# cyrmaster -j 5
Erreur de segmentation

The problem also exists on the 2.3 branch. The fix is trivial, in getopt, the
':'  flag of the -j parameter had been lost. Beacause of that, optarg is not
initialised and cause atoi() to segfault.

diff --git a/debian/patches/13-master_process_handling.dpatch b/debian/patches/13-master_process_handling.dpatch
index d77ad8d..725ddc8 100644
--- a/debian/patches/13-master_process_handling.dpatch
+++ b/debian/patches/13-master_process_handling.dpatch
@@ -159,10 +159,10 @@ diff -urNad cyrus-imapd-2.3-2.3.8~/master/master.c cyrus-imapd-2.3-2.3.8/master/
      if (p) verbose = atoi(p) + 1;
  #ifdef HAVE_NETSNMP
 -    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:P:x:")) != EOF) {
-+    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:P:x:")) != EOF) {
++    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:J:P:x:")) != EOF) {
  #else
 -    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:")) != EOF) {
-+    while ((opt = getopt(argc, argv, "C:M:p:l:DdjJ:")) != EOF) {
++    while ((opt = getopt(argc, argv, "C:M:p:l:Ddj:J:")) != EOF) {
  #endif
        switch (opt) {
        case 'C': /* alt imapd.conf file */





More information about the Pkg-Cyrus-imapd-Debian-devel mailing list