[pkg-kolab] r353 - trunk/kolab-cyrus-imapd/debian/patches

Noel Koethe noel at costa.debian.org
Sat Mar 4 22:48:33 UTC 2006


Author: noel
Date: 2006-03-04 22:48:33 +0000 (Sat, 04 Mar 2006)
New Revision: 353

Added:
   trunk/kolab-cyrus-imapd/debian/patches/151-cyrus_kolab_ldap.patch
   trunk/kolab-cyrus-imapd/debian/patches/152-cyrus_auth_pts.patch
Modified:
   trunk/kolab-cyrus-imapd/debian/patches/00list
Log:
add fixing patches for ptclient

Modified: trunk/kolab-cyrus-imapd/debian/patches/00list
===================================================================
--- trunk/kolab-cyrus-imapd/debian/patches/00list	2006-03-04 21:08:13 UTC (rev 352)
+++ trunk/kolab-cyrus-imapd/debian/patches/00list	2006-03-04 22:48:33 UTC (rev 353)
@@ -39,3 +39,5 @@
 130-kolab-imapd-goodchars.dpatch
 140-kolab-ldap.dpatch
 150-kolab-auth_unix
+151-cyrus_kolab_ldap.patch
+152-cyrus_auth_pts.patch

Added: trunk/kolab-cyrus-imapd/debian/patches/151-cyrus_kolab_ldap.patch
===================================================================
--- trunk/kolab-cyrus-imapd/debian/patches/151-cyrus_kolab_ldap.patch	2006-03-04 21:08:13 UTC (rev 352)
+++ trunk/kolab-cyrus-imapd/debian/patches/151-cyrus_kolab_ldap.patch	2006-03-04 22:48:33 UTC (rev 353)
@@ -0,0 +1,82 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 151-cyrus_kolab_ldap.patch by Tobias König <tobias.koenig at credativ.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix ptclient LDAP
+
+ at DPATCH@
+--- kolab-cyrus-imapd-2.2.12-orig/ptclient/ldap.c	2004-06-24 21:28:39.000000000 +0200
++++ kolab-cyrus-imapd-2.2.12/ptclient/ldap.c	2006-03-03 13:02:34.000000000 +0100
+@@ -777,27 +777,16 @@ static int ptsmodule_get_dn(
+     char **ret)
+ {
+     int rc;
+-
+-#if LDAP_VENDOR_VERSION >= 20125
+-    struct berval *dn = NULL;
+-    LDAPControl c;
+-    LDAPControl *ctrl[2];
+-    char *authzid;
+-#else
+-    char *base = NULL, *filter = NULL;
+-    char *attrs[] = {NULL};
+-    LDAPMessage *res;
+-    LDAPMessage *entry;
+-    char *attr, **vals;
+-    BerElement *ber;
+-#endif
+-
+     *ret = NULL;
+ 
+     if (ptsm->ld == NULL)
+         return PTSM_FAIL;
+ 
+-#if LDAP_VENDOR_VERSION >= 20125
++    if (!strcmp(canon_id, "manager") || !strcmp(canon_id, "cyrus")) {
++        struct berval *dn = NULL;
++        LDAPControl c;
++        LDAPControl *ctrl[2];
++        char *authzid;
+ 
+     authzid = xmalloc(size + sizeof("u:"));
+     if (authzid == NULL)
+@@ -827,18 +816,19 @@ static int ptsmodule_get_dn(
+         !strncmp(dn->bv_val, "dn:", 3) )
+         *ret = strdup(dn->bv_val+3);
+     ber_bvfree(dn);
++    } else {
++        char *base = NULL, *filter = NULL;
++        char *attrs[] = {NULL};
++        LDAPMessage *res;
++        LDAPMessage *entry;
+ 
+-#else
+-
+-    rc = ptsmodule_expand_tokens(ptsm->filter, canon_id, NULL, &filter);
+-    if (rc != PTSM_OK)
+-        return rc;
+-
+-    rc = ptsmodule_expand_tokens(ptsm->base, canon_id, NULL, &base);
+-    if (rc != PTSM_OK)
+-        return rc;
++        int filter_size = strlen(canon_id) + sizeof("mail=") + 1;
++        filter = xmalloc(filter_size);
++        memset(filter, 0, filter_size);
++        strcpy(filter, "mail=");
++        strcpy(filter+5, canon_id);
+ 
+-    rc = ldap_search_st(ptsm->ld, base, ptsm->scope, filter, attrs, 0, &(ptsm->timeout), &res);
++        rc = ldap_search_st(ptsm->ld, ptsm->base, ptsm->scope, filter, attrs, 0, &(ptsm->timeout), &res);
+     free(filter);
+     free(base);
+     if (rc != LDAP_SUCCESS) {
+@@ -855,8 +845,7 @@ static int ptsmodule_get_dn(
+ 
+     ldap_msgfree(res);
+     res = NULL;
+-
+-#endif
++    }
+ 
+     return (*ret ? PTSM_OK : PTSM_FAIL);
+ }


Property changes on: trunk/kolab-cyrus-imapd/debian/patches/151-cyrus_kolab_ldap.patch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kolab-cyrus-imapd/debian/patches/152-cyrus_auth_pts.patch
===================================================================
--- trunk/kolab-cyrus-imapd/debian/patches/152-cyrus_auth_pts.patch	2006-03-04 21:08:13 UTC (rev 352)
+++ trunk/kolab-cyrus-imapd/debian/patches/152-cyrus_auth_pts.patch	2006-03-04 22:48:33 UTC (rev 353)
@@ -0,0 +1,25 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 152-cyrus_auth_pts.patch by Tobias König <tobias.koenig at credativ.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix auth pts system
+
+ at DPATCH@
+--- kolab-cyrus-imapd-2.2.12-orig/lib/auth_pts.c	2004-02-25 00:11:37.000000000 +0100
++++ kolab-cyrus-imapd-2.2.12/lib/auth_pts.c	2006-03-02 22:30:40.000000000 +0100
+@@ -86,9 +86,14 @@ int auth_memberof(struct auth_state *aut
+ 		  const char *identifier)
+ {
+     int i;
+-    unsigned idhash = strhash(identifier);
++    unsigned idhash;
+     static unsigned anyonehash = 0;
+ 
++    if (!strncmp(identifier, "group:", 6))
++	idhash = strhash(identifier+6);
++    else
++	idhash = strhash(identifier);
++
+     anyonehash = !anyonehash ? strhash("anyone") : anyonehash;
+     
+     if (!auth_state) {


Property changes on: trunk/kolab-cyrus-imapd/debian/patches/152-cyrus_auth_pts.patch
___________________________________________________________________
Name: svn:executable
   + *




More information about the pkg-kolab-devel mailing list