From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60152 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Arne_J=C3=B8rgensen?= Newsgroups: gmane.emacs.gnus.general Subject: Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) Date: Wed, 13 Apr 2005 14:44:40 +0200 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: <874qeaj16v.fsf_-_@seamus.arnested.dk> References: <878y50zdcl.fsf@seamus.arnested.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1113396532 7840 80.91.229.2 (13 Apr 2005 12:48:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2005 12:48:52 +0000 (UTC) Original-X-From: ding-owner+M8679@lists.math.uh.edu Wed Apr 13 14:48:49 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DLhHa-00024p-5j for ding-account@gmane.org; Wed, 13 Apr 2005 14:47:50 +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 1DLhGd-0004u8-00; Wed, 13 Apr 2005 07:46:51 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DLhGU-0004u2-00 for ding@lists.math.uh.edu; Wed, 13 Apr 2005 07:46:42 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DLhGT-0003bE-LH for ding@lists.math.uh.edu; Wed, 13 Apr 2005 07:46:41 -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 1DLhGR-0002Al-00 for ; Wed, 13 Apr 2005 14:46:39 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DLhCO-00012P-V1 for ding@gnus.org; Wed, 13 Apr 2005 14:42:28 +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 ; Wed, 13 Apr 2005 14:42:28 +0200 Original-Received: from arne by 213.237.94.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Apr 2005 14:42:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 112 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:8MonFfyiyYuzgOX8MKJcNfjM7l8= X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60152 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60152 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Arne Jørgensen writes: > david.goldberg6@verizon.net (David S. Goldberg) writes: > >> (I still haven't had much luck with the new ldap interface, probably >> because I use XEmacs) > > Yes. XEmacs' ldap support is very different from Emacs'. I don't use > XEmacs my self, but will have a look at it anyhow. It will probably > have to wait until eastern because I'm going to Finland on Wednesday. We are several weeks past eastern, but I didn't have the time to look at this before today. It actually seems quite simpel to fix. That is if the attached patch works (I don't have a working XEmacs/Gnus combination). Will someone please try the attached patch to see if it is possible to retrieve a certificate for S/MIME encryption in XEmacs? Kind regards, -- Arne Jørgensen --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=smime-ldap.patch 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 13 Apr 2005 12:44:06 -0000 @@ -35,10 +35,15 @@ ;; smime.el changed to ;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) +;; - and add +;; (defalias 'smime-ldap-search +;; (if (fboundp 'ldap-search-entries) +;; 'ldap-search-entries +;; 'ldap-search)) ;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; version of ldap-search and if we are running XEmacs it uses the +;; build-in ldap-search-entries. ;;; Code: @@ -57,26 +62,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) + (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)))) + (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. --=-=-=--