Gnus development mailing list
 help / color / mirror / Atom feed
From: "Arne Jørgensen" <arne@arnested.dk>
Subject: Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself)
Date: Wed, 13 Apr 2005 14:44:40 +0200	[thread overview]
Message-ID: <874qeaj16v.fsf_-_@seamus.arnested.dk> (raw)
In-Reply-To: <878y50zdcl.fsf@seamus.arnested.dk>

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

Arne Jørgensen <arne@arnested.dk> 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 <http://arnested.dk/>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: smime-ldap.patch --]
[-- Type: text/x-patch, Size: 2531 bytes --]

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.

  reply	other threads:[~2005-04-13 12:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01 16:29 #secure smime signencrypt not working to myself David S. Goldberg
2005-03-06 21:14 ` Arne Jørgensen
2005-04-13 12:44   ` Arne Jørgensen [this message]
2005-04-14 11:27     ` Ldap certificate retrieval in XEmacs Arne Jørgensen
2005-04-14 11:41     ` Arne Jørgensen
2005-04-26 12:07       ` Arne Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874qeaj16v.fsf_-_@seamus.arnested.dk \
    --to=arne@arnested.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).