From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: (no subject) Date: Thu, 01 Jun 2006 23:14:07 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1149218150 22338 80.91.229.2 (2 Jun 2006 03:15:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2006 03:15:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 02 05:15:48 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fm08Y-0002oO-8E for ged-emacs-devel@m.gmane.org; Fri, 02 Jun 2006 05:15:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fm08X-0005l0-HE for ged-emacs-devel@m.gmane.org; Thu, 01 Jun 2006 23:15:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fm070-00057G-0g for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:14:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fm06y-00056i-Oy for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:14:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fm06y-00056a-ED for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:14:08 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fm0DM-0004P9-48 for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:20:44 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Fm06x-0002oC-Vw for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:14:08 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:55595 Archived-At: Subject: [mjreed@essex.ac.uk: regexp problem in ldap.el?] bcc: rms-outgoing@gnu.org Reply-to: rms@gnu.org --text follows this line-- Would someone please DTRT here, and ack? ------- Start of forwarded message ------- MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 1 Jun 2006 17:37:38 +0100 From: Martin J. Reed To: bug-gnu-emacs@gnu.org Subject: regexp problem in ldap.el? X-Spam-Status: No, score=0.6 required=5.0 tests=HOT_NASTY autolearn=no version=3.0.4 Hi, I have had problems with ldap.el. It seems that the version shipped (and latest CVS) matches erroneous lines in the grabbed output from ldapsearch when SASL authentication is used. The problem may also occur in other situations (I think it is a genuine bug). I have had to apply the following diff (to ldap-1.11.2.10.el grabbed from CVS): - --------------------------->8------------------------------------- diff -u ldap-1.11.2.10.el ldap-1.11.2.10-reed.el - --- ldap-1.11.2.10.el 2006-06-01 17:05:40.000000000 +0100 +++ ldap-1.11.2.10-reed.el 2006-06-01 17:04:41.000000000 +0100 @@ -154,7 +154,7 @@ :type '(string :tag "`ldapsearch' Program") :group 'ldap) - -(defcustom ldap-ldapsearch-args '("-LL" "-tt" "-x") +(defcustom ldap-ldapsearch-args '("-LL" "-tt") "*A list of additional arguments to pass to `ldapsearch'." :type '(repeat :tag "`ldapsearch' Arguments" (string :tag "Argument")) @@ -555,7 +555,7 @@ (setq arglist (nconc arglist (list (format "-z%s" sizelimit))))) (eval `(call-process ldap-ldapsearch-prog nil - - `(,buf nil) + buf nil ,@arglist ,@ldap-ldapsearch-args @@ -580,7 +580,7 @@ (end-of-line) (point)))) (forward-line 1) - - (while (looking-at "^\\(\\w*\\)\\(;\\w*\\)?[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$") + (while (looking-at "^\\(\\w*\\)\\(;\\w*\\)?[=:\t ]+\\(<[\t ]*file://\\)\\(.*\\)$") (setq name (match-string 1) value (match-string 4)) ;; Need to handle file:///D:/... as generated by OpenLDAP - --------------------------->8------------------------------------- The main problem I have is the last change in the diff. The "?" is removed as with it there is a match on "one or none" instances of the "file://". This seems to mean that it grabs any available line not just those with a "file://" in it. Then the defun tries to load files that match the erroneous lines (and fails). The change of ldap-ldapsearch-args is probably not important (although do we want users to use the insecure unencrypted form by default?), also I do not understand why the change from `(,buf nil) to buf is required (probably my elisp ignorance). Example output of ldapsearch that causes a problem (OpenLdap 2.2.28) with cleaned content. The error occurs on the second line where the (looking-at regexp...) matches true and the defun tries to load a file "/home/myhome/username: myusername". - -------------------------->8---------------------------------------- SASL/DIGEST-MD5 authentication started SASL username: myusername SASL SSF: 128 SASL installing layers version: 1 dn: CN=xxxx,OU=xxxxxx,DC=xxxxx,DC=xx,DC=xx objectClass:< file:///tmp/ldapsearch-objectClass-8bcsA7 objectClass:< file:///tmp/ldapsearch-objectClass-wlxT99 objectClass:< file:///tmp/ldapsearch-objectClass-GPNlJc objectClass:< file:///tmp/ldapsearch-objectClass-G4DOif cn:< file:///tmp/ldapsearch-cn-u79hSh sn:< file:///tmp/ldapsearch-sn-YjeMrk title:< file:///tmp/ldapsearch-title-qHNg1m givenName:< file:///tmp/ldapsearch-givenName-8ATLAp initials:< file:///tmp/ldapsearch-initials-83xhas distinguishedName:< file:///tmp/ldapsearch-distinguishedName-uiXNJu - -------------------------->8--------------------------------------- Also there is a problem with ldapsearch from latest OpenLDAP in that it can wrap long lines. Not sure if there is a possible fix in emacs but maybe a warning could be added (I use a wrapper script to get rid of the "bad line wraps"). Otherwise thanks for the updates it works much better than ldap.el shipped with 21.4. Regards, Martin - -- Dr. M.J. Reed Room: 1NW.5.3G Dept. Electronic Systems Engineering Tel:+44 (0)1206 872479 University of Essex, Colchester CO4 3SQ, UK FAX:+44 (0)1206 872900 Email mjreed (non Essex users should add @essex.ac.uk) Web: http://esewww.essex.ac.uk/~mjreed _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs ------- End of forwarded message -------