X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Fpldap.el;h=1d6d65f712db37180124d2413a909d7d8af03af4;hb=a717271e46f76079d48f9f976807cfaeeb0a3f85;hp=5d90138274170d1844df9d20b8d4237d32bcc70a;hpb=e68565651b2b6fc9539a95da15382145088353a5;p=elisp%2Fwanderlust.git diff --git a/elmo/pldap.el b/elmo/pldap.el index 5d90138..1d6d65f 100644 --- a/elmo/pldap.el +++ b/elmo/pldap.el @@ -509,12 +509,12 @@ DN is the distinguished name of the entry to delete." nil (current-buffer) t (append arglist (list dn)))) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)); Nemacs - (string-match "ldap_delete:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)); Nemacs + (string-match "ldap_delete:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defmacro ldap/ldif-insert-field (attr value) (` (if (not (ldap/ldif-safe-string-p (, value))) @@ -567,12 +567,12 @@ or `replace'. ATTR is the LDAP attribute type to modify." ldap-modify-program t t nil arglist)) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)); Nemacs - (string-match "ldap_modify:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)); Nemacs + (string-match "ldap_modify:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defun ldap-add (ldap dn entry) "Add an entry to an LDAP directory. @@ -607,12 +607,12 @@ containing attribute/value string pairs." ldap-add-program t t nil arglist)) - (if (integerp ret) - (if (not (zerop ret)) - (error (car (split-string (buffer-string) "\n")))) - (if (and (setq ret (buffer-string)) ; Nemacs - (string-match "ldap_add:" ret)) - (error (car (split-string ret "\n")))))))) + (cond ((integerp ret) + (or (zerop ret) + (error "%s" (car (split-string (buffer-string) "\n"))))) + ((and (setq ret (buffer-string)) ; Nemacs + (string-match "ldap_add:" ret)) + (error "%s" (car (split-string ret "\n")))))))) (defun ldap-search-basic (ldap filter base scope &optional attrs attrsonly withdn verbose) @@ -691,7 +691,10 @@ entry according to the value of WITHDN." (not (zerop ret)) ;; When openldap's `ldapsearch' exceeds response size limit, ;; it's exit status becomes `4'. - (/= ret 4)) + (/= ret 4) + ;; When openldap's `ldapsearch' uses referral, + ;; it's exit status becomes `32'. + (/= ret 32)) (error "LDAP error: \"No such object\"")) (goto-char (point-min)) (setq start (point))