From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60203 Path: news.gmane.org!not-for-mail From: Arne =?utf-8?Q?J=C3=B8rgensen?= Newsgroups: gmane.emacs.gnus.general Subject: Re: Ldap certificate retrieval in XEmacs Date: Tue, 26 Apr 2005 14:07:27 +0200 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: <8764y9rbb4.fsf@arnested.dk> References: <878y50zdcl.fsf@seamus.arnested.dk> <874qeaj16v.fsf_-_@seamus.arnested.dk> <8764ypziuj.fsf@seamus.arnested.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1114518291 17466 80.91.229.2 (26 Apr 2005 12:24:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2005 12:24:51 +0000 (UTC) Original-X-From: ding-owner+M8731@lists.math.uh.edu Tue Apr 26 14:24:48 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQP5n-0005U1-Q4 for ding-account@gmane.org; Tue, 26 Apr 2005 14:23:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1DQPAB-0005gY-00; Tue, 26 Apr 2005 07:27:39 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DQPA2-0005gS-00 for ding@lists.math.uh.edu; Tue, 26 Apr 2005 07:27:30 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DQPA0-0003Yz-Ae for ding@lists.math.uh.edu; Tue, 26 Apr 2005 07:27:28 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DQP9z-0004xl-00 for ; Tue, 26 Apr 2005 14:27:27 +0200 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1DQP2s-0004qK-3H for ding@gnus.org; Tue, 26 Apr 2005 14:20:06 +0200 Original-Received: from 213.237.94.152 ([213.237.94.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2005 14:20:05 +0200 Original-Received: from arne by 213.237.94.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2005 14:20:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 146 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.237.94.152 X-Face: 5t,7/Y$&<1A_t.$vC2{pWZ{m@3_06;kcm]no{hgEL/}Uz(>XV6cl4}xO\v?-h3%>znNaZtq `~rf,GY1T%r=a.zH`hOb(-]'x)nI088Z&|e;V^h;/TShou User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:N6DKKeeZPdlrESUy/DXw71Yhygw= X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60203 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60203 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Arne Jørgensen writes: > Arne Jørgensen writes: > >> It actually seems quite simpel to fix. That is if the attached patch >> works (I don't have a working XEmacs/Gnus combination). > > I managed to get a working XEmacs/Gnus and the patch didn't work. > Emacs' ldap-search and Xemacs' ldap-search-entries gives diffrent > results although they have identical parameters. > > An adjusted patch is attach. I have tested it and it works in Emacs > 21.3.1, CVS Emacs and Xemacs 21.4.17. So it should be safe to apply > it. There has been no comments to the change so would someone be so kind to commit it? Kind regards, -- Arne Jørgensen --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=smime-ldap.patch Content-Transfer-Encoding: 8bit Content-Description: Patch to fix compability with XEmacs Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.689 diff -u -p -r7.689 ChangeLog --- lisp/ChangeLog 25 Apr 2005 07:22:34 -0000 7.689 +++ lisp/ChangeLog 26 Apr 2005 11:52:43 -0000 @@ -1,3 +1,9 @@ +2005-04-26 Arne J,Ax(Brgensen + + * smime-ldap.el (smime-ldap-search): Add compatibility for XEmacs. + + * smime.el (smime-cert-by-ldap-1): Adjust for the above. + 2005-04-25 Katsumi Yamaoka * gnus-art.el (article-date-ut): Don't delete X-Sent header when Index: lisp/smime-ldap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime-ldap.el,v retrieving revision 7.3 diff -u -p -r7.3 smime-ldap.el --- lisp/smime-ldap.el 15 Feb 2005 01:58:42 -0000 7.3 +++ lisp/smime-ldap.el 26 Apr 2005 11:52:43 -0000 @@ -31,14 +31,7 @@ ;; made to achieve compatibility with OpenLDAP v2 and to make it ;; possible to retrieve LDAP attributes that are tagged ie ";binary". -;; When Gnus drops support for Emacs 21.x this file can be removed and -;; smime.el changed to - -;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) - -;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; The file also adds a compatibility layer for Emacs and XEmacs. ;;; Code: @@ -57,26 +50,31 @@ its distinguished name WITHDN. Additional search parameters can be specified through `ldap-host-parameters-alist', which see." (interactive "sFilter:") - (if (>= emacs-major-version 22) - (ldap-search filter host attributes attrsonly) - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))) + ;; for XEmacs + (if (fboundp 'ldap-search-entries) + (ldap-search-entries filter host attributes attrsonly) + ;; for Emacs 22 + (if (>= emacs-major-version 22) + (cdr (ldap-search filter host attributes attrsonly)) + ;; for Emacs 21.x + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + result) + (setq result (smime-ldap-search-internal + (append host-plist + (list 'host host + 'filter filter + 'attributes attributes + 'attrsonly attrsonly + 'withdn withdn)))) + (cdr (if ldap-ignore-attribute-codings + result + (mapcar (function + (lambda (record) + (mapcar 'ldap-decode-attribute record))) + result))))))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. Index: lisp/smime.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime.el,v retrieving revision 7.10 diff -u -p -r7.10 smime.el --- lisp/smime.el 31 Mar 2005 20:09:53 -0000 7.10 +++ lisp/smime.el 26 Apr 2005 11:52:44 -0000 @@ -577,9 +577,9 @@ A string or a list of strings is returne host '("userCertificate") nil)) (retbuf (generate-new-buffer (format "*certificate for %s*" mail))) cert) - (if (> (length ldapresult) 1) + (if (>= (length ldapresult) 1) (with-current-buffer retbuf - (setq cert (base64-encode-string (nth 1 (car (nth 1 ldapresult))) t)) + (setq cert (base64-encode-string (cadaar ldapresult) t)) (insert "-----BEGIN CERTIFICATE-----\n") (let ((i 0) (len (length cert))) (while (> (- len 64) i) --=-=-=--