Question about cyrus-imapd fastmail patch format

Carlos Horowicz carlos.horowicz at gmail.com
Fri Jan 8 09:01:57 EST 2010


Dear Bron,

I finally managed to include the auditlog patch and companions into
SImon's RPM , but I'm taking my time to test it.

Here are the diff's for both cyrus-imapd.spec and traffic count patch

Thanks a lot !

Carlos


On Fri, Jan 8, 2010 at 6:20 AM, Bron Gondwana <brong at fastmail.fm> wrote:
> On Thu, Dec 31, 2009 at 10:10:48PM -0300, Carlos Horowicz wrote:
>> Dear List,
>
> Sorry about not replying to this before!
>
>> I have a question about adding the auditlog patch into Simon's 2.3.16
>> RPM for Centos which I tried but didn't work, so I'm looking for help.
>>
>> I unpacked Simon's rpm with
>> rpm -Uvh cyrus-imapd-2.3.16-1.src.rpm
>>
>> then copied these two files
>>
>> 0011-add-auditlog-syslog-statements.patch
>> and
>> 0010-calculate-a-global-sessionid-for-every-connection.patch
>>
>> into /usr/src/redhat/SOURCES and after that modified
>> /usr/src/redhat/SPECS/cyrus-imapd.spec:
>>
>> --- cyrus-imapd.spec.ori        2010-01-01 03:34:26.000000000 +0300
>> +++ cyrus-imapd.spec    2010-01-01 03:37:43.000000000 +0300
>> @@ -163,6 +163,8 @@
>>  # fastmail.fm patches
>>  #Patch30: http://cyrus.brong.fastmail.fm/patches/imapd/0012-Clean-Shutdown.patch
>>  Patch30: cyrus-imapd-2.3.15-0012-Clean-Shutdown.patch
>> +Patch31: 0010-calculate-a-global-sessionid-for-every-connection.patch
>> +Patch32: 0011-add-auditlog-syslog-statements.patch
>>  # Patches >= 100 are / will be fixed in CVS
>>  BuildRoot: %{_tmppath}/%{name}-%{version}-root
>>  BuildRequires: cyrus-sasl-devel >= 2.1.17-1, perl, tcp_wrappers
>> @@ -287,6 +289,8 @@
>>  %patch18 -p1 -b .user_deny_verbosity
>>  # fastmail.fm patches
>>  %patch30 -p1 -b .clean-shutdown
>> +%patch31 -p1 -b .0010-calculate-a-global-sessionid-for-every-connection
>> +%patch32 -p1 -b .0011-add-auditlog-syslog-statements
>>
>>  # preserve timestamp of the files for different builds
>>  find . -type f -mtime -1 -exec touch -r %{SOURCE0} {} \;
>>
>>
>> Then
>> cd /usr/src/redhat/SPECS
>> rpmbuild -ba cyrus-imapd.spec
>>
>> and it failed with these error lines:
>>
>> Patch #31 (0010-calculate-a-global-sessionid-for-every-connection.patch):
>> + patch -p1 -b --suffix
>> .0010-calculate-a-global-sessionid-for-every-connection --fuzz=2 -s
>> + echo 'Patch #32 (0011-add-auditlog-syslog-statements.patch):'
>> Patch #32 (0011-add-auditlog-syslog-statements.patch):
>> + patch -p1 -b --suffix .0011-add-auditlog-syslog-statements --fuzz=2 -s
>> 2 out of 2 hunks FAILED -- saving rejects to file imap/imapd.c.rej
>> 2 out of 2 hunks FAILED -- saving rejects to file imap/pop3d.c.rej
>> error: Bad exit status from /var/tmp/rpm-tmp.79051 (%prep)
>
> Auditlog is a bit of a mess at the moment, because it has hooks into so
> many places!  I need to release a copy of the fastmail patches based on
> 2.3.16 so they're up-to-date again.
>
> Otherwise, you can try to patch it all up yourself :)
>
> -p 1 should be correct usually.
>
> Regards,
>
> Bron.
>
-------------- next part --------------
--- ../patches/imapd/0009-traffic-count.patch   2009-08-25 04:22:36.000000000 +0400
+++ 0009-traffic-count.patch    2010-01-04 05:23:35.000000000 +0300
@@ -163,14 +163,13 @@
      return 0;
  }

-@@ -698,6 +702,7 @@ int prot_fill(struct protstream *s)
-           }
-
-           s->cnt--;           /* we return the first char */
-+          s->bytes_in++;
-           return *s->ptr++;
-       }
-     } while (1);
+@@ -698,5 +702,6 @@ int prot_fill(struct protstream *s)
+     }
+
+     s->cnt--;         /* we return the first char */
++    s->bytes_in++;
+     return *s->ptr++;
+ }
 @@ -1097,6 +1102,7 @@ int prot_write(struct protstream *s, const char *buf, unsigned len)
      memcpy(s->ptr, buf, len);
      s->ptr += len;
-------------- next part --------------
--- cyrus-imapd.spec.ori        2010-01-01 03:34:26.000000000 +0300
+++ cyrus-imapd.spec    2010-01-08 16:53:08.000000000 +0300
@@ -162,7 +162,10 @@
 Patch18: cyrus-imapd-2.3.16-user_deny_verbosity.patch
 # fastmail.fm patches
 #Patch30: http://cyrus.brong.fastmail.fm/patches/imapd/0012-Clean-Shutdown.patch
-Patch30: cyrus-imapd-2.3.15-0012-Clean-Shutdown.patch
+Patch30: 0009-traffic-count.patch
+Patch31: 0010-calculate-a-global-sessionid-for-every-connection.patch
+Patch32: 0011-add-auditlog-syslog-statements.patch
+Patch33: cyrus-imapd-2.3.15-0012-Clean-Shutdown.patch
 # Patches >= 100 are / will be fixed in CVS
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: cyrus-sasl-devel >= 2.1.17-1, perl, tcp_wrappers
@@ -286,7 +289,10 @@
 %patch17 -p1 -b .mancyrusdb
 %patch18 -p1 -b .user_deny_verbosity
 # fastmail.fm patches
-%patch30 -p1 -b .clean-shutdown
+%patch30 -p1 -b .0009-traffic-count.patch
+%patch31 -p1 -b .0010-calculate-a-global-sessionid-for-every-connection
+%patch32 -p1 -b .0011-add-auditlog-syslog-statements
+%patch33 -p1 -b .clean-shutdown

 # preserve timestamp of the files for different builds
 find . -type f -mtime -1 -exec touch -r %{SOURCE0} {} \;


More information about the Cyrus-devel mailing list