diff -Nru rabbitmq-server-2.7.1/codegen/amqp_codegen.py rabbitmq-server-2.8.4/codegen/amqp_codegen.py
--- rabbitmq-server-2.7.1/codegen/amqp_codegen.py 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/amqp_codegen.py 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
## The Original Code is RabbitMQ.
##
## The Initial Developer of the Original Code is VMware, Inc.
-## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+## Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
##
from __future__ import nested_scopes
diff -Nru rabbitmq-server-2.7.1/codegen/amqp-rabbitmq-0.8.json rabbitmq-server-2.8.4/codegen/amqp-rabbitmq-0.8.json
--- rabbitmq-server-2.7.1/codegen/amqp-rabbitmq-0.8.json 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/amqp-rabbitmq-0.8.json 2012-06-22 16:03:48.000000000 +0000
@@ -4,7 +4,7 @@
"minor-version": 0,
"port": 5672,
"copyright": [
- "Copyright (C) 2008-2011 VMware, Inc.\n",
+ "Copyright (C) 2008-2012 VMware, Inc.\n",
"\n",
"Permission is hereby granted, free of charge, to any person\n",
"obtaining a copy of this file (the \"Software\"), to deal in the\n",
diff -Nru rabbitmq-server-2.7.1/codegen/amqp-rabbitmq-0.9.1.json rabbitmq-server-2.8.4/codegen/amqp-rabbitmq-0.9.1.json
--- rabbitmq-server-2.7.1/codegen/amqp-rabbitmq-0.9.1.json 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/amqp-rabbitmq-0.9.1.json 2012-06-22 16:03:48.000000000 +0000
@@ -5,7 +5,7 @@
"revision": 1,
"port": 5672,
"copyright": [
- "Copyright (C) 2008-2011 VMware, Inc.\n",
+ "Copyright (C) 2008-2012 VMware, Inc.\n",
"\n",
"Permission is hereby granted, free of charge, to any person\n",
"obtaining a copy of this file (the \"Software\"), to deal in the\n",
diff -Nru rabbitmq-server-2.7.1/codegen/demo_extension.json rabbitmq-server-2.8.4/codegen/demo_extension.json
--- rabbitmq-server-2.7.1/codegen/demo_extension.json 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/demo_extension.json 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
"extension": {
"name": "demo",
"version": "1.0",
- "copyright": "Copyright (C) 2009-2011 VMware, Inc."
+ "copyright": "Copyright (C) 2009-2012 VMware, Inc."
},
"domains": [
["foo-domain", "shortstr"]
diff -Nru rabbitmq-server-2.7.1/codegen/license_info rabbitmq-server-2.8.4/codegen/license_info
--- rabbitmq-server-2.7.1/codegen/license_info 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/license_info 2012-06-22 16:03:48.000000000 +0000
@@ -1,4 +1,4 @@
The files amqp-rabbitmq-0.8.json and amqp-rabbitmq-0.9.1.json are
-"Copyright (C) 2008-2011 VMware", Inc. and are covered by the MIT
+"Copyright (C) 2008-2012 VMware", Inc. and are covered by the MIT
license.
diff -Nru rabbitmq-server-2.7.1/codegen/LICENSE-MPL-RabbitMQ rabbitmq-server-2.8.4/codegen/LICENSE-MPL-RabbitMQ
--- rabbitmq-server-2.7.1/codegen/LICENSE-MPL-RabbitMQ 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen/LICENSE-MPL-RabbitMQ 2012-06-22 16:03:48.000000000 +0000
@@ -447,7 +447,7 @@
The Original Code is RabbitMQ.
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2007-2011 VMware, Inc. All rights reserved.''
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.''
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
diff -Nru rabbitmq-server-2.7.1/codegen.py rabbitmq-server-2.8.4/codegen.py
--- rabbitmq-server-2.7.1/codegen.py 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/codegen.py 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
## The Original Code is RabbitMQ.
##
## The Initial Developer of the Original Code is VMware, Inc.
-## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+## Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
##
from __future__ import nested_scopes
@@ -118,7 +118,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
%%"""
def genErl(spec):
diff -Nru rabbitmq-server-2.7.1/debian/changelog rabbitmq-server-2.8.4/debian/changelog
--- rabbitmq-server-2.7.1/debian/changelog 2012-03-29 14:47:46.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/changelog 2012-07-11 09:38:32.000000000 +0000
@@ -1,85 +1,44 @@
-rabbitmq-server (2.7.1-0ubuntu4) precise; urgency=low
+rabbitmq-server (2.8.4-1) unstable; urgency=low
- [ Dave Walker ]
- * debian/rabbitmq-script-wrapper: Use start-stop-daemon instead of su
- to run the commands. This also allows rabbitmq to start on the
- installer if invoke-rc.d is used with --force. (LP: #966269)
-
- [ Andres Rodriguez ]
- * debian/rabbitmq-server.init: Use --no-wait in initctl emit command to
- not stall apt-get installations. (LP: #968124)
-
- -- Andres Rodriguez Thu, 29 Mar 2012 10:46:26 -0400
-
-rabbitmq-server (2.7.1-0ubuntu3) precise; urgency=low
-
- * debian/rabbitmq-server.init: emit 'rabbitmq-server-running' signal for
- upstart as MAAS needs it.
-
- -- Andres Rodriguez Tue, 27 Mar 2012 14:49:05 -0400
+ * New upstream release
-rabbitmq-server (2.7.1-0ubuntu2) precise; urgency=low
+ -- Emile Joubert Fri, 22 Jun 2012 17:48:28 +0100
- [ Marc Cluet ]
- * Add new rabbitmq-erlang-client and rabbitmq-stomp binary packages as
- plugins are now part of rabbitmq-server core (LP: #948993):
- - d/rules: Refactored to support multiple binary packages, enable
- .d style configuration of rabbitmq for plugins.
- - d/rabbitmq-stomp.[postinst|postrm|install]: Install configuration
- for stomp, enable/disable stomp plugin and restart as required.
- - d/rabbitmq-erlang-client.[postinst|postrm]: Enable/disable amqp_client
- plugin and restart as required.
- - d/rabbitmq-server.*: Renamed to support multiple binary packages.
- - d/rabbitmq-server.dirs: Added rabbitmq.conf.d dir for .d configuration
- files.
- - d/rabbitmq-server.postrm.in: Avoid deletion of rabbitmq user on purge.
- * Switched to source/format 3.0 (quilt):
- - d/patches/inets-plugins.patch: Fixup path to httpd.hrl.
+rabbitmq-server (2.8.3-1) unstable; urgency=low
- [ James Page ]
- * d/control: rabbitmq-server needs to Break/Replace
- rabbitmq-plugins-common < 2.7.1.
- * d/rabbitmq-server.links: Fixup link to point to 2.7.1 install.
- * d/rabbitmq-server.init: Restore fix to use start-stop-daemon (LP: #913464).
+ * New upstream release
- -- Marc Cluet Mon, 12 Mar 2012 08:58:42 +0000
+ -- Emile Joubert Thu, 21 Jun 2012 13:38:57 +0100
-rabbitmq-server (2.7.1-0ubuntu1) precise; urgency=low
+rabbitmq-server (2.8.2-2) unstable; urgency=low
- * New upstream release. (LP: #922600)
- * Apply patch to include inets from the appropriate place. Fixes
- FTBFS.
- * d/control: adding necessary build-deps for 2.7.1
+ * Add version numbers to plugins
- -- Clint Byrum Tue, 28 Feb 2012 09:55:49 -0800
+ -- Emile Joubert Tue, 01 May 2012 10:48:57 +0100
-rabbitmq-server (2.6.1-1ubuntu4) precise; urgency=low
+rabbitmq-server (2.8.2-1) unstable; urgency=low
- * Use start-stop-daemon in the init script, removing usage of su
- (LP: #913464)
+ * New upstream release
- -- Thomas Hervé Fri, 27 Jan 2012 14:58:19 +0100
+ -- Emile Joubert Mon, 30 Apr 2012 14:07:32 +0100
-rabbitmq-server (2.6.1-1ubuntu3) precise; urgency=low
+rabbitmq-server (2.8.1-1) unstable; urgency=low
- * Fix broken init script.
+ * New upstream release
- -- Chuck Short Sun, 13 Nov 2011 22:48:59 -0500
+ -- Emile Joubert Fri, 23 Mar 2012 10:05:24 +0000
-rabbitmq-server (2.6.1-1ubuntu2) precise; urgency=low
+rabbitmq-server (2.8.0-1) unstable; urgency=low
- * close file handles of rabbitmq-server daemon in init script (LP: #878600)
- * fix dpkg failure on purge (LP: #878597)
+ * New upstream release
- -- Scott Moser Tue, 25 Oct 2011 12:51:20 -0400
+ -- Emile Joubert Tue, 20 Mar 2012 11:55:10 +0000
-rabbitmq-server (2.6.1-1ubuntu1) precise; urgency=low
+rabbitmq-server (2.6.1-2) unstable; urgency=low
- * Merge from debian unstable. Remaining changes:
- - symlink erlang libraries in a rabbit-common specific location.
- - Added explicit log line in startup_* and shutdown_* (LP: #838959)
+ * Add DM-Upload-Allowed flag to control file to allow Maintainer uploads
- -- Chuck Short Wed, 28 Sep 2011 01:05:54 +0000
+ -- John Leuner Mon, 19 Mar 2012 21:13:54 +0200
rabbitmq-server (2.6.1-1) unstable; urgency=low
@@ -87,40 +46,12 @@
-- John Leuner Tue, 27 Sep 2011 17:53:57 +0200
-rabbitmq-server (2.5.0-1ubuntu2) oneiric; urgency=low
-
- * Added explicit log line in startup_* and shutdown_* (LP: #838959)
- - Added a log line with a timestamp to indicate either the success or
- failure on startup/shutdown
-
- -- Marc Cluet Wed, 14 Sep 2011 17:56:32 +0200
-
-rabbitmq-server (2.5.0-1ubuntu1) oneiric; urgency=low
-
- * Merge from Debian Unstable. Remaining changes:
- - symlink erlang libraries in a rabbit-common specific location.
-
- -- Dave Walker (Daviey) Sun, 19 Jun 2011 18:18:49 +0100
-
rabbitmq-server (2.5.0-1) unstable; urgency=low
* New upstream release
-- John Leuner Thu, 16 Jun 2011 09:55:40 +0200
-rabbitmq-server (2.4.1-1ubuntu2) oneiric; urgency=low
-
- * Fixed libraries soft link for 2.4.1 release
-
- -- Marc Cluet Thu, 26 May 2011 02:39:10 -0700
-
-rabbitmq-server (2.4.1-1ubuntu1) oneiric; urgency=low
-
- * Merge from debian unstable. Remaining changes:
- - symlink erlang libraries in a rabbit-cmmon specific location.
-
- -- Chuck Short Mon, 02 May 2011 13:15:56 +0100
-
rabbitmq-server (2.4.1-1) unstable; urgency=low
* New upstream release
@@ -133,13 +64,6 @@
-- John Leuner Wed, 23 Mar 2011 21:11:17 +0200
-rabbitmq-server (2.3.1-1ubuntu1) natty; urgency=low
-
- * fix rabbitmq-stomp FTBFS, which requires erlang libraries in a
- rabbit-common specific location; solve with a symlink
-
- -- Dustin Kirkland Tue, 19 Apr 2011 15:32:28 -0400
-
rabbitmq-server (2.3.1-1) unstable; urgency=low
* New upstream release, closes: #611253
@@ -298,4 +222,3 @@
* First Debian upload, closes: #507902
-- John Leuner Wed, 17 Dec 2008 18:23:47 +0000
-
diff -Nru rabbitmq-server-2.7.1/debian/conf/rabbitmq.conf.d/50_stomp rabbitmq-server-2.8.4/debian/conf/rabbitmq.conf.d/50_stomp
--- rabbitmq-server-2.7.1/debian/conf/rabbitmq.conf.d/50_stomp 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/conf/rabbitmq.conf.d/50_stomp 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-RABBITMQ_SERVER_START_ARGS='-rabbitmq_stomp tcp_listeners [{"0.0.0.0",61613},{"0.0.0.0",6163}]'
diff -Nru rabbitmq-server-2.7.1/debian/conf/rabbitmq-env.conf rabbitmq-server-2.8.4/debian/conf/rabbitmq-env.conf
--- rabbitmq-server-2.7.1/debian/conf/rabbitmq-env.conf 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/conf/rabbitmq-env.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-for CONFIGFILE in `ls /etc/rabbitmq/rabbitmq.conf.d |sort -r`; do
- . /etc/rabbitmq/rabbitmq.conf.d/$CONFIGFILE
-done
diff -Nru rabbitmq-server-2.7.1/debian/control rabbitmq-server-2.8.4/debian/control
--- rabbitmq-server-2.7.1/debian/control 2012-03-12 09:27:19.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/control 2012-07-11 09:38:32.000000000 +0000
@@ -1,36 +1,17 @@
Source: rabbitmq-server
Section: net
Priority: extra
-Maintainer: Ubuntu Developers
-XSBC-Original-Maintainer: RabbitMQ Team
-Build-Depends: cdbs, debhelper (>= 5), quilt, erlang-dev, python-simplejson, xmlto, xsltproc, git, zip, unzip, erlang-asn1, erlang-inets
-Standards-Version: 3.9.3
+Maintainer: RabbitMQ Team
+Uploaders: Emile Joubert
+DM-Upload-Allowed: yes
+Build-Depends: cdbs, debhelper (>= 5), erlang-dev, python-simplejson, xmlto, xsltproc, erlang-nox (>= 1:12.b.3), erlang-src (>= 1:12.b.3), unzip, zip
+Standards-Version: 3.8.0
Package: rabbitmq-server
Architecture: all
-Breaks: rabbitmq-plugins-common (<< 2.7.1)
-Replaces: rabbitmq-plugins-common (<< 2.7.1)
Depends: erlang-nox (>= 1:12.b.3), adduser, logrotate, ${misc:Depends}
Description: An AMQP server written in Erlang
RabbitMQ is an implementation of AMQP, the emerging standard for high
performance enterprise messaging. The RabbitMQ server is a robust and
scalable implementation of an AMQP broker.
Homepage: http://www.rabbitmq.com/
-
-Package: rabbitmq-erlang-client
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, rabbitmq-server (= ${binary:Version})
-Description: Erlang client for RabbitMQ
- This client offers both a networked version that uses standard TCP-based AMQP
- framing and a direct client that uses native Erlang message passing to a
- RabbitMQ broker.
-
-Package: rabbitmq-stomp
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, rabbitmq-server (>= 2.7.1),
- rabbitmq-erlang-client (= ${binary:Version})
-Suggests: ruby
-Description: A STOMP gateway for RabbitMQ
- Gateway for exposing AMQP functionality via the STOMP protocol, as
- implemented by many clients for various programming languages, and a few other
- servers besides RabbitMQ.
diff -Nru rabbitmq-server-2.7.1/debian/copyright rabbitmq-server-2.8.4/debian/copyright
--- rabbitmq-server-2.7.1/debian/copyright 2012-03-12 08:58:37.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/copyright 2012-07-11 09:38:32.000000000 +0000
@@ -3,12 +3,44 @@
It was downloaded from http://www.rabbitmq.com/
-The files codegen/amqp-rabbitmq-0.8.json and
-codegen/amqp-rabbitmq-0.9.1.json are covered by the following terms:
- "Copyright (C) 2008-2011 VMware, Inc.
+This package, the RabbitMQ server is licensed under the MPL.
- Permission is hereby granted, free of charge, to any person
+If you have any questions regarding licensing, please contact us at
+info@rabbitmq.com.
+
+The files amqp-rabbitmq-0.8.json and amqp-rabbitmq-0.9.1.json are
+"Copyright (C) 2008-2012 VMware", Inc. and are covered by the MIT
+license.
+
+Webmachine is Copyright (c) Basho Technologies and is covered by the
+Apache License 2.0. It was downloaded from http://webmachine.basho.com/
+
+glMatrix is "Copyright (c) 2011, Brandon Jones" and is covered by the
+BSD 2-Clause license. It was downloaded from
+http://code.google.com/p/glmatrix/
+
+Eldap is "Copyright (c) 2010, Torbjorn Tornkvist" and is covered by
+the MIT license. It was downloaded from https://github.com/etnt/eldap
+
+jQuery is "Copyright (c) 2010 John Resig" and is covered by the MIT
+license. It was downloaded from http://jquery.com/
+
+EJS is "Copyright (c) 2007 Edward Benson" and is covered by the MIT
+license. It was downloaded from http://embeddedjs.com/
+
+Sammy is "Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC" and is
+covered by the MIT license. It was downloaded from
+http://code.quirkey.com/sammy/
+
+Mochiweb is "Copyright (c) 2007 Mochi Media, Inc." and is covered by
+the MIT license. It was downloaded from
+http://github.com/mochi/mochiweb/
+
+
+The MIT license is as follows:
+
+ "Permission is hereby granted, free of charge, to any person
obtaining a copy of this file (the Software), to deal in the
Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute,
@@ -28,11 +60,42 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE."
+
+The BSD 2-Clause license is as follows:
+
+ "Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the
+ following conditions are met:
+
+ 1. Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+
The rest of this package is licensed under the Mozilla Public License 1.1
Authors and Copyright are as described below:
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
MOZILLA PUBLIC LICENSE
@@ -484,7 +547,7 @@
The Original Code is RabbitMQ.
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2007-2011 VMware, Inc. All rights reserved.''
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.''
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
@@ -492,11 +555,6 @@
Original Code Source Code for Your Modifications.]
-
-
-
-If you have any questions regarding licensing, please contact us at
-info@rabbitmq.com.
-
-The Debian packaging is (C) 2007-2011, VMware, Inc. and is licensed
+The Debian packaging is (C) 2007-2012, VMware, Inc. and is licensed
under the MPL 1.1, see above.
+
diff -Nru rabbitmq-server-2.7.1/debian/dirs rabbitmq-server-2.8.4/debian/dirs
--- rabbitmq-server-2.7.1/debian/dirs 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/dirs 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,9 @@
+usr/lib/rabbitmq/bin
+usr/lib/erlang/lib
+usr/sbin
+usr/share/man
+var/lib/rabbitmq/mnesia
+var/log/rabbitmq
+etc/logrotate.d
+etc/rabbitmq
+
diff -Nru rabbitmq-server-2.7.1/debian/LICENSE.head rabbitmq-server-2.8.4/debian/LICENSE.head
--- rabbitmq-server-2.7.1/debian/LICENSE.head 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/LICENSE.head 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,5 @@
+This package, the RabbitMQ server is licensed under the MPL.
+
+If you have any questions regarding licensing, please contact us at
+info@rabbitmq.com.
+
diff -Nru rabbitmq-server-2.7.1/debian/LICENSE.tail rabbitmq-server-2.8.4/debian/LICENSE.tail
--- rabbitmq-server-2.7.1/debian/LICENSE.tail 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/LICENSE.tail 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,516 @@
+
+The MIT license is as follows:
+
+ "Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this file (the Software), to deal in the
+ Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute,
+ sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE."
+
+
+The BSD 2-Clause license is as follows:
+
+ "Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the
+ following conditions are met:
+
+ 1. Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+
+The rest of this package is licensed under the Mozilla Public License 1.1
+Authors and Copyright are as described below:
+
+ The Initial Developer of the Original Code is VMware, Inc.
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
+
+
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is RabbitMQ.
+
+ The Initial Developer of the Original Code is VMware, Inc.
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.''
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
diff -Nru rabbitmq-server-2.7.1/debian/patches/inets-plugins.patch rabbitmq-server-2.8.4/debian/patches/inets-plugins.patch
--- rabbitmq-server-2.7.1/debian/patches/inets-plugins.patch 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/patches/inets-plugins.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
---- rabbitmq-server-2.7.1.orig/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl
-+++ rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl
-@@ -88,14 +88,7 @@
- -module(rfc4627_jsonrpc_inets).
- -include("rfc4627_jsonrpc.hrl").
-
--%% The path to httpd.hrl has changed in OTP R14A and newer. Our
--%% Makefile detects the change for us, and supplies a compile-time
--%% macro definition to allow us to adapt to the new path.
---ifdef(new_inets).
---include_lib("inets/src/http_server/httpd.hrl").
---else.
---include_lib("inets/src/httpd.hrl").
---endif.
-+-include_lib("inets/include/httpd.hrl").
-
- -export([do/1, load/2]).
-
diff -Nru rabbitmq-server-2.7.1/debian/patches/series rabbitmq-server-2.8.4/debian/patches/series
--- rabbitmq-server-2.7.1/debian/patches/series 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-inets-plugins.patch
diff -Nru rabbitmq-server-2.7.1/debian/postinst rabbitmq-server-2.8.4/debian/postinst
--- rabbitmq-server-2.7.1/debian/postinst 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/postinst 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,60 @@
+#!/bin/sh
+# postinst script for rabbitmq
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * `configure'
+# * `abort-upgrade'
+# * `abort-remove' `in-favour'
+#
+# * `abort-remove'
+# * `abort-deconfigure' `in-favour'
+# `removing'
+#
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+# create rabbitmq group
+if ! getent group rabbitmq >/dev/null; then
+ addgroup --system rabbitmq
+fi
+
+# create rabbitmq user
+if ! getent passwd rabbitmq >/dev/null; then
+ adduser --system --ingroup rabbitmq --home /var/lib/rabbitmq \
+ --no-create-home --gecos "RabbitMQ messaging server" \
+ --disabled-login rabbitmq
+fi
+
+chown -R rabbitmq:rabbitmq /var/lib/rabbitmq
+chown -R rabbitmq:rabbitmq /var/log/rabbitmq
+
+case "$1" in
+ configure)
+ if [ -f /etc/rabbitmq/rabbitmq.conf ] && \
+ [ ! -f /etc/rabbitmq/rabbitmq-env.conf ]; then
+ mv /etc/rabbitmq/rabbitmq.conf /etc/rabbitmq/rabbitmq-env.conf
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff -Nru rabbitmq-server-2.7.1/debian/postrm.in rabbitmq-server-2.8.4/debian/postrm.in
--- rabbitmq-server-2.7.1/debian/postrm.in 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/postrm.in 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,65 @@
+#!/bin/sh
+# postrm script for rabbitmq
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * `remove'
+# * `purge'
+# * `upgrade'
+# * `failed-upgrade'
+# * `abort-install'
+# * `abort-install'
+# * `abort-upgrade'
+# * `disappear'
+#
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+remove_plugin_traces() {
+ # Remove traces of plugins
+ rm -rf /var/lib/rabbitmq/plugins-scratch
+}
+
+case "$1" in
+ purge)
+ rm -f /etc/default/rabbitmq
+ if [ -d /var/lib/rabbitmq ]; then
+ rm -r /var/lib/rabbitmq
+ fi
+ if [ -d /var/log/rabbitmq ]; then
+ rm -r /var/log/rabbitmq
+ fi
+ if [ -d /etc/rabbitmq ]; then
+ rm -r /etc/rabbitmq
+ fi
+ remove_plugin_traces
+ if getent passwd rabbitmq >/dev/null; then
+ # Stop epmd if run by the rabbitmq user
+ pkill -u rabbitmq epmd || :
+ fi
+ ;;
+
+ remove|upgrade)
+ remove_plugin_traces
+ ;;
+
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-erlang-client.postinst rabbitmq-server-2.8.4/debian/rabbitmq-erlang-client.postinst
--- rabbitmq-server-2.7.1/debian/rabbitmq-erlang-client.postinst 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-erlang-client.postinst 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-#!/bin/sh -e
-
-/usr/lib/rabbitmq/bin/rabbitmq-plugins enable amqp_client
-invoke-rc.d rabbitmq-server restart
-
-#DEBHELPER#
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-erlang-client.postrm rabbitmq-server-2.8.4/debian/rabbitmq-erlang-client.postrm
--- rabbitmq-server-2.7.1/debian/rabbitmq-erlang-client.postrm 2012-03-12 09:43:56.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-erlang-client.postrm 1970-01-01 00:00:00.000000000 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-# postrm script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `remove'
-# * `purge'
-# * `upgrade'
-# * `failed-upgrade'
-# * `abort-install'
-# * `abort-install'
-# * `abort-upgrade'
-# * `disappear'
-#
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-case "$1" in
- purge)
- ;;
-
- failed-upgrade|abort-install|abort-upgrade|disappear|remove|upgrade)
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-
-if [ -x /usr/lib/rabbitmq/bin/rabbitmq-plugins ]; then /usr/lib/rabbitmq/bin/rabbitmq-plugins disable amqp_client; fi
-if ! /usr/sbin/invoke-rc.d rabbitmq-server restart ; then
- RESTART_RESULT=$?
- if [ "$RESTART_RESULT" != "100" ] ; then
- exit $RESTART_RESULT
- fi
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-plugins-common.install rabbitmq-server-2.8.4/debian/rabbitmq-plugins-common.install
--- rabbitmq-server-2.7.1/debian/rabbitmq-plugins-common.install 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-plugins-common.install 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-debian/conf/rabbitmq-env.conf etc/rabbitmq
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-script-wrapper rabbitmq-server-2.8.4/debian/rabbitmq-script-wrapper
--- rabbitmq-server-2.7.1/debian/rabbitmq-script-wrapper 2012-03-28 18:34:02.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-script-wrapper 2012-07-11 09:38:32.000000000 +0000
@@ -12,7 +12,7 @@
## The Original Code is RabbitMQ.
##
## The Initial Developer of the Original Code is VMware, Inc.
-## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+## Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
##
# Escape spaces and quotes, because shell is revolting.
@@ -29,10 +29,12 @@
SCRIPT=`basename $0`
-if [ `id -u` = 0 ] ; then
- start-stop-daemon --start --pidfile /dev/null --startas "/usr/lib/rabbitmq/bin/${SCRIPT}" --chuid rabbitmq -- "$@"
-elif [ `id -u` = `id -u rabbitmq` ] ; then
+if [ `id -u` = `id -u rabbitmq` -a "$SCRIPT" = "rabbitmq-server" ] ; then
+ /usr/lib/rabbitmq/bin/rabbitmq-server "$@" > "/var/log/rabbitmq/startup_log" 2> "/var/log/rabbitmq/startup_err"
+elif [ `id -u` = `id -u rabbitmq` -o "$SCRIPT" = "rabbitmq-plugins" ] ; then
/usr/lib/rabbitmq/bin/${SCRIPT} "$@"
+elif [ `id -u` = 0 ] ; then
+ su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
else
/usr/lib/rabbitmq/bin/${SCRIPT}
echo
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.default rabbitmq-server-2.8.4/debian/rabbitmq-server.default
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.default 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.default 2012-07-11 09:38:32.000000000 +0000
@@ -0,0 +1,9 @@
+# This file is sourced by /etc/init.d/rabbitmq-server. Its primary
+# reason for existing is to allow adjustment of system limits for the
+# rabbitmq-server process.
+#
+# Maximum number of open file handles. This will need to be increased
+# to handle many simultaneous connections. Refer to the system
+# documentation for ulimit (in man bash) for more information.
+#
+#ulimit -n 1024
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.dirs rabbitmq-server-2.8.4/debian/rabbitmq-server.dirs
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.dirs 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.dirs 1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-usr/lib/rabbitmq/bin
-usr/lib/erlang/lib
-usr/sbin
-usr/share/man
-var/lib/rabbitmq/mnesia
-var/log/rabbitmq
-etc/logrotate.d
-etc/rabbitmq
-etc/rabbitmq/rabbitmq.conf.d
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.init rabbitmq-server-2.8.4/debian/rabbitmq-server.init
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.init 2012-03-28 19:12:59.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.init 2012-07-11 09:38:32.000000000 +0000
@@ -18,15 +18,14 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=rabbitmq-server
-DAEMON=/usr/lib/rabbitmq/bin/${NAME}
+DAEMON=/usr/sbin/${NAME}
CONTROL=/usr/sbin/rabbitmqctl
-DESC=rabbitmq-server
+DESC="message broker"
USER=rabbitmq
ROTATE_SUFFIX=
INIT_LOG_DIR=/var/log/rabbitmq
PID_FILE=/var/run/rabbitmq/pid
-LOCK_FILE=
test -x $DAEMON || exit 0
test -x $CONTROL || exit 0
@@ -34,6 +33,11 @@
RETVAL=0
set -e
+[ -f /etc/default/${NAME} ] && . /etc/default/${NAME}
+
+. /lib/lsb/init-functions
+. /lib/init/vars.sh
+
ensure_pid_dir () {
PID_DIR=`dirname ${PID_FILE}`
if [ ! -d ${PID_DIR} ] ; then
@@ -50,33 +54,21 @@
start_rabbitmq () {
status_rabbitmq quiet
- if [ $RETVAL = 0 ] ; then
- echo RabbitMQ is currently running
- else
+ if [ $RETVAL != 0 ] ; then
RETVAL=0
ensure_pid_dir
set +e
- RABBITMQ_PID_FILE=$PID_FILE start-stop-daemon --pidfile=$PID_FILE --chuid rabbitmq --exec $DAEMON --background --start
+ RABBITMQ_PID_FILE=$PID_FILE start-stop-daemon --quiet \
+ --chuid rabbitmq --start --exec $DAEMON \
+ --pidfile "$RABBITMQ_PID_FILE" --background
$CONTROL wait $PID_FILE >/dev/null 2>&1
RETVAL=$?
set -e
- case "$RETVAL" in
- 0)
- echo SUCCESS
- if [ -n "$LOCK_FILE" ] ; then
- touch $LOCK_FILE
- fi
- echo "`date` - rabbitmq successfully started" >> ${INIT_LOG_DIR}/startup_log
- # only emit the event on boot
- [ -n "$UPSTART_JOB" ] && initctl emit --no-wait rabbitmq-server-running || true
- ;;
- *)
- remove_pid
- echo FAILED - check ${INIT_LOG_DIR}/startup_\{log, _err\}
- echo "`date` - rabbitmq failed to start" >> ${INIT_LOG_DIR}/startup_err
- RETVAL=1
- ;;
- esac
+ if [ $RETVAL != 0 ] ; then
+ remove_pid
+ fi
+ else
+ RETVAL=3
fi
}
@@ -84,22 +76,14 @@
status_rabbitmq quiet
if [ $RETVAL = 0 ] ; then
set +e
- start-stop-daemon --pidfile=$PID_FILE --stop
+ $CONTROL stop ${PID_FILE} > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err
RETVAL=$?
set -e
if [ $RETVAL = 0 ] ; then
remove_pid
- if [ -n "$LOCK_FILE" ] ; then
- rm -f $LOCK_FILE
- fi
- echo "`date` - rabbitmq successfully stopped" >> ${INIT_LOG_DIR}/shutdown_log
- else
- echo FAILED - check ${INIT_LOG_DIR}/shutdown_log, _err
- echo "`date` - rabbitmq failed to stop" >> ${INIT_LOG_DIR}/shutdown_err
fi
else
- echo RabbitMQ is not running
- RETVAL=0
+ RETVAL=3
fi
}
@@ -118,7 +102,7 @@
rotate_logs_rabbitmq() {
set +e
- $CONTROL rotate_logs ${ROTATE_SUFFIX}
+ $CONTROL -q rotate_logs ${ROTATE_SUFFIX}
if [ $? != 0 ] ; then
RETVAL=1
fi
@@ -130,8 +114,7 @@
if [ $RETVAL = 0 ] ; then
restart_rabbitmq
else
- echo RabbitMQ is not runnning
- RETVAL=0
+ log_warning_msg "${DESC} not running"
fi
}
@@ -140,33 +123,60 @@
start_rabbitmq
}
+restart_end() {
+ if [ $RETVAL = 0 ] ; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+}
+
+start_stop_end() {
+ case "$RETVAL" in
+ 0)
+ [ -x /sbin/initctl ] && /sbin/initctl emit --no-wait "${NAME}-${1}"
+ log_end_msg 0
+ ;;
+ 3)
+ log_warning_msg "${DESC} already ${1}"
+ log_end_msg 0
+ RETVAL=0
+ ;;
+ *)
+ log_warning_msg "FAILED - check ${INIT_LOG_DIR}/startup_\{log, _err\}"
+ log_end_msg 1
+ ;;
+ esac
+}
+
case "$1" in
start)
- echo -n "Starting $DESC: "
+ log_daemon_msg "Starting ${DESC}" $NAME
start_rabbitmq
- echo "$NAME."
+ start_stop_end "running"
;;
stop)
- echo -n "Stopping $DESC: "
+ log_daemon_msg "Stopping ${DESC}" $NAME
stop_rabbitmq
- echo "$NAME."
+ start_stop_end "stopped"
;;
status)
status_rabbitmq
;;
rotate-logs)
- echo -n "Rotating log files for $DESC: "
+ log_action_begin_msg "Rotating log files for ${DESC} ${NAME}"
rotate_logs_rabbitmq
+ log_action_end_msg $RETVAL
;;
force-reload|reload|restart)
- echo -n "Restarting $DESC: "
+ log_daemon_msg "Restarting ${DESC}" $NAME
restart_rabbitmq
- echo "$NAME."
+ restart_end
;;
try-restart)
- echo -n "Restarting $DESC: "
+ log_daemon_msg "Restarting ${DESC}" $NAME
restart_running_rabbitmq
- echo "$NAME."
+ restart_end
;;
*)
echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.links rabbitmq-server-2.8.4/debian/rabbitmq-server.links
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.links 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.links 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1 usr/lib/erlang/lib/rabbit_common
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.ocf rabbitmq-server-2.8.4/debian/rabbitmq-server.ocf
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.ocf 2012-03-12 08:58:37.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.ocf 2012-07-11 09:38:32.000000000 +0000
@@ -12,7 +12,7 @@
## The Original Code is RabbitMQ.
##
## The Initial Developer of the Original Code is VMware, Inc.
-## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+## Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
##
##
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.postinst rabbitmq-server-2.8.4/debian/rabbitmq-server.postinst
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.postinst 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.postinst 1970-01-01 00:00:00.000000000 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-# postinst script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `configure'
-# * `abort-upgrade'
-# * `abort-remove' `in-favour'
-#
-# * `abort-remove'
-# * `abort-deconfigure' `in-favour'
-# `removing'
-#
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-# create rabbitmq group
-if ! getent group rabbitmq >/dev/null; then
- addgroup --system rabbitmq
-fi
-
-# create rabbitmq user
-if ! getent passwd rabbitmq >/dev/null; then
- adduser --system --ingroup rabbitmq --home /var/lib/rabbitmq \
- --no-create-home --gecos "RabbitMQ messaging server" \
- --disabled-login rabbitmq
-fi
-
-chown -R rabbitmq:rabbitmq /var/lib/rabbitmq
-chown -R rabbitmq:rabbitmq /var/log/rabbitmq
-
-case "$1" in
- configure)
- if [ -f /etc/rabbitmq/rabbitmq.conf ] && \
- [ ! -f /etc/rabbitmq/rabbitmq-env.conf ]; then
- mv /etc/rabbitmq/rabbitmq.conf /etc/rabbitmq/rabbitmq-env.conf
- fi
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-server.postrm.in rabbitmq-server-2.8.4/debian/rabbitmq-server.postrm.in
--- rabbitmq-server-2.7.1/debian/rabbitmq-server.postrm.in 2012-03-12 09:52:46.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-server.postrm.in 1970-01-01 00:00:00.000000000 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-# postrm script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `remove'
-# * `purge'
-# * `upgrade'
-# * `failed-upgrade'
-# * `abort-install'
-# * `abort-install'
-# * `abort-upgrade'
-# * `disappear'
-#
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-remove_plugin_traces() {
- # Remove traces of plugins
- rm -rf /var/lib/rabbitmq/plugins-scratch
-}
-
-case "$1" in
- purge)
- rm -f /etc/default/rabbitmq
- if [ -d /var/lib/rabbitmq ]; then
- rm -r /var/lib/rabbitmq
- fi
- if [ -d /var/log/rabbitmq ]; then
- rm -r /var/log/rabbitmq
- fi
- if [ -d /etc/rabbitmq ]; then
- rm -r /etc/rabbitmq
- fi
- remove_plugin_traces
- ;;
-
- remove|upgrade)
- remove_plugin_traces
- ;;
-
- failed-upgrade|abort-install|abort-upgrade|disappear)
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-stomp.install rabbitmq-server-2.8.4/debian/rabbitmq-stomp.install
--- rabbitmq-server-2.7.1/debian/rabbitmq-stomp.install 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-stomp.install 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-debian/conf/rabbitmq.conf.d/50_stomp etc/rabbitmq/rabbitmq.conf.d
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-stomp.postinst rabbitmq-server-2.8.4/debian/rabbitmq-stomp.postinst
--- rabbitmq-server-2.7.1/debian/rabbitmq-stomp.postinst 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-stomp.postinst 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-#!/bin/sh -e
-
-/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_stomp
-invoke-rc.d rabbitmq-server restart
-
-#DEBHELPER#
diff -Nru rabbitmq-server-2.7.1/debian/rabbitmq-stomp.postrm rabbitmq-server-2.8.4/debian/rabbitmq-stomp.postrm
--- rabbitmq-server-2.7.1/debian/rabbitmq-stomp.postrm 2012-03-12 09:43:11.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rabbitmq-stomp.postrm 1970-01-01 00:00:00.000000000 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-# postrm script for rabbitmq
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `remove'
-# * `purge'
-# * `upgrade'
-# * `failed-upgrade'
-# * `abort-install'
-# * `abort-install'
-# * `abort-upgrade'
-# * `disappear'
-#
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-case "$1" in
- purge)
- rm -f /etc/rabbitmq/rabbitmq.conf.d/50_stomp
- ;;
-
- failed-upgrade|abort-install|abort-upgrade|disappear|remove|upgrade)
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-if [ -x /usr/lib/rabbitmq/bin/rabbitmq-plugins ]; then /usr/lib/rabbitmq/bin/rabbitmq-plugins disable rabbitmq_stomp; fi
-if ! /usr/sbin/invoke-rc.d rabbitmq-server restart ; then
- RESTART_RESULT=$?
- if [ "$RESTART_RESULT" != "100" ] ; then
- exit $RESTART_RESULT
- fi
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru rabbitmq-server-2.7.1/debian/rules rabbitmq-server-2.8.4/debian/rules
--- rabbitmq-server-2.7.1/debian/rules 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/rules 2012-07-11 09:38:32.000000000 +0000
@@ -3,22 +3,20 @@
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
-MULTIPACKAGE_DEB_DESTDIR=debian/rabbitmq-server/
+RABBIT_LIB=$(DEB_DESTDIR)usr/lib/rabbitmq/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)/
+RABBIT_BIN=$(DEB_DESTDIR)usr/lib/rabbitmq/bin/
-RABBIT_LIB=$(MULTIPACKAGE_DEB_DESTDIR)usr/lib/rabbitmq/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)/
-RABBIT_BIN=$(MULTIPACKAGE_DEB_DESTDIR)usr/lib/rabbitmq/bin/
-
-DEB_MAKE_INSTALL_TARGET := install TARGET_DIR=$(RABBIT_LIB) SBIN_DIR=$(RABBIT_BIN) MAN_DIR=$(MULTIPACKAGE_DEB_DESTDIR)usr/share/man/
+DEB_MAKE_INSTALL_TARGET := install TARGET_DIR=$(RABBIT_LIB) SBIN_DIR=$(RABBIT_BIN) MAN_DIR=$(DEB_DESTDIR)usr/share/man/
DEB_MAKE_CLEAN_TARGET:= distclean
-DOCDIR=$(MULTIPACKAGE_DEB_DESTDIR)usr/share/doc/rabbitmq-server/
+DOCDIR=$(DEB_DESTDIR)usr/share/doc/rabbitmq-server/
install/rabbitmq-server::
mkdir -p $(DOCDIR)
rm $(RABBIT_LIB)LICENSE* $(RABBIT_LIB)INSTALL*
- for script in rabbitmqctl rabbitmq-server; do \
- install -p -D -m 0755 debian/rabbitmq-script-wrapper $(MULTIPACKAGE_DEB_DESTDIR)usr/sbin/$$script; \
+ for script in rabbitmqctl rabbitmq-server rabbitmq-plugins; do \
+ install -p -D -m 0755 debian/rabbitmq-script-wrapper $(DEB_DESTDIR)usr/sbin/$$script; \
done
- sed -e 's|@RABBIT_LIB@|/usr/lib/rabbitmq/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)|g' debian/rabbitmq-server.postrm
- install -p -D -m 0755 debian/rabbitmq-server.ocf $(MULTIPACKAGE_DEB_DESTDIR)usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server
- install -p -m 0644 debian/conf/rabbitmq-env.conf $(MULTIPACKAGE_DEB_DESTDIR)etc/rabbitmq
+ sed -e 's|@RABBIT_LIB@|/usr/lib/rabbitmq/lib/rabbitmq_server-$(DEB_UPSTREAM_VERSION)|g' debian/postrm
+ install -p -D -m 0755 debian/rabbitmq-server.ocf $(DEB_DESTDIR)usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server
+ install -p -D -m 0644 debian/rabbitmq-server.default $(DEB_DESTDIR)etc/default/rabbitmq-server
diff -Nru rabbitmq-server-2.7.1/debian/source/format rabbitmq-server-2.8.4/debian/source/format
--- rabbitmq-server-2.7.1/debian/source/format 2012-07-11 09:38:31.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/source/format 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-3.0 (quilt)
diff -Nru rabbitmq-server-2.7.1/debian/source/options rabbitmq-server-2.8.4/debian/source/options
--- rabbitmq-server-2.7.1/debian/source/options 2012-03-12 08:58:39.000000000 +0000
+++ rabbitmq-server-2.8.4/debian/source/options 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-single-debian-patch
diff -Nru rabbitmq-server-2.7.1/docs/html-to-website-xml.xsl rabbitmq-server-2.8.4/docs/html-to-website-xml.xsl
--- rabbitmq-server-2.7.1/docs/html-to-website-xml.xsl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/docs/html-to-website-xml.xsl 2012-06-22 16:03:48.000000000 +0000
@@ -8,8 +8,6 @@
-
-
@@ -28,36 +26,30 @@
() manual page
-
-
-
+
+
-
- This is the manual page for
- ()
.
-
-
- See a list of all manual pages.
-
+
+ This is the manual page for
+ ()
.
+
+
+ See a list of all manual pages.
+
-
- This is the documentation for
-
.
-
+
+ This is the documentation for
+
.
+
-
-
+
+
For more general documentation, please see the
- administrator's guide.
-
-
-
- Table of Contents
-
+ administrator's guide.
+
-
-
+
diff -Nru rabbitmq-server-2.7.1/docs/rabbitmqctl.1.xml rabbitmq-server-2.8.4/docs/rabbitmqctl.1.xml
--- rabbitmq-server-2.7.1/docs/rabbitmqctl.1.xml 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/docs/rabbitmqctl.1.xml 2012-06-22 16:03:48.000000000 +0000
@@ -266,10 +266,9 @@
When the target files do not exist they are created.
- target files do not already exist. When
- no is specified, the empty log
- files are simply created at the original location; no
- rotation takes place.
+ When no is specified, the empty
+ log files are simply created at the original location;
+ no rotation takes place.
For example:
rabbitmqctl rotate_logs .1
@@ -949,7 +948,7 @@
source_kind
The kind of the source of messages to
which the binding is attached. Currently always
- queue. With non-ASCII characters escaped as in
+ exchange. With non-ASCII characters escaped as in
C.
@@ -1012,6 +1011,10 @@
Id of the Erlang process associated with the connection.
+ name
+ Readable name for the connection.
+
+
address
Server IP address.
@@ -1067,10 +1070,26 @@
The period for which the peer's SSL
certificate is valid.
+
+
+ last_blocked_by
+ The reason for which this connection
+ was last blocked. One of 'resource' - due to a memory
+ or disk alarm, 'flow' - due to internal flow control, or
+ 'none' if the connection was never
+ blocked.
+
+
+ last_blocked_age
+ Time, in seconds, since this
+ connection was last blocked, or
+ 'infinity'.
+
+
state
Connection state (one of [starting, tuning,
- opening, running, closing, closed]).
+ opening, running, blocking, blocked, closing, closed]).
channels
@@ -1127,8 +1146,9 @@
- If no connectioninfoitems are specified then user, peer
- address, peer port and connection state are displayed.
+ If no connectioninfoitems are
+ specified then user, peer address, peer port, time since
+ flow control and memory block state are displayed.
@@ -1171,6 +1191,10 @@
to which the channel belongs.
+ name
+ Readable name for the channel.
+
+
number
The number of the channel, which uniquely identifies it within
a connection.
@@ -1273,9 +1297,10 @@
Displays broker status information such as the running
applications on the current Erlang node, RabbitMQ and
- Erlang versions, OS name and memory statistics. (See
- the cluster_status command to find
- out which nodes are clustered and running.)
+ Erlang versions, OS name, memory and file descriptor
+ statistics. (See the cluster_status
+ command to find out which nodes are clustered and
+ running.)
For example:
rabbitmqctl status
@@ -1403,8 +1428,11 @@
fraction
- The new memory threshhold fraction at which flow control is triggered, as a
- floating point number between 0.0 and 1.0 with a mandatory fractional part.
+
+ The new memory threshold fraction at which flow
+ control is triggered, as a floating point number
+ greater than or equal to 0.
+
diff -Nru rabbitmq-server-2.7.1/docs/rabbitmq-echopid.xml rabbitmq-server-2.8.4/docs/rabbitmq-echopid.xml
--- rabbitmq-server-2.7.1/docs/rabbitmq-echopid.xml 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/docs/rabbitmq-echopid.xml 2012-06-22 16:03:48.000000000 +0000
@@ -0,0 +1,71 @@
+
+
+
+
+ RabbitMQ Server
+
+ The RabbitMQ Team <info@rabbitmq.com>
+
+
+
+
+ rabbitmq-echopid.bat
+ RabbitMQ Server
+
+
+
+ rabbitmq-echopid.bat
+ return the process id of the Erlang runtime hosting RabbitMQ
+
+
+
+
+ rabbitmq-echopid.bat
+ sname
+
+
+
+
+ Description
+
+ RabbitMQ is an implementation of AMQP, the emerging
+ standard for high performance enterprise messaging. The
+ RabbitMQ server is a robust and scalable implementation of
+ an AMQP broker.
+
+
+ Running rabbitmq-echopid will attempt to
+ discover and echo the process id (PID) of the Erlang runtime
+ process (erl.exe) that is hosting RabbitMQ. To allow erl.exe
+ time to start up and load RabbitMQ, the script will wait for
+ ten seconds before timing out if a suitable PID cannot be
+ found.
+
+
+ If a PID is discovered, the script will echo it to stdout
+ before exiting with a ERRORLEVEL of 0. If no PID is
+ discovered before the timeout, nothing is written to stdout
+ and the script exits setting ERRORLEVEL to 1.
+
+
+ Note that this script only exists on Windows due to the need
+ to wait for erl.exe and possibly time-out. To obtain the PID
+ on Unix set RABBITMQ_PID_FILE before starting
+ rabbitmq-server and do not use "-detached".
+
+
+
+
+ Options
+
+
+ sname
+
+
+The short-name form of the RabbitMQ node name.
+
+
+
+
+
+
diff -Nru rabbitmq-server-2.7.1/ebin/rabbit_app.in rabbitmq-server-2.8.4/ebin/rabbit_app.in
--- rabbitmq-server-2.7.1/ebin/rabbit_app.in 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/ebin/rabbit_app.in 2012-06-22 16:03:48.000000000 +0000
@@ -1,7 +1,7 @@
{application, rabbit, %% -*- erlang -*-
[{description, "RabbitMQ"},
{id, "RabbitMQ"},
- {vsn, "2.7.1"},
+ {vsn, "2.8.4"},
{modules, []},
{registered, [rabbit_amqqueue_sup,
rabbit_log,
@@ -19,6 +19,7 @@
{ssl_listeners, []},
{ssl_options, []},
{vm_memory_high_watermark, 0.4},
+ {disk_free_limit, 1000000000}, %% 1GB
{msg_store_index_module, rabbit_msg_store_ets_index},
{backing_queue_module, rabbit_variable_queue},
{frame_max, 131072},
@@ -37,10 +38,13 @@
{auth_backends, [rabbit_auth_backend_internal]},
{delegate_count, 16},
{trace_vhosts, []},
+ {log_levels, [{connection, info}]},
+ {ssl_cert_login_from, distinguished_name},
{tcp_listen_options, [binary,
{packet, raw},
{reuseaddr, true},
{backlog, 128},
{nodelay, true},
+ {linger, {true, 0}},
{exit_on_close, false}]}
]}]}.
diff -Nru rabbitmq-server-2.7.1/include/gm_specs.hrl rabbitmq-server-2.8.4/include/gm_specs.hrl
--- rabbitmq-server-2.7.1/include/gm_specs.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/gm_specs.hrl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
%%
-ifdef(use_specs).
diff -Nru rabbitmq-server-2.7.1/include/rabbit_auth_backend_spec.hrl rabbitmq-server-2.8.4/include/rabbit_auth_backend_spec.hrl
--- rabbitmq-server-2.7.1/include/rabbit_auth_backend_spec.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_auth_backend_spec.hrl 1970-01-01 00:00:00.000000000 +0000
@@ -1,31 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
-%%
-
--ifdef(use_specs).
-
--spec(description/0 :: () -> [{atom(), any()}]).
-
--spec(check_user_login/2 :: (rabbit_types:username(), [term()]) ->
- {'ok', rabbit_types:user()} |
- {'refused', string(), [any()]} |
- {'error', any()}).
--spec(check_vhost_access/2 :: (rabbit_types:user(), rabbit_types:vhost()) ->
- boolean() | {'error', any()}).
--spec(check_resource_access/3 :: (rabbit_types:user(),
- rabbit_types:r(atom()),
- rabbit_access_control:permission_atom()) ->
- boolean() | {'error', any()}).
--endif.
diff -Nru rabbitmq-server-2.7.1/include/rabbit_auth_mechanism_spec.hrl rabbitmq-server-2.8.4/include/rabbit_auth_mechanism_spec.hrl
--- rabbitmq-server-2.7.1/include/rabbit_auth_mechanism_spec.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_auth_mechanism_spec.hrl 1970-01-01 00:00:00.000000000 +0000
@@ -1,28 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
-%%
-
--ifdef(use_specs).
-
--spec(description/0 :: () -> [{atom(), any()}]).
--spec(should_offer/1 :: (rabbit_net:socket()) -> boolean()).
--spec(init/1 :: (rabbit_net:socket()) -> any()).
--spec(handle_response/2 :: (binary(), any()) ->
- {'ok', rabbit_types:user()} |
- {'challenge', binary(), any()} |
- {'protocol_error', string(), [any()]} |
- {'refused', string(), [any()]}).
-
--endif.
diff -Nru rabbitmq-server-2.7.1/include/rabbit_backing_queue_spec.hrl rabbitmq-server-2.8.4/include/rabbit_backing_queue_spec.hrl
--- rabbitmq-server-2.7.1/include/rabbit_backing_queue_spec.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_backing_queue_spec.hrl 1970-01-01 00:00:00.000000000 +0000
@@ -1,66 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
-%%
-
--type(fetch_result(Ack) ::
- ('empty' |
- %% Message, IsDelivered, AckTag, Remaining_Len
- {rabbit_types:basic_message(), boolean(), Ack, non_neg_integer()})).
--type(is_durable() :: boolean()).
--type(attempt_recovery() :: boolean()).
--type(purged_msg_count() :: non_neg_integer()).
--type(confirm_required() :: boolean()).
--type(async_callback() :: fun ((atom(), fun ((atom(), state()) -> state())) -> 'ok')).
--type(duration() :: ('undefined' | 'infinity' | number())).
-
--spec(start/1 :: ([rabbit_amqqueue:name()]) -> 'ok').
--spec(stop/0 :: () -> 'ok').
--spec(init/3 :: (rabbit_types:amqqueue(), attempt_recovery(),
- async_callback()) -> state()).
--spec(terminate/2 :: (any(), state()) -> state()).
--spec(delete_and_terminate/2 :: (any(), state()) -> state()).
--spec(purge/1 :: (state()) -> {purged_msg_count(), state()}).
--spec(publish/4 :: (rabbit_types:basic_message(),
- rabbit_types:message_properties(), pid(), state()) ->
- state()).
--spec(publish_delivered/5 :: (true, rabbit_types:basic_message(),
- rabbit_types:message_properties(), pid(), state())
- -> {ack(), state()};
- (false, rabbit_types:basic_message(),
- rabbit_types:message_properties(), pid(), state())
- -> {undefined, state()}).
--spec(drain_confirmed/1 :: (state()) -> {[rabbit_guid:guid()], state()}).
--spec(dropwhile/2 ::
- (fun ((rabbit_types:message_properties()) -> boolean()), state())
- -> state()).
--spec(fetch/2 :: (true, state()) -> {fetch_result(ack()), state()};
- (false, state()) -> {fetch_result(undefined), state()}).
--spec(ack/2 :: ([ack()], state()) -> {[rabbit_guid:guid()], state()}).
--spec(requeue/2 :: ([ack()], state())
- -> {[rabbit_guid:guid()], state()}).
--spec(len/1 :: (state()) -> non_neg_integer()).
--spec(is_empty/1 :: (state()) -> boolean()).
--spec(set_ram_duration_target/2 ::
- (duration(), state()) -> state()).
--spec(ram_duration/1 :: (state()) -> {duration(), state()}).
--spec(needs_timeout/1 :: (state()) -> 'false' | 'timed' | 'idle').
--spec(timeout/1 :: (state()) -> state()).
--spec(handle_pre_hibernate/1 :: (state()) -> state()).
--spec(status/1 :: (state()) -> [{atom(), any()}]).
--spec(invoke/3 :: (atom(), fun ((atom(), A) -> A), state()) -> state()).
--spec(is_duplicate/2 ::
- (rabbit_types:basic_message(), state()) ->
- {'false'|'published'|'discarded', state()}).
--spec(discard/3 :: (rabbit_types:basic_message(), pid(), state()) -> state()).
diff -Nru rabbitmq-server-2.7.1/include/rabbit_exchange_type_spec.hrl rabbitmq-server-2.8.4/include/rabbit_exchange_type_spec.hrl
--- rabbitmq-server-2.7.1/include/rabbit_exchange_type_spec.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_exchange_type_spec.hrl 1970-01-01 00:00:00.000000000 +0000
@@ -1,38 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
-%%
-
--ifdef(use_specs).
-
--type(tx() :: 'transaction' | 'none').
--type(serial() :: pos_integer() | tx()).
-
--spec(description/0 :: () -> [{atom(), any()}]).
--spec(serialise_events/0 :: () -> boolean()).
--spec(route/2 :: (rabbit_types:exchange(), rabbit_types:delivery())
- -> rabbit_router:match_result()).
--spec(validate/1 :: (rabbit_types:exchange()) -> 'ok').
--spec(create/2 :: (tx(), rabbit_types:exchange()) -> 'ok').
--spec(delete/3 :: (tx(), rabbit_types:exchange(),
- [rabbit_types:binding()]) -> 'ok').
--spec(add_binding/3 :: (serial(), rabbit_types:exchange(),
- rabbit_types:binding()) -> 'ok').
--spec(remove_bindings/3 :: (serial(), rabbit_types:exchange(),
- [rabbit_types:binding()]) -> 'ok').
--spec(assert_args_equivalence/2 ::
- (rabbit_types:exchange(), rabbit_framing:amqp_table())
- -> 'ok' | rabbit_types:connection_exit()).
-
--endif.
diff -Nru rabbitmq-server-2.7.1/include/rabbit.hrl rabbitmq-server-2.8.4/include/rabbit.hrl
--- rabbitmq-server-2.7.1/include/rabbit.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit.hrl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
%%
-record(user, {username,
@@ -56,9 +56,11 @@
-record(binding, {source, key, destination, args = []}).
-record(reverse_binding, {destination, key, source, args = []}).
+-record(topic_trie_node, {trie_node, edge_count, binding_count}).
-record(topic_trie_edge, {trie_edge, node_id}).
-record(topic_trie_binding, {trie_binding, value = const}).
+-record(trie_node, {exchange_name, node_id}).
-record(trie_edge, {exchange_name, node_id, word}).
-record(trie_binding, {exchange_name, node_id, destination}).
@@ -84,7 +86,7 @@
%%----------------------------------------------------------------------------
--define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2011 VMware, Inc.").
+-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2012 VMware, Inc.").
-define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/").
-define(PROTOCOL_VERSION, "AMQP 0-9-1 / 0-9 / 0-8").
-define(ERTS_MINIMUM, "5.6.3").
@@ -93,16 +95,7 @@
-define(HIBERNATE_AFTER_MIN, 1000).
-define(DESIRED_HIBERNATE, 10000).
+-define(CREDIT_DISC_BOUND, {2000, 500}).
-define(ROUTING_HEADERS, [<<"CC">>, <<"BCC">>]).
-define(DELETED_HEADER, <<"BCC">>).
-
--ifdef(debug).
--define(LOGDEBUG0(F), rabbit_log:debug(F)).
--define(LOGDEBUG(F,A), rabbit_log:debug(F,A)).
--define(LOGMESSAGE(D,C,M,Co), rabbit_log:message(D,C,M,Co)).
--else.
--define(LOGDEBUG0(F), ok).
--define(LOGDEBUG(F,A), ok).
--define(LOGMESSAGE(D,C,M,Co), ok).
--endif.
diff -Nru rabbitmq-server-2.7.1/include/rabbit_msg_store.hrl rabbitmq-server-2.8.4/include/rabbit_msg_store.hrl
--- rabbitmq-server-2.7.1/include/rabbit_msg_store.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_msg_store.hrl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
%%
-include("rabbit.hrl").
diff -Nru rabbitmq-server-2.7.1/include/rabbit_msg_store_index.hrl rabbitmq-server-2.8.4/include/rabbit_msg_store_index.hrl
--- rabbitmq-server-2.7.1/include/rabbit_msg_store_index.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/include/rabbit_msg_store_index.hrl 1970-01-01 00:00:00.000000000 +0000
@@ -1,45 +0,0 @@
-%% The contents of this file are subject to the Mozilla Public License
-%% Version 1.1 (the "License"); you may not use this file except in
-%% compliance with the License. You may obtain a copy of the License
-%% at http://www.mozilla.org/MPL/
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and
-%% limitations under the License.
-%%
-%% The Original Code is RabbitMQ.
-%%
-%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
-%%
-
--include("rabbit_msg_store.hrl").
-
-%%----------------------------------------------------------------------------
-
--ifdef(use_specs).
-
--type(dir() :: any()).
--type(index_state() :: any()).
--type(keyvalue() :: any()).
--type(fieldpos() :: non_neg_integer()).
--type(fieldvalue() :: any()).
-
--spec(new/1 :: (dir()) -> index_state()).
--spec(recover/1 :: (dir()) -> rabbit_types:ok_or_error2(index_state(), any())).
--spec(lookup/2 ::
- (rabbit_types:msg_id(), index_state()) -> ('not_found' | keyvalue())).
--spec(insert/2 :: (keyvalue(), index_state()) -> 'ok').
--spec(update/2 :: (keyvalue(), index_state()) -> 'ok').
--spec(update_fields/3 :: (rabbit_types:msg_id(), ({fieldpos(), fieldvalue()} |
- [{fieldpos(), fieldvalue()}]),
- index_state()) -> 'ok').
--spec(delete/2 :: (rabbit_types:msg_id(), index_state()) -> 'ok').
--spec(delete_object/2 :: (keyvalue(), index_state()) -> 'ok').
--spec(delete_by_file/2 :: (fieldvalue(), index_state()) -> 'ok').
--spec(terminate/1 :: (index_state()) -> any()).
-
--endif.
-
-%%----------------------------------------------------------------------------
diff -Nru rabbitmq-server-2.7.1/LICENSE rabbitmq-server-2.8.4/LICENSE
--- rabbitmq-server-2.7.1/LICENSE 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/LICENSE 2012-06-22 16:03:48.000000000 +0000
@@ -4,12 +4,15 @@
info@rabbitmq.com.
The files amqp-rabbitmq-0.8.json and amqp-rabbitmq-0.9.1.json are
-"Copyright (C) 2008-2011 VMware", Inc. and are covered by the MIT
+"Copyright (C) 2008-2012 VMware", Inc. and are covered by the MIT
license.
-Mochiweb is "Copyright (c) 2007 Mochi Media, Inc." and is covered by
-the MIT license. It was downloaded from
-http://github.com/mochi/mochiweb/
+Webmachine is Copyright (c) Basho Technologies and is covered by the
+Apache License 2.0. It was downloaded from http://webmachine.basho.com/
+
+glMatrix is "Copyright (c) 2011, Brandon Jones" and is covered by the
+BSD 2-Clause license. It was downloaded from
+http://code.google.com/p/glmatrix/
Eldap is "Copyright (c) 2010, Torbjorn Tornkvist" and is covered by
the MIT license. It was downloaded from https://github.com/etnt/eldap
@@ -24,12 +27,9 @@
covered by the MIT license. It was downloaded from
http://code.quirkey.com/sammy/
-glMatrix is "Copyright (c) 2011, Brandon Jones" and is covered by the
-BSD 2-Clause license. It was downloaded from
-http://code.google.com/p/glmatrix/
-
-Webmachine is Copyright (c) Basho Technologies and is covered by the
-Apache License 2.0. It was downloaded from http://webmachine.basho.com/
+Mochiweb is "Copyright (c) 2007 Mochi Media, Inc." and is covered by
+the MIT license. It was downloaded from
+http://github.com/mochi/mochiweb/
The MIT license is as follows:
@@ -89,7 +89,7 @@
Authors and Copyright are as described below:
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
MOZILLA PUBLIC LICENSE
@@ -541,7 +541,7 @@
The Original Code is RabbitMQ.
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2007-2011 VMware, Inc. All rights reserved.''
+ Copyright (c) 2007-2012 VMware, Inc. All rights reserved.''
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
diff -Nru rabbitmq-server-2.7.1/LICENSE-MPL-RabbitMQ rabbitmq-server-2.8.4/LICENSE-MPL-RabbitMQ
--- rabbitmq-server-2.7.1/LICENSE-MPL-RabbitMQ 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/LICENSE-MPL-RabbitMQ 2012-06-22 16:03:48.000000000 +0000
@@ -447,7 +447,7 @@
The Original Code is RabbitMQ Visualiser.
The Initial Developer of the Original Code is VMware, Inc.
- Copyright (c) 2011-2011 VMware, Inc. All rights reserved.''
+ Copyright (c) 2011-2012 VMware, Inc. All rights reserved.''
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
diff -Nru rabbitmq-server-2.7.1/Makefile rabbitmq-server-2.8.4/Makefile
--- rabbitmq-server-2.7.1/Makefile 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/Makefile 2012-06-22 16:03:48.000000000 +0000
@@ -17,7 +17,7 @@
TARGETS=$(EBIN_DIR)/rabbit.app $(INCLUDE_DIR)/rabbit_framing.hrl $(BEAM_TARGETS) plugins
WEB_URL=http://www.rabbitmq.com/
MANPAGES=$(patsubst %.xml, %.gz, $(wildcard $(DOCS_DIR)/*.[0-9].xml))
-WEB_MANPAGES=$(patsubst %.xml, %.man.xml, $(wildcard $(DOCS_DIR)/*.[0-9].xml) $(DOCS_DIR)/rabbitmq-service.xml)
+WEB_MANPAGES=$(patsubst %.xml, %.man.xml, $(wildcard $(DOCS_DIR)/*.[0-9].xml) $(DOCS_DIR)/rabbitmq-service.xml $(DOCS_DIR)/rabbitmq-echopid.xml)
USAGES_XML=$(DOCS_DIR)/rabbitmqctl.1.xml $(DOCS_DIR)/rabbitmq-plugins.1.xml
USAGES_ERL=$(foreach XML, $(USAGES_XML), $(call usage_xml_to_erl, $(XML)))
QC_MODULES := rabbit_backing_queue_qc
@@ -42,9 +42,9 @@
RABBIT_PLT=rabbit.plt
ifndef USE_SPECS
-# our type specs rely on features and bug fixes in dialyzer that are
-# only available in R14B03 upwards (R14B03 is erts 5.8.4)
-USE_SPECS:=$(shell erl -noshell -eval 'io:format([list_to_integer(X) || X <- string:tokens(erlang:system_info(version), ".")] >= [5,8,4]), halt().')
+# our type specs rely on callback specs, which are available in R15B
+# upwards.
+USE_SPECS:=$(shell erl -noshell -eval 'io:format([list_to_integer(X) || X <- string:tokens(erlang:system_info(version), ".")] >= [5,9]), halt().')
endif
ifndef USE_PROPER_QC
@@ -56,7 +56,7 @@
#other args: +native +"{hipe,[o3,verbose]}" -Ddebug=true +debug_info +no_strict_record_tests
ERLC_OPTS=-I $(INCLUDE_DIR) -o $(EBIN_DIR) -Wall -v +debug_info $(call boolean_macro,$(USE_SPECS),use_specs) $(call boolean_macro,$(USE_PROPER_QC),use_proper_qc)
-VERSION=0.0.0
+VERSION?=0.0.0
PLUGINS_SRC_DIR?=$(shell [ -d "plugins-src" ] && echo "plugins-src" || echo )
PLUGINS_DIR=plugins
TARBALL_NAME=rabbitmq-server-$(VERSION)
@@ -207,7 +207,7 @@
-rm -f $(RABBITMQ_MNESIA_DIR).pid
mkdir -p $(RABBITMQ_MNESIA_DIR)
setsid sh -c "$(MAKE) run-background-node > $(RABBITMQ_MNESIA_DIR)/startup_log 2> $(RABBITMQ_MNESIA_DIR)/startup_err" &
- sleep 1
+ ./scripts/rabbitmqctl -n $(RABBITMQ_NODENAME) wait $(RABBITMQ_MNESIA_DIR).pid kernel
start-rabbit-on-node: all
echo "rabbit:start()." | $(ERL_CALL)
@@ -216,12 +216,12 @@
stop-rabbit-on-node: all
echo "rabbit:stop()." | $(ERL_CALL)
-set-memory-alarm: all
- echo "alarm_handler:set_alarm({{vm_memory_high_watermark, node()}, []})." | \
+set-resource-alarm: all
+ echo "alarm_handler:set_alarm({{resource_limit, $(SOURCE), node()}, []})." | \
$(ERL_CALL)
-clear-memory-alarm: all
- echo "alarm_handler:clear_alarm({vm_memory_high_watermark, node()})." | \
+clear-resource-alarm: all
+ echo "alarm_handler:clear_alarm({resource_limit, $(SOURCE), node()})." | \
$(ERL_CALL)
stop-node:
@@ -246,7 +246,8 @@
srcdist: distclean
mkdir -p $(TARGET_SRC_DIR)/codegen
cp -r ebin src include LICENSE LICENSE-MPL-RabbitMQ INSTALL README $(TARGET_SRC_DIR)
- sed -i.save 's/%%VSN%%/$(VERSION)/' $(TARGET_SRC_DIR)/ebin/rabbit_app.in && rm -f $(TARGET_SRC_DIR)/ebin/rabbit_app.in.save
+ sed 's/%%VSN%%/$(VERSION)/' $(TARGET_SRC_DIR)/ebin/rabbit_app.in > $(TARGET_SRC_DIR)/ebin/rabbit_app.in.tmp && \
+ mv $(TARGET_SRC_DIR)/ebin/rabbit_app.in.tmp $(TARGET_SRC_DIR)/ebin/rabbit_app.in
cp -r $(AMQP_CODEGEN_DIR)/* $(TARGET_SRC_DIR)/codegen/
cp codegen.py Makefile generate_app generate_deps calculate-relative $(TARGET_SRC_DIR)
@@ -315,7 +316,7 @@
cp -r ebin include LICENSE* INSTALL $(TARGET_DIR)
chmod 0755 scripts/*
- for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugins; do \
+ for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugins rabbitmq-defaults; do \
cp scripts/$$script $(TARGET_DIR)/sbin; \
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
done
@@ -346,10 +347,10 @@
# Note that all targets which depend on clean must have clean in their
# name. Also any target that doesn't depend on clean should not have
# clean in its name, unless you know that you don't need any of the
-# automatic dependency generation for that target (eg cleandb).
+# automatic dependency generation for that target (e.g. cleandb).
# We want to load the dep file if *any* target *doesn't* contain
-# "clean" - i.e. if removing all clean-like targets leaves something
+# "clean" - i.e. if removing all clean-like targets leaves something.
ifeq "$(MAKECMDGOALS)" ""
TESTABLEGOALS:=$(.DEFAULT_GOAL)
diff -Nru rabbitmq-server-2.7.1/plugins-src/do-package.mk rabbitmq-server-2.8.4/plugins-src/do-package.mk
--- rabbitmq-server-2.7.1/plugins-src/do-package.mk 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/do-package.mk 2012-06-22 16:03:48.000000000 +0000
@@ -286,7 +286,7 @@
define run_broker
rm -rf $(TEST_TMPDIR)
mkdir -p $(foreach D,log plugins $(NODENAME),$(TEST_TMPDIR)/$(D))
- cp -a $(PACKAGE_DIR)/dist/*.ez $(TEST_TMPDIR)/plugins
+ cp -p $(PACKAGE_DIR)/dist/*.ez $(TEST_TMPDIR)/plugins
$(call copy,$(3),$(TEST_TMPDIR)/plugins)
rm -f $(TEST_TMPDIR)/plugins/rabbit_common*.ez
for plugin in \
@@ -375,7 +375,7 @@
mkdir -p $(APP_DIR)/ebin $(APP_DIR)/include
@echo [elided] copy beams to ebin
@$(call copy,$(EBIN_BEAMS),$(APP_DIR)/ebin)
- cp -a $(APP_FILE) $(APP_DIR)/ebin/$(APP_NAME).app
+ cp -p $(APP_FILE) $(APP_DIR)/ebin/$(APP_NAME).app
$(call copy,$(INCLUDE_HRLS),$(APP_DIR)/include)
$(construct_app_commands)
touch $$@
@@ -414,8 +414,8 @@
@echo [elided] generate deps
@$$(if $$^,echo $$(subst : ,:,$$(foreach F,$$^,$$(abspath $$(F)):)) | escript $(abspath $(UMBRELLA_BASE_DIR)/generate_deps) $$@ '$$$$(EBIN_DIR)',echo >$$@)
@echo [elided] fix test deps
- @$$(foreach F,$(TEST_EBIN_BEAMS),sed -i -e 's|^$$$$(EBIN_DIR)/$$(notdir $$(F)):|$$$$(TEST_EBIN_DIR)/$$(notdir $$(F)):|' $$@ && ) :
- sed -i -e 's|$$@|$$$$(DEPS_FILE)|' $$@
+ @$$(foreach F,$(TEST_EBIN_BEAMS),sed -e 's|^$$$$(EBIN_DIR)/$$(notdir $$(F)):|$$$$(TEST_EBIN_DIR)/$$(notdir $$(F)):|' $$@ > $$@.tmp && mv $$@.tmp $$@ && ) :
+ sed -e 's|$$@|$$$$(DEPS_FILE)|' $$@ > $$@.tmp && mv $$@.tmp $$@
$(eval $(call safe_include,$(DEPS_FILE)))
diff -Nru rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/eldap-git/doc/draft-ietf-asid-ldap-c-api-00.txt rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/eldap-git/doc/draft-ietf-asid-ldap-c-api-00.txt
--- rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/eldap-git/doc/draft-ietf-asid-ldap-c-api-00.txt 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/eldap-git/doc/draft-ietf-asid-ldap-c-api-00.txt 1970-01-01 00:00:00.000000000 +0000
@@ -1,3030 +0,0 @@
-
-
-
-
-
-
-Network Working Group T. Howes
-INTERNET-DRAFT Netscape Communications Corp.
-Intended Category: Standards Track M. Smith
-Obsoletes: RFC 1823 Netscape Communications Corp.
-Expires: January 1998 A. Herron
- Microsoft Corp.
- C. Weider
- Microsoft Corp.
- M. Wahl
- Critical Angle, Inc.
-
- 29 July 1997
-
-
- The C LDAP Application Program Interface
-
-
-
-
-1. Status of this Memo
-
-This draft document will be submitted to the RFC Editor as a Standards
-Track document. Distribution of this memo is unlimited. Please send com-
-ments to the authors.
-
-This document is an Internet-Draft. Internet-Drafts are working docu-
-ments of the Internet Engineering Task Force (IETF), its areas, and its
-working groups. Note that other groups may also distribute working
-documents as Internet-Drafts.
-
-Internet-Drafts are draft documents valid for a maximum of six months
-and may be updated, replaced, or obsoleted by other documents at any
-time. It is inappropriate to use Internet-Drafts as reference material
-or to cite them other than as ``work in progress.''
-
-To learn the current status of any Internet-Draft, please check the
-``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
-Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
-ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
-
-2. Introduction
-
-This document defines a C language application program interface to the
-lightweight directory access protocol (LDAP). This document replaces the
-previous definition of this API, defined in RFC 1823, updating it to
-include support for features found in version 3 of the LDAP protocol.
-New extended operation functions were added to support LDAPv3 features
-such as controls. In addition, other LDAP API changes were made to
-
-
-
-Expires: January 1998 [Page 1]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-support information hiding and thread safety.
-
-The C LDAP API is designed to be powerful, yet simple to use. It defines
-compatible synchronous and asynchronous interfaces to LDAP to suit a
-wide variety of applications. This document gives a brief overview of
-the LDAP model, then an overview of how the API is used by an applica-
-tion program to obtain LDAP information. The API calls are described in
-detail, followed by an appendix that provides some example code demon-
-strating the use of the API. This document provides information to the
-Internet community. It does not specify any standard.
-
-3. Overview of the LDAP Model
-
-LDAP is the lightweight directory access protocol, described in [2] and
-[6]. It can provide a lightweight frontend to the X.500 directory [1],
-or a stand-alone service. In either mode, LDAP is based on a client-
-server model in which a client makes a TCP connection to an LDAP server,
-over which it sends requests and receives responses.
-
-The LDAP information model is based on the entry, which contains infor-
-mation about some object (e.g., a person). Entries are composed of
-attributes, which have a type and one or more values. Each attribute has
-a syntax that determines what kinds of values are allowed in the attri-
-bute (e.g., ASCII characters, a jpeg photograph, etc.) and how those
-values behave during directory operations (e.g., is case significant
-during comparisons).
-
-Entries may be organized in a tree structure, usually based on politi-
-cal, geographical, and organizational boundaries. Each entry is uniquely
-named relative to its sibling entries by its relative distinguished name
-(RDN) consisting of one or more distinguished attribute values from the
-entry. At most one value from each attribute may be used in the RDN.
-For example, the entry for the person Babs Jensen might be named with
-the "Barbara Jensen" value from the commonName attribute.
-
-A globally unique name for an entry, called a distinguished name or DN,
-is constructed by concatenating the sequence of RDNs from the entry up
-to the root of the tree. For example, if Babs worked for the University
-of Michigan, the DN of her U-M entry might be "cn=Barbara Jensen,
-o=University of Michigan, c=US". The DN format used by LDAP is defined
-in [4].
-
-Operations are provided to authenticate, search for and retrieve infor-
-mation, modify information, and add and delete entries from the tree.
-The next sections give an overview of how the API is used and detailed
-descriptions of the LDAP API calls that implement all of these func-
-tions.
-
-
-
-
-Expires: January 1998 [Page 2]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-4. Overview of LDAP API Use
-
-An application generally uses the C LDAP API in four simple steps.
-
-- Initialize an LDAP session with a default LDAP server. The
- ldap_init() function returns a handle to the session, allowing mul-
- tiple connections to be open at once.
-
-- Authenticate to the LDAP server. The ldap_bind() function and
- friends support a variety of authentication methods.
-
-- Perform some LDAP operations and obtain some results. ldap_search()
- and friends return results which can be parsed by
- ldap_result2error(), ldap_first_entry(), ldap_next_entry(), etc.
-
-- Close the session. The ldap_unbind() function closes the connec-
- tion.
-
-Operations can be performed either synchronously or asynchronously. The
-names of the synchronous functions end in _s. For example, a synchronous
-search can be completed by calling ldap_search_s(). An asynchronous
-search can be initiated by calling ldap_search(). All synchronous rou-
-tines return an indication of the outcome of the operation (e.g, the
-constant LDAP_SUCCESS or some other error code). The asynchronous rou-
-tines return the message id of the operation initiated. This id can be
-used in subsequent calls to ldap_result() to obtain the result(s) of the
-operation. An asynchronous operation can be abandoned by calling
-ldap_abandon().
-
-Results and errors are returned in an opaque structure called LDAPMes-
-sage. Routines are provided to parse this structure, step through
-entries and attributes returned, etc. Routines are also provided to
-interpret errors. Later sections of this document describe these rou-
-tines in more detail.
-
-LDAP version 3 servers may return referrals to other servers. By
-default, implementations of this API will attempt to follow referrals
-automatically for the application. This behavior can be disabled glo-
-bally (using the ldap_set_option() call) or on a per-request basis
-through the use of a client control.
-
-As in the LDAPv3 protocol itself, all DNs and string values that are
-passed into or produced by the C LDAP API are represented as UTF-8[10]
-characters.
-
-For compatibility with existing applications, implementations of this
-API will by default use version 2 of the LDAP protocol. Applications
-that intend to take advantage of LDAP version 3 features will need to
-
-
-
-Expires: January 1998 [Page 3]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-use the ldap_set_option() call with a LDAP_OPT_PROTOCOL_VERSION to
-switch to version 3.
-
-
-5. Common Data Structures
-
-Some data structures that are common to several LDAP API functions are
-defined here:
-
- typedef struct ldap LDAP;
-
- typedef struct ldapmsg LDAPMessage;
-
- struct berval {
- unsigned long bv_len;
- char *bv_val;
- };
-
- struct timeval {
- long tv_sec;
- long tv_usec;
- };
-
-The LDAP structure is an opaque data type that represents an LDAP ses-
-sion Typically this corresponds to a connection to a single server, but
-it may encompass several server connections in the face of LDAPv3 refer-
-rals.
-
-The LDAPMessage structure is an opaque data type that is used to return
-results and error information.
-
-The berval structure is used to represent arbitrary binary data and its
-fields have the following meanings:
-
-bv_len Length of data in bytes.
-
-bv_val A pointer to the data itself.
-
-
-The timeval structure is used to represent an interval of time and its
-fields have the following meanings:
-
-tv_sec Seconds component of time interval.
-
-tv_usec Microseconds component of time interval.
-
-
-
-
-
-
-Expires: January 1998 [Page 4]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-6. LDAP Error Codes
-
-Many of the LDAP API routines return LDAP error codes, some of which
-indicate local errors and some of which may be returned by servers.
-Supported error codes are (hexadecimal values are given in parentheses
-after the constant):
-
- LDAP_SUCCESS (0x00)
- LDAP_OPERATIONS_ERROR( 0x01)
- LDAP_PROTOCOL_ERROR (0x02)
- LDAP_TIMELIMIT_EXCEEDED (0x03)
- LDAP_SIZELIMIT_EXCEEDED (0x04)
- LDAP_COMPARE_FALSE (0x05)
- LDAP_COMPARE_TRUE (0x06)
- LDAP_STRONG_AUTH_NOT_SUPPORTED (0x07)
- LDAP_STRONG_AUTH_REQUIRED (0x08)
- LDAP_REFERRAL (0x0a) -- new in LDAPv3
- LDAP_ADMINLIMIT_EXCEEDED (0x0b) -- new in LDAPv3
- LDAP_UNAVAILABLE_CRITICAL_EXTENSION (0x0c) -- new in LDAPv3
- LDAP_CONFIDENTIALITY_REQUIRED (0x0d) -- new in LDAPv3
- LDAP_NO_SUCH_ATTRIBUTE (0x10)
- LDAP_UNDEFINED_TYPE (0x11)
- LDAP_INAPPROPRIATE_MATCHING (0x12)
- LDAP_CONSTRAINT_VIOLATION (0x13)
- LDAP_TYPE_OR_VALUE_EXISTS (0x14)
- LDAP_INVALID_SYNTAX (0x15)
- LDAP_NO_SUCH_OBJECT (0x20)
- LDAP_ALIAS_PROBLEM (0x21)
- LDAP_INVALID_DN_SYNTAX (0x22)
- LDAP_IS_LEAF (0x23) -- not used in LDAPv3
- LDAP_ALIAS_DEREF_PROBLEM (0x24)
- LDAP_INAPPROPRIATE_AUTH (0x30)
- LDAP_INVALID_CREDENTIALS (0x31)
- LDAP_INSUFFICIENT_ACCESS (0x32)
- LDAP_BUSY (0x33)
- LDAP_UNAVAILABLE (0x34)
- LDAP_UNWILLING_TO_PERFORM (0x35)
- LDAP_LOOP_DETECT (0x36)
- LDAP_NAMING_VIOLATION (0x40)
- LDAP_OBJECT_CLASS_VIOLATION (0x41)
- LDAP_NOT_ALLOWED_ON_NONLEAF (0x42)
- LDAP_NOT_ALLOWED_ON_RDN (0x43)
- LDAP_ALREADY_EXISTS (0x44)
- LDAP_NO_OBJECT_CLASS_MODS (0x45)
- LDAP_RESULTS_TOO_LARGE (0x46)
- LDAP_AFFECTS_MULTIPLE_DSAS (0x47) -- new in LDAPv3
- LDAP_OTHER (0x50)
- LDAP_SERVER_DOWN (0x51)
-
-
-
-Expires: January 1998 [Page 5]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- LDAP_LOCAL_ERROR (0x52)
- LDAP_ENCODING_ERROR (0x53)
- LDAP_DECODING_ERROR (0x54)
- LDAP_TIMEOUT (0x55)
- LDAP_AUTH_UNKNOWN (0x56)
- LDAP_FILTER_ERROR (0x57)
- LDAP_USER_CANCELLED (0x58)
- LDAP_PARAM_ERROR (0x59)
- LDAP_NO_MEMORY (0x5a)
- LDAP_CONNECT_ERROR (0x5b)
- LDAP_NOT_SUPPORTED (0x5c)
- LDAP_CONTROL_NOT_FOUND (0x5d)
- LDAP_NO_RESULTS_RETURNED (0x5e)
- LDAP_MORE_RESULTS_TO_RETURN (0x5f)
- LDAP_CLIENT_LOOP (0x60)
- LDAP_REFERRAL_LIMIT_EXCEEDED (0x61)
-
-
-7. Performing LDAP Operations
-
-This section describes each LDAP operation API call in detail. All func-
-tions take a "session handle," a pointer to an LDAP structure containing
-per-connection information. Many routines return results in an LDAPMes-
-sage structure. These structures and others are described as needed
-below.
-
-
-7.1. Initializing an LDAP Session
-
-ldap_init() initializes a session with an LDAP server. The server is not
-actually contacted until an operation is performed that requires it,
-allowing various options to be set after initialization.
-
- LDAP *ldap_init(
- char *hostname,
- int portno
- );
-
-Use of the following routine is deprecated.
-
- LDAP *ldap_open(
- char *hostname,
- int portno
- );
-
-Parameters are:
-
-hostname Contains a space-separated list of hostnames or dotted strings
-
-
-
-Expires: January 1998 [Page 6]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- representing the IP address of hosts running an LDAP server to
- connect to. Each hostname in the list can include an optional
- port number which is separated from the host itself with a
- colon (:) character. The hosts are tried in the order listed,
- stopping with the first one to which a successful connection is
- made. Note that only ldap_open() attempts to make the connec-
- tion before returning to the caller. ldap_init() does not con-
- nect to the LDAP server.
-
-portno Contains the TCP port number to connect to. The default LDAP
- port of 389 can be obtained by supplying the constant
- LDAP_PORT. If a host includes a port number then this parame-
- ter is ignored.
-
-ldap_init() and ldap_open() both return a "session handle," a pointer to
-an opaque structure that should be passed to subsequent calls pertaining
-to the session. These routines return NULL if the session cannot be ini-
-tialized in which case the operating system error reporting mechanism
-can be checked to see why the call failed.
-
-Note that if you connect to an LDAPv2 server, one of the ldap_bind()
-calls described below must be completed before other operations can be
-performed on the session. LDAPv3 does not require that a bind operation
-be completed before other operations can be performed.
-
-The calling program can set various attributes of the session by calling
-the routines described in the next section.
-
-
-7.2. LDAP Session Handle Options
-
-The LDAP session handle returned by ldap_init() is a pointer to an
-opaque data type representing an LDAP session. Formerly, this data type
-was a structure exposed to the caller, and various fields in the struc-
-ture could be set to control aspects of the session, such as size and
-time limits on searches.
-
-In the interest of insulating callers from inevitable changes to this
-structure, these aspects of the session are now accessed through a pair
-of accessor functions, described below.
-
-ldap_get_option() is used to access the current value of various
-session-wide parameters. ldap_set_option() is used to set the value of
-these parameters.
-
- int ldap_get_option(
- LDAP *ld,
- int option,
-
-
-
-Expires: January 1998 [Page 7]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- void *outvalue
- );
-
- int ldap_set_option(
- LDAP *ld,
- int option,
- void *invalue
- );
-
-Parameters are:
-
-ld The session handle.
-
-option The name of the option being accessed or set. This parameter
- should be one of the following constants, which have the indi-
- cated meanings. After the constant the actual value of the con-
- stant is listed in hexadecimal in parentheses followed by the
- type of the corresponding outvalue or invalue parameter.
-
- LDAP_OPT_DESC (0x01) int *
- The underlying socket descriptor corresponding to the default
- LDAP connection.
-
- LDAP_OPT_DEREF (0x02) int *
- Controls how aliases are handled during search. It can have
- one of the following values: LDAP_DEREF_NEVER (0x00),
- LDAP_DEREF_SEARCHING (0x01), LDAP_DEREF_FINDING (0x02), or
- LDAP_DEREF_ALWAYS (0x03). The LDAP_DEREF_SEARCHING value
- means aliases should be dereferenced during the search but not
- when locating the base object of the search. The
- LDAP_DEREF_FINDING value means aliases should be dereferenced
- when locating the base object but not during the search.
-
- LDAP_OPT_SIZELIMIT (0x03) int *
- A limit on the number of entries to return from a search. A
- value of zero means no limit.
-
- LDAP_OPT_TIMELIMIT (0x04) int *
- A limit on the number of seconds to spend on a search. A value
- of zero means no limit
-
- LDAP_OPT_REBIND_FN (0x06) function pointer
- See the discussion of ldap_bind() and friends below.
-
- LDAP_OPT_REBIND_ARG (0x07) void *
- See the discussion of ldap_bind() and friends below.
-
- LDAP_OPT_REFERRALS (0x08) void *
-
-
-
-Expires: January 1998 [Page 8]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- This option controls whether the LDAP library automatically
- follows referrals returned by LDAP servers or not. It can be
- set to one of the constants LDAP_OPT_ON or LDAP_OPT_OFF.
-
- LDAP_OPT_RESTART (0x09) void *
- This option controls whether LDAP I/O operations should
- automatically be restarted if they abort prematurely. It
- should be set to one of the constants LDAP_OPT_ON or
- LDAP_OPT_OFF. This option is useful if an LDAP I/O operation
- may be interrupted prematurely, for example by a timer going
- off, or other interrrupt.
-
- LDAP_OPT_PROTOCOL_VERSION (0x11) int *
- This option indicates the version of the default LDAP server.
- It can be one of the constants LDAP_VERSION2 or LDAP_VERSION3.
- If no version is set the default is LDAP_VERSION2.
-
- LDAP_OPT_SERVER_CONTROLS (0x12) LDAPControl **
- A default list of LDAP server controls to be sent with each
- request. See the Using Controls section below.
-
- LDAP_OPT_CLIENT_CONTROLS (0x13) LDAPControl **
- A default list of client controls that affect the LDAP ses-
- sion. See the Using Controls section below.
-
- LDAP_OPT_HOST_NAME (0x30) char **
- The host name of the default LDAP server.
-
- LDAP_OPT_ERROR_NUMBER (0x31) int *
- The code of the most recent LDAP error that occurred for this
- session.
-
- LDAP_OPT_ERROR_STRING (0x32) char **
- The message returned with the most recent LDAP error that
- occurred for this session.
-
-
-outvalue The address of a place to put the value of the option. The
- actual type of this parameter depends on the setting of the
- option parameter.
-
-invalue A pointer to the value the option is to be given. The actual
- type of this parameter depends on the setting of the option
- parameter. The constants LDAP_OPT_ON and LDAP_OPT_OFF can be
- given for options that have on or off settings.
-
-
-
-
-
-
-Expires: January 1998 [Page 9]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-7.3. Working with controls
-
-LDAPv3 operations can be extended through the use of controls. Controls
-may be sent to a server or returned to the client with any LDAP message.
-These controls are referred to as server controls.
-
-The LDAP API also supports a client-side extension mechanism through the
-use of client controls. These controls affect the behavior of the LDAP
-API only and are never sent to a server. A common data structure is
-used to represent both types of controls:
-
- typedef struct ldapcontrol {
- char *ldctl_oid;
- struct berval ldctl_value;
- char ldctl_iscritical;
- } LDAPControl, *PLDAPControl;
-
-The fields in the ldapcontrol structure have the following meanings:
-
-ldctl_oid The control type, represented as a string.
-
-ldctl_value The data associated with the control (if any).
-
-ldctl_iscritical Indicates whether the control is critical of not. If
- this field is non-zero, the operation will only be car-
- ried out if the control is recognized by the server
- and/or client.
-
-Some LDAP API calls allocate an ldapcontrol structure or a NULL-
-terminated array of ldapcontrol structures. The following routines can
-be used to dispose of a single control or an array of controls:
-
- void ldap_control_free( LDAPControl *ctrl );
- void ldap_controls_free( LDAPControl **ctrls );
-
-A set of controls that affect the entire session can be set using the
-ldap_set_option() function (see above). A list of controls can also be
-passed directly to some LDAP API calls such as ldap_search_ext(), in
-which case any controls set for the session through the use of
-ldap_set_option() are ignored. Control lists are represented as a NULL-
-terminated array of pointers to ldapcontrol structures.
-
-Server controls are defined by LDAPv3 protocol extension documents; for
-example, a control has been proposed to support server-side sorting of
-search results [7].
-
-No client controls are defined by this document but they may be defined
-in future revisions or in any document that extends this API.
-
-
-
-Expires: January 1998 [Page 10]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-7.4. Authenticating to the directory
-
-The following functions are used to authenticate an LDAP client to an
-LDAP directory server.
-
-The ldap_sasl_bind() and ldap_sasl_bind_s() functions can be used to do
-general and extensible authentication over LDAP through the use of the
-Simple Authentication Security Layer [8]. The routines both take the dn
-to bind as, the method to use, as a dotted-string representation of an
-OID identifying the method, and a struct berval holding the credentials.
-The special constant value LDAP_SASL_SIMPLE ("") can be passed to
-request simple authentication, or the simplified routines
-ldap_simple_bind() or ldap_simple_bind_s() can be used.
-
- int ldap_sasl_bind(
- LDAP *ld,
- char *dn,
- char *mechanism,
- struct berval *cred,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
- int ldap_sasl_bind_s(
- LDAP *ld,
- char *dn,
- char *mechanism,
- struct berval *cred,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- struct berval **servercredp
- );
-
- int ldap_simple_bind(
- LDAP *ld,
- char *dn,
- char *passwd
- );
-
- int ldap_simple_bind_s(
- LDAP *ld,
- char *dn,
- char *passwd
- );
-
- The use of the following routines is deprecated:
-
-
-
-
-Expires: January 1998 [Page 11]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- int ldap_bind( LDAP *ld, char *dn, char *cred, int method );
-
- int ldap_bind_s( LDAP *ld, char *dn, char *cred, int method );
-
- int ldap_kerberos_bind( LDAP *ld, char *dn );
-
- int ldap_kerberos_bind_s( LDAP *ld, char *dn );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry to bind as.
-
-mechanism Either LDAP_AUTH_SIMPLE_OID to get simple authentication,
- or a dotted text string representing an OID identifying the
- SASL method.
-
-cred The credentials with which to authenticate. Arbitrary
- credentials can be passed using this parameter. The format
- and content of the credentials depends on the setting of
- the mechanism parameter.
-
-passwd For ldap_simple_bind(), the password to compare to the
- entry's userPassword attribute.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_sasl_bind() call succeeds.
-
-servercredp This result parameter will be set to the credentials
- returned by the server. This should be freed by calling
- ldap_If no credentials are returned it will be set to NULL.
-
-Additional parameters for the deprecated routines are not described.
-Interested readers are referred to RFC 1823.
-
-The ldap_sasl_bind() function initiates an asynchronous bind operation
-and returns the constant LDAP_SUCCESS if the request was successfully
-sent, or another LDAP error code if not. See the section below on error
-handling for more information about possible errors and how to interpret
-them. If successful, ldap_sasl_bind() places the message id of the
-request in *msgidp. A subsequent call to ldap_result(), described below,
-can be used to obtain the result of the bind.
-
-
-
-
-Expires: January 1998 [Page 12]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-The ldap_simple_bind() function initiates a simple asynchronous bind
-operation and returns the message id of the operation initiated. A sub-
-sequent call to ldap_result(), described below, can be used to obtain
-the result of the bind. In case of error, ldap_simple_bind() will return
--1, setting the session error parameters in the LDAP structure appropri-
-ately.
-
-The synchronous ldap_sasl_bind_s() and ldap_simple_bind_s() functions
-both return the result of the operation, either the constant
-LDAP_SUCCESS if the operation was successful, or another LDAP error code
-if it was not. See the section below on error handling for more informa-
-tion about possible errors and how to interpret them.
-
-Note that if an LDAPv2 server is contacted, no other operations over the
-connection should be attempted before a bind call has successfully com-
-pleted.
-
-Subsequent bind calls can be used to re-authenticate over the same con-
-nection, and multistep SASL sequences can be accomplished through a
-sequence of calls to ldap_sasl_bind() or ldap_sasl_bind_s().
-
-
-7.5. Closing the session
-
-The following functions are used to unbind from the directory, close the
-connection, and dispose of the session handle.
-
- int ldap_unbind( LDAP *ld );
-
- int ldap_unbind_s( LDAP *ld );
-
-Parameters are:
-
-ld The session handle.
-
-ldap_unbind() and ldap_unbind_s() both work synchronously, unbinding
-from the directory, closing the connection, and freeing up the ld struc-
-ture before returning. There is no server response to an unbind opera-
-tion. ldap_unbind() returns LDAP_SUCCESS (or another LDAP error code if
-the request cannot be sent to the LDAP server). After a call to
-ldap_unbind() or ldap_unbind_s(), the session handle ld is invalid.
-
-
-7.6. Searching
-
-The following functions are used to search the LDAP directory, returning
-a requested set of attributes for each entry matched. There are five
-variations.
-
-
-
-Expires: January 1998 [Page 13]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- int ldap_search_ext(
- LDAP *ld,
- char *base,
- int scope,
- char *filter,
- char **attrs,
- int attrsonly,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- struct timeval *timeoutp,
- int sizelimit,
- int *msgidp
- );
-
- int ldap_search_ext_s(
- LDAP *ld,
- char *base,
- int scope,
- char *filter,
- char **attrs,
- int attrsonly,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- struct timeval *timeoutp,
- int sizelimit,
- LDAPMessage **res
- );
-
- int ldap_search(
- LDAP *ld,
- char *base,
- int scope,
- char *filter,
- char **attrs,
- int attrsonly
- );
-
- int ldap_search_s(
- LDAP *ld,
- char *base,
- int scope,
- char *filter,
- char **attrs,
- int attrsonly,
- LDAPMessage **res
- );
-
- int ldap_search_st(
-
-
-
-Expires: January 1998 [Page 14]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- LDAP *ld,
- char *base,
- int scope,
- char *filter,
- char **attrs,
- int attrsonly,
- struct timeval *timeout,
- LDAPMessage **res
- );
-
-Parameters are:
-
-ld The session handle.
-
-base The dn of the entry at which to start the search.
-
-scope One of LDAP_SCOPE_BASE (0x00), LDAP_SCOPE_ONELEVEL (0x01),
- or LDAP_SCOPE_SUBTREE (0x02), indicating the scope of the
- search.
-
-filter A character string as described in [3], representing the
- search filter.
-
-attrs A NULL-terminated array of strings indicating which attri-
- butes to return for each matching entry. Passing NULL for
- this parameter causes all available attributes to be
- retrieved.
-
-attrsonly A boolean value that should be zero if both attribute types
- and values are to be returned, non-zero if only types are
- wanted.
-
-timeout For the ldap_search_st() function, this specifies the local
- search timeout value. For the ldap_search_ext() and
- ldap_search_ext_s() functions, this specifies both the
- local search timeout value and the operation time limit
- that is sent to the server within the search request.
-
-res For the synchronous calls, this is a result parameter which
- will contain the results of the search upon completion of
- the call.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_search_ext() call succeeds.
-
-
-
-Expires: January 1998 [Page 15]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-There are three options in the session handle ld which potentially
-affect how the search is performed. They are:
-
-LDAP_OPT_SIZELIMIT
- A limit on the number of entries to return from the search.
- A value of zero means no limit. Note that the value from
- the session handle is ignored when using the
- ldap_search_ext() or ldap_search_ext_s() functions.
-
-LDAP_OPT_TIMELIMIT
- A limit on the number of seconds to spend on the search. A
- value of zero means no limit. Note that the value from the
- session handle is ignored when using the ldap_search_ext()
- or ldap_search_ext_s() functions.
-
-LDAP_OPT_DEREF
- One of LDAP_DEREF_NEVER (0x00), LDAP_DEREF_SEARCHING
- (0x01), LDAP_DEREF_FINDING (0x02), or LDAP_DEREF_ALWAYS
- (0x03), specifying how aliases should be handled during the
- search. The LDAP_DEREF_SEARCHING value means aliases should
- be dereferenced during the search but not when locating the
- base object of the search. The LDAP_DEREF_FINDING value
- means aliases should be dereferenced when locating the base
- object but not during the search.
-
-The ldap_search_ext() function initiates an asynchronous search opera-
-tion and returns the constant LDAP_SUCCESS if the request was success-
-fully sent, or another LDAP error code if not. See the section below on
-error handling for more information about possible errors and how to
-interpret them. If successful, ldap_search_ext() places the message id
-of the request in *msgidp. A subsequent call to ldap_result(), described
-below, can be used to obtain the results from the search. These results
-can be parsed using the result parsing routines described in detail
-later.
-
-Similar to ldap_search_ext(), the ldap_search() function initiates an
-asynchronous search operation and returns the message id of the opera-
-tion initiated. As for ldap_search_ext(), a subsequent call to
-ldap_result(), described below, can be used to obtain the result of the
-bind. In case of error, ldap_search() will return -1, setting the ses-
-sion error parameters in the LDAP structure appropriately.
-
-The synchronous ldap_search_ext_s(), ldap_search_s(), and
-ldap_search_st() functions all return the result of the operation,
-either the constant LDAP_SUCCESS if the operation was successful, or
-another LDAP error code if it was not. See the section below on error
-handling for more information about possible errors and how to interpret
-them. Entries returned from the search (if any) are contained in the
-
-
-
-Expires: January 1998 [Page 16]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-res parameter. This parameter is opaque to the caller. Entries, attri-
-butes, values, etc., should be extracted by calling the parsing routines
-described below. The results contained in res should be freed when no
-longer in use by calling ldap_msgfree(), described later.
-
-The ldap_search_ext() and ldap_search_ext_s() functions support LDAPv3
-server controls, client controls, and allow varying size and time limits
-to be easily specified for each search operation. The ldap_search_st()
-function is identical to ldap_search_s() except that it takes an addi-
-tional parameter specifying a local timeout for the search.
-
-7.7. Reading an Entry
-
-LDAP does not support a read operation directly. Instead, this operation
-is emulated by a search with base set to the DN of the entry to read,
-scope set to LDAP_SCOPE_BASE, and filter set to "(objectclass=*)". attrs
-contains the list of attributes to return.
-
-
-7.8. Listing the Children of an Entry
-
-LDAP does not support a list operation directly. Instead, this operation
-is emulated by a search with base set to the DN of the entry to list,
-scope set to LDAP_SCOPE_ONELEVEL, and filter set to "(objectclass=*)".
-attrs contains the list of attributes to return for each child entry.
-
-7.9. Comparing a Value Against an Entry
-
-The following routines are used to compare a given attribute value
-assertion against an LDAP entry. There are four variations:
-
- int ldap_compare_ext(
- LDAP *ld,
- char *dn,
- char *attr,
- struct berval *bvalue
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
- int ldap_compare_ext_s(
- LDAP *ld,
- char *dn,
- char *attr,
- struct berval *bvalue,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
-
-
-
-Expires: January 1998 [Page 17]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- );
-
- int ldap_compare(
- LDAP *ld,
- char *dn,
- char *attr,
- char *value
- );
-
- int ldap_compare_s(
- LDAP *ld,
- char *dn,
- char *attr,
- char *value
- );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry to compare against.
-
-attr The attribute to compare against.
-
-bvalue The attribute value to compare against those found in the
- given entry. This parameter is used in the extended rou-
- tines and is a pointer to a struct berval so it is possible
- to compare binary values.
-
-value A string attribute value to compare against, used by the
- ldap_compare() and ldap_compare_s() functions. Use
- ldap_compare_ext() or ldap_compare_ext_s() if you need to
- compare binary values.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_compare_ext() call succeeds.
-
-The ldap_compare_ext() function initiates an asynchronous compare opera-
-tion and returns the constant LDAP_SUCCESS if the request was success-
-fully sent, or another LDAP error code if not. See the section below on
-error handling for more information about possible errors and how to
-interpret them. If successful, ldap_compare_ext() places the message id
-of the request in *msgidp. A subsequent call to ldap_result(), described
-below, can be used to obtain the result of the compare.
-
-
-
-Expires: January 1998 [Page 18]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-Similar to ldap_compare_ext(), the ldap_compare() function initiates an
-asynchronous compare operation and returns the message id of the opera-
-tion initiated. As for ldap_compare_ext(), a subsequent call to
-ldap_result(), described below, can be used to obtain the result of the
-bind. In case of error, ldap_compare() will return -1, setting the ses-
-sion error parameters in the LDAP structure appropriately.
-
-The synchronous ldap_compare_ext_s() and ldap_compare_s() functions both
-return the result of the operation, either the constant LDAP_SUCCESS if
-the operation was successful, or another LDAP error code if it was not.
-See the section below on error handling for more information about pos-
-sible errors and how to interpret them.
-
-The ldap_compare_ext() and ldap_compare_ext_s() functions support LDAPv3
-server controls and client controls.
-
-
-7.10. Modifying an entry
-
-The following routines are used to modify an existing LDAP entry. There
-are four variations:
-
- typedef struct ldapmod {
- int mod_op;
- char *mod_type;
- union {
- char **modv_strvals;
- struct berval **modv_bvals;
- } mod_vals;
- } LDAPMod;
- #define mod_values mod_vals.modv_strvals
- #define mod_bvalues mod_vals.modv_bvals
-
- int ldap_modify_ext(
- LDAP *ld,
- char *dn,
- LDAPMod **mods,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
- int ldap_modify_ext_s(
- LDAP *ld,
- char *dn,
- LDAPMod **mods,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
-
-
-
-Expires: January 1998 [Page 19]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- );
-
- int ldap_modify(
- LDAP *ld,
- char *dn,
- LDAPMod **mods
- );
-
- int ldap_modify_s(
- LDAP *ld,
- char *dn,
- LDAPMod **mods
- );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry to modify.
-
-mods A NULL-terminated array of modifications to make to the
- entry.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_modify_ext() call succeeds.
-
-The fields in the LDAPMod structure have the following meanings:
-
-mod_op The modification operation to perform. It should be one of
- LDAP_MOD_ADD (0x00), LDAP_MOD_DELETE (0x01), or
- LDAP_MOD_REPLACE (0x02). This field also indicates the
- type of values included in the mod_vals union. It is logi-
- cally ORed with LDAP_MOD_BVALUES (0x80) to select the
- mod_bvalues form. Otherwise, the mod_values form is used.
-
-mod_type The type of the attribute to modify.
-
-mod_vals The values (if any) to add, delete, or replace. Only one of
- the mod_values or mod_bvalues variants should be used,
- selected by ORing the mod_op field with the constant
- LDAP_MOD_BVALUES. mod_values is a NULL-terminated array of
- zero-terminated strings and mod_bvalues is a NULL-
- terminated array of berval structures that can be used to
- pass binary values such as images.
-
-
-
-Expires: January 1998 [Page 20]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-For LDAP_MOD_ADD modifications, the given values are added to the
-entry, creating the attribute if necessary.
-
-For LDAP_MOD_DELETE modifications, the given values are deleted from the
-entry, removing the attribute if no values remain. If the entire attri-
-bute is to be deleted, the mod_vals field should be set to NULL.
-
-For LDAP_MOD_REPLACE modifications, the attribute will have the listed
-values after the modification, having been created if necessary, or
-removed if the mod_vals field is NULL. All modifications are performed
-in the order in which they are listed.
-
-The ldap_modify_ext() function initiates an asynchronous modify opera-
-tion and returns the constant LDAP_SUCCESS if the request was success-
-fully sent, or another LDAP error code if not. See the section below on
-error handling for more information about possible errors and how to
-interpret them. If successful, ldap_modify_ext() places the message id
-of the request in *msgidp. A subsequent call to ldap_result(), described
-below, can be used to obtain the result of the modify.
-
-Similar to ldap_modify_ext(), the ldap_modify() function initiates an
-asynchronous modify operation and returns the message id of the opera-
-tion initiated. As for ldap_modify_ext(), a subsequent call to
-ldap_result(), described below, can be used to obtain the result of the
-modify. In case of error, ldap_modify() will return -1, setting the ses-
-sion error parameters in the LDAP structure appropriately.
-
-The synchronous ldap_modify_ext_s() and ldap_modify_s() functions both
-return the result of the operation, either the constant LDAP_SUCCESS if
-the operation was successful, or another LDAP error code if it was not.
-See the section below on error handling for more information about pos-
-sible errors and how to interpret them.
-
-The ldap_modify_ext() and ldap_modify_ext_s() functions support LDAPv3
-server controls and client controls.
-
-
-7.11. Modifying the Name of an Entry
-
-In LDAPv2, the ldap_modrdn() and ldap_modrdn_s() routines were used to
-change the name of an LDAP entry. They could only be used to change the
-least significant component of a name (the RDN or relative distinguished
-name). LDAPv3 provides the Modify DN protocol operation that allows more
-general name change access. The ldap_rename() and ldap_rename_s() rou-
-tines are used to change the name of an entry, and the use of the
-ldap_modrdn() and ldap_modrdn_s() routines is deprecated.
-
- int ldap_rename(
-
-
-
-Expires: January 1998 [Page 21]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- LDAP *ld,
- char *dn,
- char *newrdn,
- char *newparent,
- int deleteoldrdn,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
-
- );
- int ldap_rename_s(
- LDAP *ld,
- char *dn,
- char *newrdn,
- char *newparent,
- int deleteoldrdn,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
- );
-
- Use of the following routines is deprecated.
-
- int ldap_modrdn(
- LDAP *ld,
- char *dn,
- char *newrdn,
- int deleteoldrdn
- );
- int ldap_modrdn_s(
- LDAP *ld,
- char *dn,
- char *newrdn,
- int deleteoldrdn
- );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry whose DN is to be changed.
-
-newrdn The new RDN to give the entry.
-
-newparent The new parent, or superior entry. If this parameter is
- NULL, only the RDN of the entry is changed. The root DN
- may be specified by passing a zero length string, "". The
- newparent parameter should always be NULL when using ver-
- sion 2 of the LDAP protocol; otherwise the server's
-
-
-
-Expires: January 1998 [Page 22]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- behavior is undefined.
-
-deleteoldrdn This parameter only has meaning on the rename routines if
- newrdn is different than the old RDN. It is a boolean
- value, if non-zero indicating that the old RDN value(s)
- should be removed, if zero indicating that the old RDN
- value(s) should be retained as non-distinguished values of
- the entry.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_rename() call succeeds.
-
-The ldap_rename() function initiates an asynchronous modify DN operation
-and returns the constant LDAP_SUCCESS if the request was successfully
-sent, or another LDAP error code if not. See the section below on error
-handling for more information about possible errors and how to interpret
-them. If successful, ldap_rename() places the DN message id of the
-request in *msgidp. A subsequent call to ldap_result(), described below,
-can be used to obtain the result of the rename.
-
-The synchronous ldap_rename_s() returns the result of the operation,
-either the constant LDAP_SUCCESS if the operation was successful, or
-another LDAP error code if it was not. See the section below on error
-handling for more information about possible errors and how to interpret
-them.
-
-The ldap_rename() and ldap_rename_s() functions both support LDAPv3
-server controls and client controls.
-
-
-7.12. Adding an entry
-
-The following functions are used to add entries to the LDAP directory.
-There are four variations:
-
- int ldap_add_ext(
- LDAP *ld,
- char *dn,
- LDAPMod **attrs,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
-
-
-
-Expires: January 1998 [Page 23]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- int ldap_add_ext_s(
- LDAP *ld,
- char *dn,
- LDAPMod **attrs,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
- );
-
- int ldap_add(
- LDAP *ld,
- char *dn,
- LDAPMod **attrs
- );
-
- int ldap_add_s(
- LDAP *ld,
- char *dn,
- LDAPMod **attrs
- );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry to add.
-
-attrs The entry's attributes, specified using the LDAPMod struc-
- ture defined for ldap_modify(). The mod_type and mod_vals
- fields should be filled in. The mod_op field is ignored
- unless ORed with the constant LDAP_MOD_BVALUES, used to
- select the mod_bvalues case of the mod_vals union.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_add_ext() call succeeds.
-
-Note that the parent of the entry being added must already exist or the
-parent must be empty (i.e., equal to the root DN) for an add to succeed.
-
-The ldap_add_ext() function initiates an asynchronous add operation and
-returns the constant LDAP_SUCCESS if the request was successfully sent,
-or another LDAP error code if not. See the section below on error han-
-dling for more information about possible errors and how to interpret
-them. If successful, ldap_add_ext() places the message id of the
-request in *msgidp. A subsequent call to ldap_result(), described below,
-
-
-
-Expires: January 1998 [Page 24]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-can be used to obtain the result of the add.
-
-Similar to ldap_add_ext(), the ldap_add() function initiates an asyn-
-chronous add operation and returns the message id of the operation ini-
-tiated. As for ldap_add_ext(), a subsequent call to ldap_result(),
-described below, can be used to obtain the result of the add. In case of
-error, ldap_add() will return -1, setting the session error parameters
-in the LDAP structure appropriately.
-
-The synchronous ldap_add_ext_s() and ldap_add_s() functions both return
-the result of the operation, either the constant LDAP_SUCCESS if the
-operation was successful, or another LDAP error code if it was not. See
-the section below on error handling for more information about possible
-errors and how to interpret them.
-
-The ldap_add_ext() and ldap_add_ext_s() functions support LDAPv3 server
-controls and client controls.
-
-
-
-7.13. Deleting an entry
-
-The following functions are used to delete a leaf entry from the LDAP
-directory. There are four variations:
-
- int ldap_delete_ext(
- LDAP *ld,
- char *dn,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
- int ldap_delete_ext_s(
- LDAP *ld,
- char *dn,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
- );
-
- int ldap_delete(
- LDAP *ld,
- char *dn
- );
-
- int ldap_delete_s(
- LDAP *ld,
- char *dn
-
-
-
-Expires: January 1998 [Page 25]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- );
-
-Parameters are:
-
-ld The session handle.
-
-dn The name of the entry to delete.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_delete_ext() call succeeds.
-
-Note that the entry to delete must be a leaf entry (i.e., it must have
-no children). Deletion of entire subtrees in a single operation is not
-supported by LDAP.
-
-The ldap_delete_ext() function initiates an asynchronous delete opera-
-tion and returns the constant LDAP_SUCCESS if the request was success-
-fully sent, or another LDAP error code if not. See the section below on
-error handling for more information about possible errors and how to
-interpret them. If successful, ldap_delete_ext() places the message id
-of the request in *msgidp. A subsequent call to ldap_result(), described
-below, can be used to obtain the result of the delete.
-
-Similar to ldap_delete_ext(), the ldap_delete() function initiates an
-asynchronous delete operation and returns the message id of the opera-
-tion initiated. As for ldap_delete_ext(), a subsequent call to
-ldap_result(), described below, can be used to obtain the result of the
-delete. In case of error, ldap_delete() will return -1, setting the ses-
-sion error parameters in the LDAP structure appropriately.
-
-The synchronous ldap_delete_ext_s() and ldap_delete_s() functions both
-return the result of the operation, either the constant LDAP_SUCCESS if
-the operation was successful, or another LDAP error code if it was not.
-See the section below on error handling for more information about pos-
-sible errors and how to interpret them.
-
-The ldap_delete_ext() and ldap_delete_ext_s() functions support LDAPv3
-server controls and client controls.
-
-
-7.14. Extended Operations
-
-The ldap_extended_operation() and ldap_extended_operation_s() routines
-allow extended LDAP operations to be passed to the server, providing a
-
-
-
-Expires: January 1998 [Page 26]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-general protocol extensibility mechanism.
-
- int ldap_extended_operation(
- LDAP *ld,
- char *exoid,
- struct berval *exdata,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- int *msgidp
- );
-
- int ldap_extended_operation_s(
- LDAP *ld,
- char *exoid,
- struct berval *exdata,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls,
- char **retoidp,
- struct berval **retdatap
- );
-
-Parameters are:
-
-ld The session handle.
-
-requestoid The dotted-OID text string naming the request.
-
-requestdata The arbitrary data required by the operation (if NULL, no
- data is sent to the server).
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-msgidp This result parameter will be set to the message id of the
- request if the ldap_extended_operation() call succeeds.
-
-retoidp Pointer to a character string that will be set to an allo-
- cated, dotted-OID text string returned by the server. This
- string should be disposed of using the ldap_memfree() func-
- tion. If no OID was returned, *retoidp is set to NULL.
-
-retdatap Pointer to a berval structure pointer that will be set an
- allocated copy of the data returned by the server. This
- struct berval should be disposed of using ber_bvfree(). If
- no data is returned, *retdatap is set to NULL.
-
-The ldap_extended_operation() function initiates an asynchronous
-
-
-
-Expires: January 1998 [Page 27]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-extended operation and returns the constant LDAP_SUCCESS if the request
-was successfully sent, or another LDAP error code if not. See the sec-
-tion below on error handling for more information about possible errors
-and how to interpret them. If successful, ldap_extended_operation()
-places the message id of the request in *msgidp. A subsequent call to
-ldap_result(), described below, can be used to obtain the result of the
-extended operation which can be passed to ldap_parse_extended_result()
-to obtain the OID and data contained in the response.
-
-The synchronous ldap_extended_operation_s() function returns the result
-of the operation, either the constant LDAP_SUCCESS if the operation was
-successful, or another LDAP error code if it was not. See the section
-below on error handling for more information about possible errors and
-how to interpret them. The retoid and retdata parameters are filled in
-with the OID and data from the response. If no OID or data was
-returned, these parameters are set to NULL.
-
-The ldap_extended_operation() and ldap_extended_operation_s() functions
-both support LDAPv3 server controls and client controls.
-
-
-8. Abandoning An Operation
-
-The following calls are used to abandon an operation in progress:
-
- int ldap_abandon_ext(
- LDAP *ld,
- int msgid,
- LDAPControl **serverctrls,
- LDAPControl **clientctrls
- );
-
- int ldap_abandon(
- LDAP *ld,
- int msgid
- );
-
-
-ld The session handle.
-
-msgid The message id of the request to be abandoned.
-
-serverctrls List of LDAP server controls.
-
-clientctrls List of client controls.
-
-ldap_abandon_ext() abandons the operation with message id msgid and
-returns the constant LDAP_SUCCESS if the abandon was successful or
-
-
-
-Expires: January 1998 [Page 28]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-another LDAP error code if not. See the section below on error handling
-for more information about possible errors and how to interpret them.
-
-ldap_abandon() is identical to ldap_abandon_ext() except that it returns
-zero if the abandon was successful, -1 otherwise and does not support
-LDAPv3 server controls or client controls.
-
-After a successful call to ldap_abandon() or ldap_abandon_ext(), results
-with the given message id are never returned from a subsequent call to
-ldap_result(). There is no server response to LDAP abandon operations.
-
-
-9. Obtaining Results and Peeking Inside LDAP Messages
-
-ldap_result() is used to obtain the result of a previous asynchronously
-initiated operation. Note that depending on how it is called,
-ldap_result() may actually return a list or "chain" of messages.
-
-ldap_msgfree() frees the results obtained from a previous call to
-ldap_result(), or a synchronous search routine.
-
-ldap_msgtype() returns the type of an LDAP message. ldap_msgid()
-returns the message ID of an LDAP message.
-
- int ldap_result(
- LDAP *ld,
- int msgid,
- int all,
- struct timeval *timeout,
- LDAPMessage **res
- );
-
- int ldap_msgfree( LDAPMessage *res );
-
- int ldap_msgtype( LDAPMessage *res );
-
- int ldap_msgid( LDAPMessage *res );
-
-Parameters are:
-
-ld The session handle.
-
-msgid The message id of the operation whose results are to be
- returned, or the constant LDAP_RES_ANY (-1) if any result is
- desired.
-
-all Specifies how many messages will be retrieved in a single call
- to ldap_result(). This parameter only has meaning for search
-
-
-
-Expires: January 1998 [Page 29]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- results. Pass the constant LDAP_MSG_ONE (0x00) to retrieve one
- message at a time. Pass LDAP_MSG_ALL (0x01) to request that
- all results of a search be received before returning all
- results in a single chain. Pass LDAP_MSG_RECEIVED (0x02) to
- indicate that all results retrieved so far should be returned
- in the result chain.
-
-timeout A timeout specifying how long to wait for results to be
- returned. A NULL value causes ldap_result() to block until
- results are available. A timeout value of zero seconds speci-
- fies a polling behavior.
-
-res For ldap_result(), a result parameter that will contain the
- result(s) of the operation. For ldap_msgfree(), the result
- chain to be freed, obtained from a previous call to
- ldap_result(), ldap_search_s(), or ldap_search_st().
-
-Upon successful completion, ldap_result() returns the type of the first
-result returned in the res parameter. This will be one of the following
-constants.
-
- LDAP_RES_BIND (0x61)
- LDAP_RES_SEARCH_ENTRY (0x64)
- LDAP_RES_SEARCH_REFERENCE (0x73) -- new in LDAPv3
- LDAP_RES_SEARCH_RESULT (0x65)
- LDAP_RES_MODIFY (0x67)
- LDAP_RES_ADD (0x69)
- LDAP_RES_DELETE (0x6B)
- LDAP_RES_MODDN (0x6D)
- LDAP_RES_COMPARE (0x6F)
- LDAP_RES_EXTENDED (0x78) -- new in LDAPv3
-
-ldap_result() returns 0 if the timeout expired and -1 if an error
-occurs, in which case the error parameters of the LDAP session handle
-will be set accordingly.
-
-ldap_msgfree() frees the result structure pointed to by res and returns
-the type of the message it freed.
-
-ldap_msgtype() returns the type of the LDAP message it is passed as a
-parameter. The type will be one of the types listed above, or -1 on
-error.
-
-ldap_msgid() returns the message ID associated with the LDAP message
-passed as a parameter.
-
-
-
-
-
-
-Expires: January 1998 [Page 30]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-10. Handling Errors and Parsing Results
-
-The following calls are used to extract information from results and
-handle errors returned by other LDAP API routines.
-
- int ldap_parse_result(
- LDAP *ld,
- LDAPMessage *res,
- int *errcodep,
- char **matcheddnp,
- char **errmsgp,
- char ***referralsp,
- LDAPControl ***serverctrlsp,
- int freeit
- );
-
- int ldap_parse_sasl_bind_result(
- LDAP *ld,
- LDAPMessage *res,
- struct berval **servercredp,
- int freeit
- );
-
- int ldap_parse_extended_result(
- LDAP *ld,
- LDAPMessage *res,
- char **resultoidp,
- struct berval **resultdata,
- int freeit
- );
-
- char *ldap_err2string( int err );
-
- The use of the following routines is deprecated.
-
- int ldap_result2error(
- LDAP *ld,
- LDAPMessage *res,
- int freeit
- );
-
- void ldap_perror( LDAP *ld, char *msg );
-
-Parameters are:
-
-ld The session handle.
-
-res The result of an LDAP operation as returned by
-
-
-
-Expires: January 1998 [Page 31]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- ldap_result() or one of the synchronous API operation
- calls.
-
-errcodep This result parameter will be filled in with the LDAP error
- code field from the LDAPResult message. This is the indi-
- cation from the server of the outcome of the operation.
- NULL may be passed to ignore this field.
-
-matcheddnp In the case of a return of LDAP_NO_SUCH_OBJECT, this result
- parameter will be filled in with a DN indicating how much
- of the name in the request was recognized. NULL may be
- passed to ignore this field. The matched DN string should
- be freed by calling ldap_memfree() which is described later
- in this document.
-
-errmsgp This result parameter will be filled in with the contents
- of the error message field from the LDAPResult message.
- The error message string should be freed by calling
- ldap_memfree() which is described later in this document.
- NULL may be passed to ignore this field.
-
-referralsp This result parameter will be filled in with the contents
- of the referrals field from the LDAPResult message, indi-
- cating zero or more alternate LDAP servers where the
- request should be retried. The referrals array should be
- freed by calling ldap_value_free() which is described later
- in this document. NULL may be passed to ignore this field.
-
-serverctrlsp This result parameter will be filled in with an allocated
- array of controls copied out of the LDAPResult message.
- The control array should be freed by calling
- ldap_controls_free() which was described earlier.
-
-freeit A boolean that determines whether the res parameter is
- disposed of or not. Pass any non-zero value to have these
- routines free res after extracting the requested informa-
- tion. This is provided as a convenience; you can also use
- ldap_msgfree() to free the result later.
-
-servercredp For SASL bind results, this result parameter will be filled
- in with the credentials passed back by the server for
- mutual authentication, if given. An allocated berval struc-
- ture is returned that should be disposed of by calling
- ldap_ber_free(). NULL may be passed to ignore this field.
-
-resultoidp For extended results, this result parameter will be filled
- in with the dotted-OID text representation of the name of
- the extended operation response. This string should be
-
-
-
-Expires: January 1998 [Page 32]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- disposed of by calling ldap_memfree(). NULL may be passed
- to ignore this field.
-
-resultdatap For extended results, this result parameter will be filled
- in with a pointer to a struct berval containing the data in
- the extended operation response. It should be disposed of
- by calling ldap_ber_free(). NULL may be passed to ignore
- this field.
-
-err For ldap_err2string(), an LDAP error code, as returned by
- ldap_result2error() or another LDAP API call.
-
-Additional parameters for the deprecated routines are not described.
-Interested readers are referred to RFC 1823.
-
-All of the ldap_parse_*_result() routines skip over messages of type
-LDAP_RES_SEARCH_ENTRY and LDAP_RES_SEARCH_REFERENCE when looking for a
-result message to parse. They return the constant LDAP_SUCCESS if the
-result was successfully parsed and another LDAP error code if not. Note
-that the LDAP error code that indicates the outcome of the operation
-performed by the server is placed in the errcodep ldap_parse_result()
-parameter.
-
-ldap_err2string() is used to convert a numeric LDAP error code, as
-returned by one of the ldap_parse_*_result() routines, or one of the
-synchronous API operation calls, into an informative NULL-terminated
-character string message describing the error. It returns a pointer to
-static data.
-
-
-11. Stepping Through a List of Results
-
-The ldap_first_message() and ldap_next_message() routines are used to
-step through the list of messages in a result chain returned by
-ldap_result(). For search operations, the result chain may actually
-include referral messages, entry messages, and result messages.
-ldap_count_messages() is used to count the number of messages returned.
-The ldap_msgtype() function, described above, can be used to distinguish
-between the different message types.
-
- LDAPMessage *ldap_first_message( LDAP *ld, LDAPMessage *res );
-
- LDAPMessage *ldap_next_message( LDAP *ld, LDAPMessage *msg );
-
- int ldap_count_messages( LDAP *ld, LDAPMessage *res );
-
-Parameters are:
-
-
-
-
-Expires: January 1998 [Page 33]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-ld The session handle.
-
-res The result chain, as obtained by a call to one of the synchronous
- search routines or ldap_result().
-
-msg The message returned by a previous call to ldap_first_message()
- or ldap_next_message().
-
-ldap_first_message() and ldap_next_message() will return NULL when no
-more messages exist in the result set to be returned. NULL is also
-returned if an error occurs while stepping through the entries, in which
-case the error parameters in the session handle ld will be set to indi-
-cate the error.
-
-ldap_count_messages() returns the number of messages contained in a
-chain of results. It can also be used to count the number of messages
-that remain in a chain if called with a message, entry, or reference
-returned by ldap_first_message(), ldap_next_message(),
-ldap_first_entry(), ldap_next_entry(), ldap_first_reference(),
-ldap_next_reference().
-
-
-12. Parsing Search Results
-
-The following calls are used to parse the entries and references
-returned by ldap_search() and friends. These results are returned in an
-opaque structure that should only be accessed by calling the routines
-described below. Routines are provided to step through the entries and
-references returned, step through the attributes of an entry, retrieve
-the name of an entry, and retrieve the values associated with a given
-attribute in an entry.
-
-
-12.1. Stepping Through a List of Entries
-
-The ldap_first_entry() and ldap_next_entry() routines are used to step
-through and retrieve the list of entries from a search result chain.
-The ldap_first_reference() and ldap_next_reference() routines are used
-to step through and retrieve the list of continuation references from a
-search result chain. ldap_count_entries() is used to count the number
-of entries returned. ldap_count_references() is used to count the number
-of references returned.
-
- LDAPMessage *ldap_first_entry( LDAP *ld, LDAPMessage *res );
-
- LDAPMessage *ldap_next_entry( LDAP *ld, LDAPMessage *entry );
-
- LDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *res );
-
-
-
-Expires: January 1998 [Page 34]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- LDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *ref );
-
- int ldap_count_entries( LDAP *ld, LDAPMessage *res );
-
- int ldap_count_references( LDAP *ld, LDAPMessage *res );
-
-Parameters are:
-
-ld The session handle.
-
-res The search result, as obtained by a call to one of the synchro-
- nous search routines or ldap_result().
-
-entry The entry returned by a previous call to ldap_first_entry() or
- ldap_next_entry().
-
-ldap_first_entry() and ldap_next_entry() will return NULL when no more
-entries or references exist in the result set to be returned. NULL is
-also returned if an error occurs while stepping through the entries, in
-which case the error parameters in the session handle ld will be set to
-indicate the error.
-
-ldap_count_entries() returns the number of entries contained in a chain
-of entries. It can also be used to count the number of entries that
-remain in a chain if called with a message, entry or reference returned
-by ldap_first_message(), ldap_next_message(), ldap_first_entry(),
-ldap_next_entry(), ldap_first_reference(), ldap_next_reference().
-
-ldap_count_references() returns the number of references contained in a
-chain of search results. It can also be used to count the number of
-references that remain in a chain.
-
-
-12.2. Stepping Through the Attributes of an Entry
-
-The ldap_first_attribute() and ldap_next_attribute() calls are used to
-step through the list of attribute types returned with an entry.
-
- char *ldap_first_attribute(
- LDAP *ld,
- LDAPMessage *entry,
- BerElement **ptr
- );
-
- char *ldap_next_attribute(
- LDAP *ld,
- LDAPMessage *entry,
- BerElement *ptr
-
-
-
-Expires: January 1998 [Page 35]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- );
-
- void ldap_memfree( char *mem );
-
-Parameters are:
-
-ld The session handle.
-
-entry The entry whose attributes are to be stepped through, as returned
- by ldap_first_entry() or ldap_next_entry().
-
-ptr In ldap_first_attribute(), the address of a pointer used inter-
- nally to keep track of the current position in the entry. In
- ldap_next_attribute(), the pointer returned by a previous call to
- ldap_first_attribute().
-
-mem A pointer to memory allocated by the LDAP library, such as the
- attribute names returned by ldap_first_attribute() and
- ldap_next_attribute, or the DN returned by ldap_get_dn().
-
-ldap_first_attribute() and ldap_next_attribute() will return NULL when
-the end of the attributes is reached, or if there is an error, in which
-case the error parameters in the session handle ld will be set to indi-
-cate the error.
-
-Both routines return a pointer to an allocated buffer containing the
-current attribute name. This should be freed when no longer in use by
-calling ldap_memfree().
-
-ldap_first_attribute() will allocate and return in ptr a pointer to a
-BerElement used to keep track of the current position. This pointer
-should be passed in subsequent calls to ldap_next_attribute() to step
-through the entry's attributes. After a set of calls to
-ldap_first_attribute() and ldap_next_attibute(), if ptr is non-NULL, it
-should be freed by calling ldap_ber_free( ptr, 0 ). Note that it is very
-important to pass the second parameter as 0 (zero) in this call.
-
-The attribute names returned are suitable for passing in a call to
-ldap_get_values() and friends to retrieve the associated values.
-
-
-12.3. Retrieving the Values of an Attribute
-
-ldap_get_values() and ldap_get_values_len() are used to retrieve the
-values of a given attribute from an entry. ldap_count_values() and
-ldap_count_values_len() are used to count the returned values.
-ldap_value_free() and ldap_value_free_len() are used to free the values.
-
-
-
-
-Expires: January 1998 [Page 36]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- char **ldap_get_values(
- LDAP *ld,
- LDAPMessage *entry,
- char *attr
- );
-
- struct berval **ldap_get_values_len(
- LDAP *ld,
- LDAPMessage *entry,
- char *attr
- );
-
- int ldap_count_values( char **vals );
-
- int ldap_count_values_len( struct berval **vals );
-
- int ldap_value_free( char **vals );
-
- int ldap_value_free_len( struct berval **vals );
-
-Parameters are:
-
-ld The session handle.
-
-entry The entry from which to retrieve values, as returned by
- ldap_first_entry() or ldap_next_entry().
-
-attr The attribute whose values are to be retrieved, as returned by
- ldap_first_attribute() or ldap_next_attribute(), or a caller-
- supplied string (e.g., "mail").
-
-vals The values returned by a previous call to ldap_get_values() or
- ldap_get_values_len().
-
-Two forms of the various calls are provided. The first form is only
-suitable for use with non-binary character string data. The second _len
-form is used with any kind of data.
-
-Note that the values returned are dynamically allocated and should be
-freed by calling either ldap_value_free() or ldap_value_free_len() when
-no longer in use.
-
-
-12.4. Retrieving the name of an entry
-
-ldap_get_dn() is used to retrieve the name of an entry.
-ldap_explode_dn() and ldap_explode_rdn() are used to break up a name
-into its component parts. ldap_dn2ufn() is used to convert the name into
-
-
-
-Expires: January 1998 [Page 37]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-a more "user friendly" format.
-
- char *ldap_get_dn( LDAP *ld, LDAPMessage *entry );
-
- char **ldap_explode_dn( char *dn, int notypes );
-
- char **ldap_explode_rdn( char *rdn, int notypes );
-
- char *ldap_dn2ufn( char *dn );
-
-Parameters are:
-
-ld The session handle.
-
-entry The entry whose name is to be retrieved, as returned by
- ldap_first_entry() or ldap_next_entry().
-
-dn The dn to explode, such as returned by ldap_get_dn().
-
-rdn The rdn to explode, such as returned in the components of the
- array returned by ldap_explode_dn().
-
-notypes A boolean parameter, if non-zero indicating that the dn or rdn
- components should have their type information stripped off
- (i.e., "cn=Babs" would become "Babs").
-
-ldap_get_dn() will return NULL if there is some error parsing the dn,
-setting error parameters in the session handle ld to indicate the error.
-It returns a pointer to malloc'ed space that the caller should free by
-calling ldap_memfree() when it is no longer in use. Note the format of
-the DNs returned is given by [4].
-
-ldap_explode_dn() returns a NULL-terminated char * array containing the
-RDN components of the DN supplied, with or without types as indicated by
-the notypes parameter. The array returned should be freed when it is no
-longer in use by calling ldap_value_free().
-
-ldap_explode_rdn() returns a NULL-terminated char * array containing the
-components of the RDN supplied, with or without types as indicated by
-the notypes parameter. The array returned should be freed when it is no
-longer in use by calling ldap_value_free().
-
-ldap_dn2ufn() converts the DN into the user friendly format described in
-[5]. The UFN returned is malloc'ed space that should be freed by a call
-to ldap_memfree() when no longer in use.
-
-
-
-
-
-
-Expires: January 1998 [Page 38]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-13. Encoded ASN.1 Value Manipulation
-
-This section describes routines which may be used to encode and decode
-BER-encoded ASN.1 values, which are often used inside of control and
-extension values.
-
-With the exceptions of two new functions ber_flatten() and ber_init(),
-these functions are compatible with the University of Michigan LDAP 3.3
-implementation of BER.
-
-
-13.1. General
-
- struct berval {
- unsigned long bv_len;
- char *bv_val;
- };
-
-A struct berval contains a sequence of bytes and an indication of its
-length. The bv_val is not null terminated. bv_len must always be a
-nonnegative number. Applications may allocate their own berval struc-
-tures.
-
- typedef struct berelement {
- /* opaque */
- } BerElement;
-
-The BerElement structure contains not only a copy of the encoded value,
-but also state information used in encoding or decoding. Applications
-cannot allocate their own BerElement structures. The internal state is
-neither thread-specific nor locked, so two threads should not manipulate
-the same BerElement value simultaneously.
-
-A single BerElement value cannot be used for both encoding and decoding.
-
- void ber_bvfree ( struct berval *bv);
-
-ber_bvfree() frees a berval returned from this API. Both the bv->bv_val
-string and the berval itself are freed. Applications should not use
-ber_bvfree() with bervals which the application has allocated.
-
- void ber_bvecfree ( struct berval **bv );
-
-ber_bvecfree() frees an array of bervals returned from this API. Each
-of the bervals in the array are freed using ber_bvfree(), then the array
-itself is freed.
-
- struct berval *ber_bvdup (struct berval *bv );
-
-
-
-Expires: January 1998 [Page 39]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-ber_bvdup() returns a copy of a berval. The bv_val field in the
-returned berval points to a different area of memory as the bv_val field
-in the argument berval. The null pointer is returned on error (e.g. out
-of memory).
-
- void ber_free ( BerElement *ber, int fbuf );
-
-ber_free() frees a BerElement which is returned from the API calls
-ber_alloc_t() or ber_init(). Each BerElement must be freed by the
-caller. The second argument fbuf should always be set to 1.
-
-
-13.2. Encoding
-
- BerElement *ber_alloc_t(int options);
-
-ber_alloc_t() constructs and returns BerElement. The null pointer is
-returned on error. The options field contains a bitwise-or of options
-which are to be used when generating the encoding of this BerElement.
-One option is defined and must always be supplied:
-
- #define LBER_USE_DER 0x01
-
-When this option is present, lengths will always be encoded in the
-minimum number of octets. Note that this option does not cause values
-of sets and sequences to be rearranged in tag and byte order, so these
-functions are not suitable for generating DER output as defined in X.509
-and X.680.
-
-Unrecognized option bits are ignored.
-
-The BerElement returned by ber_alloc_t() is initially empty. Calls to
-ber_printf() will append bytes to the end of the ber_alloc_t().
-
- int ber_printf(BerElement *ber, char *fmt, ... )
-
-The ber_printf() routine is used to encode a BER element in much the
-same way that sprintf() works. One important difference, though, is
-that state information is kept in the ber argument so that multiple
-calls can be made to ber_printf() to append to the end of the BER ele-
-ment. ber must be a pointer to a BerElement returned by ber_alloc_t().
-ber_printf() interprets and formats its arguments according to the for-
-mat string fmt. ber_printf() returns -1 if there is an error during
-encoding. As with sprintf(), each character in fmt refers to an argu-
-ment to ber_printf().
-
-The format string can contain the following format characters:
-
-
-
-
-Expires: January 1998 [Page 40]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-'t' Tag. The next argument is an int specifying the tag to override
- the next element to be written to the ber. This works across
- calls. The int value must contain the tag class, constructed
- bit, and tag value. The tag value must fit in a single octet
- (tag value is less than 32). For example, a tag of "[3]" for a
- constructed type is 0xA3.
-
-'b' Boolean. The next argument is an int, containing either 0 for
- FALSE or 0xff for TRUE. A boolean element is output. If this
- format character is not preceded by the 't' format modifier, the
- tag 0x01 is used for the element.
-
-'i' Integer. The next argument is an int, containing the integer in
- the host's byte order. An integer element is output. If this
- format character is not preceded by the 't' format modifier, the
- tag 0x02 is used for the element.
-
-'X' Bitstring. The next two arguments are a char * pointer to the
- start of the bitstring, followed by an int containing the number
- of bits in the bitstring. A bitstring element is output, in
- primitive form. If this format character is not preceded by the
- 't' format modifier, the tag 0x03 is used for the element.
-
-'n' Null. No argument is required. An ASN.1 NULL element is out-
- put. If this format character is not preceded by the 't' format
- modifier, the tag 0x05 is used for the element.
-
-'o' Octet string. The next two arguments are a char *, followed by
- an int with the length of the string. The string may contain
- null bytes and need not by null-terminated. An octet string
- element is output, in primitive form. If this format character
- is not preceded by the 't' format modifier, the tag 0x04 is used
- for the element.
-
-'s' Octet string. The next argument is a char * pointing to a
- null-terminated string. An octet string element in primitive
- form is output, which does not include the trailing ' ' byte. If
- this format character is not preceded by the 't' format modif-
- ier, the tag 0x04 is used for the element.
-
-'v' Several octet strings. The next argument is a char **, an array
- of char * pointers to null-terminated strings. The last element
- in the array must be a null pointer. The octet strings do not
- include the trailing SEQUENCE OF octet strings. The 't' format
- modifier cannot be used with this format character.
-
-'V' Several octet strings. A null-terminated array of berval *'s is
- supplied. Note that a construct like '{V}' is required to get an
-
-
-
-Expires: January 1998 [Page 41]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- actual SEQUENCE OF octet strings. The 't' format modifier cannot
- be used with this format character.
-
-'{' Begin sequence. No argument is required. If this format char-
- acter is not preceded by the 't' format modifier, the tag 0x30
- is used.
-
-'}' End sequence. No argument is required. The 't' format modifier
- cannot be used with this format character.
-
-'[' Begin set. No argument is required. If this format character
- is not preceded by the 't' format modifier, the tag 0x31 is
- used.
-
-']' End set. No argument is required. The 't' format modifier can-
- not be used with this format character.
-
-Each use of a '{' format character must be matched by a '}' character,
-either later in the format string, or in the format string of a subse-
-quent call to ber_printf() for that BerElement. The same applies to the
-'[' and
-
-Sequences and sets nest, and implementations of this API must maintain
-internal state to be able to properly calculate the lengths.
-
- int ber_flatten (BerElement *ber, struct berval **bvPtr);
-
-The ber_flatten routine allocates a struct berval whose contents are a
-BER encoding taken from the ber argument. The bvPtr pointer points to
-the returned berval, which must be freed using ber_bvfree(). This rou-
-tine returns 0 on success and -1 on error.
-
-The ber_flatten API call is not present in U-M LDAP 3.3.
-
-The use of ber_flatten on a BerElement in which all '{' and '}' format
-modifiers have not been properly matched can result in a berval whose
-contents are not a valid BER encoding.
-
-
-13.3. Encoding Example
-
-The following is an example of encoding the following ASN.1 data type:
-
- Example1Request ::= SEQUENCE {
- s OCTET STRING, -- must be printable
- val1 INTEGER,
- val2 [0] INTEGER DEFAULT 0
- }
-
-
-
-Expires: January 1998 [Page 42]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- int encode_example1(char *s,int val1,int val2,struct berval **bvPtr)
- {
- BerElement *ber;
- int rc;
-
- ber = ber_alloc_t(LBER_USE_DER);
-
- if (ber == NULL) return -1;
-
- if (ber_printf(ber,"{si",s,val1) == -1) {
- ber_free(ber,1);
- return -1;
- }
-
- if (val2 != 0) {
- if (ber_printf(ber,"ti",0x80,val2) == -1) {
- ber_free(ber,1);
- return -1;
- }
- }
-
- if (ber_printf(ber,"}") == -1) {
- ber_free(ber,1);
- return -1;
- }
-
- rc = ber_flatten(ber,bvPtr);
- ber_free(ber,1);
- return -1;
- }
-
-
-13.4. Decoding
-
-The following two symbols are available to applications.
-
- #define LBER_ERROR 0xffffffffL
- #define LBER_DEFAULT 0xffffffffL
-
- BerElement *ber_init (struct berval *bv);
-
-The ber_init functions construct BerElement and returns a new BerElement
-containing a copy of the data in the bv argument. ber_init returns the
-null pointer on error.
-
- unsigned long ber_scanf (BerElement *ber, char *fmt, ... );
-
-The ber_scanf() routine is used to decode a BER element in much the same
-
-
-
-Expires: January 1998 [Page 43]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-way that sscanf() works. One important difference, though, is that some
-state information is kept with the ber argument so that multiple calls
-can be made to ber_scanf() to sequentially read from the BER element.
-The ber argument must be a pointer to a BerElement returned by
-ber_init(). ber_scanf interprets the bytes according to the format
-string fmt, and stores the results in its additional arguments.
-ber_scanf() returns LBER_ERROR on error, and a nonnegative number on
-success.
-
-The format string contains conversion specifications which are used to
-direct the interpretation of the BER element. The format string can
-contain the following characters:
-
-'a' Octet string. A char ** argument should be supplied. Memory is
- allocated, filled with the contents of the octet string, null-
- terminated, and the pointer to the string is stored in the argu-
- ment. The returned value must be freed using ldap_memfree. The
- tag of the element must indicate the primitive form (constructed
- strings are not supported) but is otherwise ignored and dis-
- carded during the decoding. This format cannot be used with
- octet strings which could contain null bytes.
-
-'O' Octet string. A struct berval ** argument should be supplied,
- which upon return points to a allocated struct berval containing
- the octet string and its length. ber_bvfree() must be called to
- free the allocated memory. The tag of the element must indicate
- the primitive form (constructed strings are not supported) but
- is otherwise ignored during the decoding.
-
-'b' Boolean. A pointer to an int should be supplied. The int value
- stored will be 0 for FALSE or nonzero for TRUE. The tag of the
- element must indicate the primitive form but is otherwise
- ignored during the decoding.
-
-'i' Integer. A pointer to an int should be supplied. The int value
- stored will be in host byte order. The tag of the element must
- indicate the primitive form but is otherwise ignored during the
- decoding. ber_scanf() will return an error if the integer can-
- not be stored in an int.
-
-'B' Bitstring. A char ** argument should be supplied which will
- point to the allocated bits, followed by an unsigned long *
- argument, which will point to the length (in bits) of the bit-
- string returned. ldap_memfree must be called to free the bit-
- string. The tag of the element must indicate the primitive form
- (constructed bitstrings are not supported) but is otherwise
- ignored during the decoding.
-
-
-
-
-Expires: January 1998 [Page 44]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-'n' Null. No argument is required. The element is simply skipped
- if it is recognized as a zero-length element. The tag is
- ignored.
-
-'v' Several octet strings. A char *** argument should be supplied,
- which upon return points to a allocated null-terminated array of
- char *'s containing the octet strings. NULL is stored if the
- sequence is empty. ldap_memfree must be called to free each
- element of the array and the array itself. The tag of the
- sequence and of the octet strings are ignored.
-
-'V' Several octet strings (which could contain null bytes). A
- struct berval *** should be supplied, which upon return points
- to a allocated null-terminated array of struct berval *'s con-
- taining the octet strings and their lengths. NULL is stored if
- the sequence is empty. ber_bvecfree() can be called to free the
- allocated memory. The tag of the sequence and of the octet
- strings are ignored.
-
-'x' Skip element. The next element is skipped. No argument is
- required.
-
-'{' Begin sequence. No argument is required. The initial sequence
- tag and length are skipped.
-
-'}' End sequence. No argument is required.
-
-'[' Begin set. No argument is required. The initial set tag and
- length are skipped.
-
-']' End set. No argument is required.
-
- unsigned long ber_peek_tag (BerElement *ber, unsigned long *lenPtr);
-
-ber_peek_tag() returns the tag of the next element to be parsed in the
-BerElement argument. The length of this element is stored in the
-*lenPtr argument. LBER_DEFAULT is returned if there is no further data
-to be read. The ber argument is not modified.
-
- unsigned long ber_skip_tag (BerElement *ber, unsigned long *lenPtr);
-
-ber_skip_tag() is similar to ber_peek_tag(), except that the state
-pointer in the BerElement argument is advanced past the first tag and
-length, and is pointed to the value part of the next element. This rou-
-tine should only be used with constructed types and situations when a
-BER encoding is used as the value of an OCTET STRING. The length of the
-value is stored in *lenPtr.
-
-
-
-
-Expires: January 1998 [Page 45]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- unsigned long ber_first_element(BerElement *ber,
- unsigned long *lenPtr, char **opaquePtr);
-
- unsigned long ber_next_element (BerElement *ber,
- unsigned long *lenPtr, char *opaque);
-
-ber_first_element() and ber_next_element() are used to traverse a SET,
-SET OF, SEQUENCE or SEQUENCE OF data value. ber_first_element() calls
-ber_skip_tag(), stores internal information in *lenPtr and *opaquePtr,
-and calls ber_peek_tag() for the first element inside the constructed
-value. LBER_DEFAULT is returned if the constructed value is empty.
-ber_next_element() positions the state at the start of the next element
-in the constructed type. LBER_DEFAULT is returned if there are no
-further values.
-
-The len and opaque values should not be used by applications other than
-as arguments to ber_next_element(), as shown in the example below.
-
-
-13.5. Decoding Example
-
-The following is an example of decoding an ASN.1 data type:
-
- Example2Request ::= SEQUENCE {
- dn OCTET STRING, -- must be printable
- scope ENUMERATED { b (0), s (1), w (2) },
- ali ENUMERATED { n (0), s (1), f (2), a (3) },
- size INTEGER,
- time INTEGER,
- tonly BOOLEAN,
- attrs SEQUENCE OF OCTET STRING, -- must be printable
- [0] SEQUENCE OF SEQUENCE {
- type OCTET STRING -- must be printable,
- crit BOOLEAN DEFAULT FALSE,
- value OCTET STRING
- } OPTIONAL }
-
- #define LDAP_TAG_CONTROL_LIST 0xA0L /* context specific cons 0 */
-
- int decode_example2(struct berval *bv)
- {
- BerElement *ber;
- unsigned long len;
- int scope, ali, size, time, tonly;
- char *dn = NULL, **attrs = NULL;
- int res,i,rc = 0;
-
- ber = ber_init(bv);
-
-
-
-Expires: January 1998 [Page 46]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- if (ber == NULL) {
- printf("ERROR ber_init failed0);
- return -1;
- }
-
- res = ber_scanf(ber,"{aiiiiib{v}",&dn,&scope,&ali,
- &size,&time,&tonly,&attrs);
-
- if (res == -1) {
- printf("ERROR ber_scanf failed0);
- ber_free(ber,1);
- return -1;
- }
-
- /* *** use dn */
- ldap_memfree(dn);
-
- for (i = 0; attrs != NULL && attrs[i] != NULL; i++) {
- /* *** use attrs[i] */
- ldap_memfree(attrs[i]);
- }
- ldap_memfree(attrs);
-
- if (ber_peek_tag(ber,&len) == LDAP_TAG_CONTROL_LIST) {
- char *opaque;
- unsigned long tag;
-
- for (tag = ber_first_element(ber,&len,&opaque);
- tag != LBER_DEFAULT;
- tag = ber_next_element (ber,&len,opaque)) {
-
- unsigned long ttag, tlen;
- char *type;
- int crit;
- struct berval *value;
-
- if (ber_scanf(ber,"{a",&type) == LBER_ERROR) {
- printf("ERROR cannot parse type0);
- break;
- }
- /* *** use type */
- ldap_memfree(type);
-
- ttag = ber_peek_tag(ber,&tlen);
- if (ttag == 0x01) { /* boolean */
- if (ber_scanf(ber,"b",
- &crit) == LBER_ERROR) {
- printf("ERROR cannot parse crit0);
-
-
-
-Expires: January 1998 [Page 47]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- rc = -1;
- break;
- }
- } else if (ttag == 0x04) { /* octet string */
- crit = 0;
- } else {
- printf("ERROR extra field in controls0);
- break;
- }
-
- if (ber_scanf(ber,"O}",&value) == LBER_ERROR) {
- printf("ERROR cannot parse value0);
- rc = -1;
- break;
- }
- /* *** use value */
- ldap_bvfree(value);
- }
- }
-
- ber_scanf(ber,"}");
-
- ber_free(ber,1);
-
- return rc;
- }
-
-
-
-14. Security Considerations
-
-LDAPv2 supports security through protocol-level authentication using
-clear-text passwords. LDAPv3 adds support for SASL [8] (Simple Authen-
-tication Security Layer) methods. LDAPv3 also supports operation over a
-secure transport layer using Transport Layer Security TLS [8]. Readers
-are referred to the protocol documents for discussion of related secu-
-rity considerations.
-
-Implementations of this API should be cautious when handling authentica-
-tion credentials. In particular, keeping long-lived copies of creden-
-tials without the application's knowledge is discouraged.
-
-
-15. Acknowledgements
-
-Many members of the IETF ASID working group as well as members of the
-Internet at large have provided useful comments and suggestions that
-have been incorporated into this revision.
-
-
-
-Expires: January 1998 [Page 48]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-This original material upon which this revision is based was based upon
-work supported by the National Science Foundation under Grant No. NCR-
-9416667.
-
-
-16. Bibliography
-
-[1] The Directory: Selected Attribute Syntaxes. CCITT, Recommendation
- X.520.
-
-[2] M. Wahl, A. Coulbeck, T. Howes, S. Kille, W. Yeong, C. Robbins,
- "Lightweight Directory Access Protocol Attribute Syntax Defini-
- tions", INTERNET-DRAFT ,
- 11 July 1997.
-
-[3] T. Howes, "A String Representation of LDAP Search Filters,"
- INTERNET-DRAFT , May 1997.
-
-[4] S. Kille, M. Wahl, "A UTF-8 String Representation of Distinguished
- Names", INTERNET-DRAFT , 29 April
- 1997.
-
-[5] S. Kille, "Using the OSI Directory to Achieve User Friendly Nam-
- ing," RFC 1781, March 1995.
-
-[6] M. Wahl, T. Howes, S. Kille, "Lightweight Directory Access Protocol
- (v3)", INTERNET-DRAFT , 11
- July 1997.
-
-[7] A. Herron, T. Howes, M. Wahl, "LDAP Control Extension for Server
- Side Sorting of Search Result," INTERNET-DRAFT , 16 April 1997.
-
-[8] J. Meyers, "Simple Authentication and Security Layer", INTERNET-
- DRAFT , April 1997.
-
-[9] "Lightweight Directory Access Protocol (v3) Extension for Transport
- Layer Security", INTERNET-DRAFT , June 1997.
-
-[10] "UTF-8, a transformation format of Unicode and ISO 10646", RFC
- 2044, October 1996.
-
-[11] "IP Version 6 Addressing Architecture,", RFC 1884, December 1995.
-
-
-
-
-
-
-
-Expires: January 1998 [Page 49]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-17. Author's Addresses
-
- Tim Howes
- Netscape Communications Corp.
- 501 E. Middlefield Rd., Mailstop MV068
- Mountain View, CA 94043
- USA
- +1 415 937-3419
- howes@netscape.com
-
-
- Mark Smith
- Netscape Communications Corp.
- 501 E. Middlefield Rd., Mailstop MV068
- Mountain View, CA 94043
- USA
- +1 415 937-3477
- mcs@netscape.com
-
- Andy Herron
- Microsoft Corp.
- 1 Microsoft Way
- Redmond, WA 98052
- USA
- +1 425 882-8080
- andyhe@microsoft.com
-
- Chris Weider
- Microsoft Corp.
- 1 Microsoft Way
- Redmond, WA 98052
- USA
- +1 425 882-8080
- cweider@microsoft.com
-
- Mark Wahl
- Critical Angle Inc.
- 4815 W Braker Lane #502-385
- Austin, TX 78759
- USA
- M.Wahl@critical-angle.com
-
-
-18. Appendix A - Sample LDAP API Code
-
- #include
-
- main()
-
-
-
-Expires: January 1998 [Page 50]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- {
- LDAP *ld;
- LDAPMessage *res, *e;
- int i;
- char *a, *dn;
- BerElement *ptr;
- char **vals;
-
- /* open an LDAP session */
- if ( (ld = ldap_init( "dotted.host.name", LDAP_PORT )) == NULL )
- exit( 1 );
-
- /* authenticate as nobody */
- if ( ldap_simple_bind_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
- ldap_perror( ld, "ldap_simple_bind_s" );
- exit( 1 );
- }
-
- /* search for entries with cn of "Babs Jensen", return all attrs */
- if ( ldap_search_s( ld, "o=University of Michigan, c=US",
- LDAP_SCOPE_SUBTREE, "(cn=Babs Jensen)", NULL, 0, &res )
- != LDAP_SUCCESS ) {
- ldap_perror( ld, "ldap_search_s" );
- exit( 1 );
- }
-
- /* step through each entry returned */
- for ( e = ldap_first_entry( ld, res ); e != NULL;
- e = ldap_next_entry( ld, e ) ) {
- /* print its name */
- dn = ldap_get_dn( ld, e );
- printf( "dn: %s\n", dn );
- ldap_memfree( dn );
-
- /* print each attribute */
- for ( a = ldap_first_attribute( ld, e, &ptr ); a != NULL;
- a = ldap_next_attribute( ld, e, ptr ) ) {
- printf( "attribute: %s\n", a );
-
- /* print each value */
- vals = ldap_get_values( ld, e, a );
- for ( i = 0; vals[i] != NULL; i++ ) {
- printf( "value: %s\n", vals[i] );
- }
- ldap_value_free( vals );
- }
- if ( ptr != NULL ) {
- ldap_ber_free( ptr, 0 );
-
-
-
-Expires: January 1998 [Page 51]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
- }
- }
- /* free the search results */
- ldap_msgfree( res );
-
- /* close and free connection resources */
- ldap_unbind( ld );
- }
-
-
-
-19. Appendix B - Outstanding Issues
-
-
-19.1. Support for multithreaded applications
-
-In order to support multithreaded applications in a platform-independent
-way, some additions to the LDAP API are needed. Different implementors
-have taken different paths to solve this problem in the past. A common
-set of thread-related API calls must be defined so that application
-developers are not unduly burdened. These will be added to a future
-revision of this specification.
-
-
-19.2. Using Transport Layer Security (TLS)
-
-The API calls used to support TLS must be specified. They will be added
-to a future revision of this specification.
-
-
-19.3. Client control for chasing referrals
-
-A client control has been defined that can be used to specify on a per-
-operation basis whether references and external referrals are automati-
-cally chased by the client library. This will be added to a future
-revision of this specification.
-
-
-19.4. Potential confusion between hostname:port and IPv6 addresses
-
-String representations of IPv6 network addresses [11] can contain colon
-characters. The ldap_init() call is specified to take strings of the
-form "hostname:port" or "ipaddress:port". If IPv6 addresses are used,
-the latter could be ambiguous. A future revision of this specification
-will resolve this issue.
-
-
-
-
-
-
-Expires: January 1998 [Page 52]
-
-C LDAP API The C LDAP Application Program Interface 29 July 1997
-
-
-19.5. Need to track SASL API standardization efforts
-
-If a standard Simple Authentication and Security Layer API is defined,
-it may be necessary to modify the LDAP API to accommodate it.
-
-
-19.6. Support for character sets other than UTF-8?
-
-Some application developers would prefer to pass string data using a
-character set other than UTF-8. This could be accommodated by adding a
-new option to ldap_set_option() that supports choosing a character set.
-If this feature is added, the number of different character sets sup-
-ported should definitely be minimized.
-
-
-19.7. Use of UTF-8 with LDAPv2 servers
-
-Strings are always passed as UTF-8 in this API but LDAP version 2
-servers do not support the full range of UTF-8 characters. The expected
-behavior of this API when using LDAP version 2 with unsupported charac-
-ters should be specified.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Expires: January 1998 [Page 53]
-
-
-
-1. Status of this Memo............................................1
-2. Introduction...................................................1
-3. Overview of the LDAP Model.....................................2
-4. Overview of LDAP API Use.......................................3
-5. Common Data Structures.........................................4
-6. LDAP Error Codes...............................................5
-7. Performing LDAP Operations.....................................6
-7.1. Initializing an LDAP Session................................6
-7.2. LDAP Session Handle Options.................................7
-7.3. Working with controls.......................................10
-7.4. Authenticating to the directory.............................11
-7.5. Closing the session.........................................13
-7.6. Searching...................................................13
-7.7. Reading an Entry............................................17
-7.8. Listing the Children of an Entry............................17
-7.9. Comparing a Value Against an Entry..........................17
-7.10. Modifying an entry..........................................19
-7.11. Modifying the Name of an Entry..............................21
-7.12. Adding an entry.............................................23
-7.13. Deleting an entry...........................................25
-7.14. Extended Operations.........................................26
-8. Abandoning An Operation........................................28
-9. Obtaining Results and Peeking Inside LDAP Messages.............29
-10. Handling Errors and Parsing Results............................31
-11. Stepping Through a List of Results.............................33
-12. Parsing Search Results.........................................34
-12.1. Stepping Through a List of Entries..........................34
-12.2. Stepping Through the Attributes of an Entry.................35
-12.3. Retrieving the Values of an Attribute.......................36
-12.4. Retrieving the name of an entry.............................37
-13. Encoded ASN.1 Value Manipulation...............................39
-13.1. General.....................................................39
-13.2. Encoding....................................................40
-13.3. Encoding Example............................................42
-13.4. Decoding....................................................43
-13.5. Decoding Example............................................46
-14. Security Considerations........................................48
-15. Acknowledgements...............................................48
-16. Bibliography...................................................49
-17. Author's Addresses.............................................50
-18. Appendix A - Sample LDAP API Code..............................50
-19. Appendix B - Outstanding Issues................................52
-19.1. Support for multithreaded applications......................52
-19.2. Using Transport Layer Security (TLS)........................52
-19.3. Client control for chasing referrals........................52
-19.4. Potential confusion between hostname:port and IPv6 addresses52
-19.5. Need to track SASL API standardization efforts..............53
-19.6. Support for character sets other than UTF-8?................53
-19.7. Use of UTF-8 with LDAPv2 servers............................53
-
-
-
-
-
-
-
-
diff -Nru rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/package.mk rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/package.mk
--- rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/package.mk 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/package.mk 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
UPSTREAM_GIT:=https://github.com/etnt/eldap.git
UPSTREAM_REVISION:=e309de4db4b78d67d623
-WRAPPER_PATCHES:=eldap-appify.patch remove-eldap-fsm.patch eldap-no-ssl-seed.patch
+WRAPPER_PATCHES:=eldap-appify.patch remove-eldap-fsm.patch eldap-no-ssl-seed.patch remove-ietf-doc.patch
ORIGINAL_APP_FILE:=$(CLONE_DIR)/ebin/$(APP_NAME).app
DO_NOT_GENERATE_APP_FILE=true
diff -Nru rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/remove-ietf-doc.patch rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/remove-ietf-doc.patch
--- rabbitmq-server-2.7.1/plugins-src/eldap-wrapper/remove-ietf-doc.patch 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/eldap-wrapper/remove-ietf-doc.patch 2012-06-22 16:03:48.000000000 +0000
@@ -0,0 +1,3036 @@
+diff --git a/doc/draft-ietf-asid-ldap-c-api-00.txt b/doc/draft-ietf-asid-ldap-c-api-00.txt
+deleted file mode 100755
+index 5f2e856..0000000
+--- a/doc/draft-ietf-asid-ldap-c-api-00.txt
++++ /dev/null
+@@ -1,3030 +0,0 @@
+-
+-
+-
+-
+-
+-
+-Network Working Group T. Howes
+-INTERNET-DRAFT Netscape Communications Corp.
+-Intended Category: Standards Track M. Smith
+-Obsoletes: RFC 1823 Netscape Communications Corp.
+-Expires: January 1998 A. Herron
+- Microsoft Corp.
+- C. Weider
+- Microsoft Corp.
+- M. Wahl
+- Critical Angle, Inc.
+-
+- 29 July 1997
+-
+-
+- The C LDAP Application Program Interface
+-
+-
+-
+-
+-1. Status of this Memo
+-
+-This draft document will be submitted to the RFC Editor as a Standards
+-Track document. Distribution of this memo is unlimited. Please send com-
+-ments to the authors.
+-
+-This document is an Internet-Draft. Internet-Drafts are working docu-
+-ments of the Internet Engineering Task Force (IETF), its areas, and its
+-working groups. Note that other groups may also distribute working
+-documents as Internet-Drafts.
+-
+-Internet-Drafts are draft documents valid for a maximum of six months
+-and may be updated, replaced, or obsoleted by other documents at any
+-time. It is inappropriate to use Internet-Drafts as reference material
+-or to cite them other than as ``work in progress.''
+-
+-To learn the current status of any Internet-Draft, please check the
+-``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
+-Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
+-ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
+-
+-2. Introduction
+-
+-This document defines a C language application program interface to the
+-lightweight directory access protocol (LDAP). This document replaces the
+-previous definition of this API, defined in RFC 1823, updating it to
+-include support for features found in version 3 of the LDAP protocol.
+-New extended operation functions were added to support LDAPv3 features
+-such as controls. In addition, other LDAP API changes were made to
+-
+-
+-
+-Expires: January 1998 [Page 1]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-support information hiding and thread safety.
+-
+-The C LDAP API is designed to be powerful, yet simple to use. It defines
+-compatible synchronous and asynchronous interfaces to LDAP to suit a
+-wide variety of applications. This document gives a brief overview of
+-the LDAP model, then an overview of how the API is used by an applica-
+-tion program to obtain LDAP information. The API calls are described in
+-detail, followed by an appendix that provides some example code demon-
+-strating the use of the API. This document provides information to the
+-Internet community. It does not specify any standard.
+-
+-3. Overview of the LDAP Model
+-
+-LDAP is the lightweight directory access protocol, described in [2] and
+-[6]. It can provide a lightweight frontend to the X.500 directory [1],
+-or a stand-alone service. In either mode, LDAP is based on a client-
+-server model in which a client makes a TCP connection to an LDAP server,
+-over which it sends requests and receives responses.
+-
+-The LDAP information model is based on the entry, which contains infor-
+-mation about some object (e.g., a person). Entries are composed of
+-attributes, which have a type and one or more values. Each attribute has
+-a syntax that determines what kinds of values are allowed in the attri-
+-bute (e.g., ASCII characters, a jpeg photograph, etc.) and how those
+-values behave during directory operations (e.g., is case significant
+-during comparisons).
+-
+-Entries may be organized in a tree structure, usually based on politi-
+-cal, geographical, and organizational boundaries. Each entry is uniquely
+-named relative to its sibling entries by its relative distinguished name
+-(RDN) consisting of one or more distinguished attribute values from the
+-entry. At most one value from each attribute may be used in the RDN.
+-For example, the entry for the person Babs Jensen might be named with
+-the "Barbara Jensen" value from the commonName attribute.
+-
+-A globally unique name for an entry, called a distinguished name or DN,
+-is constructed by concatenating the sequence of RDNs from the entry up
+-to the root of the tree. For example, if Babs worked for the University
+-of Michigan, the DN of her U-M entry might be "cn=Barbara Jensen,
+-o=University of Michigan, c=US". The DN format used by LDAP is defined
+-in [4].
+-
+-Operations are provided to authenticate, search for and retrieve infor-
+-mation, modify information, and add and delete entries from the tree.
+-The next sections give an overview of how the API is used and detailed
+-descriptions of the LDAP API calls that implement all of these func-
+-tions.
+-
+-
+-
+-
+-Expires: January 1998 [Page 2]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-4. Overview of LDAP API Use
+-
+-An application generally uses the C LDAP API in four simple steps.
+-
+-- Initialize an LDAP session with a default LDAP server. The
+- ldap_init() function returns a handle to the session, allowing mul-
+- tiple connections to be open at once.
+-
+-- Authenticate to the LDAP server. The ldap_bind() function and
+- friends support a variety of authentication methods.
+-
+-- Perform some LDAP operations and obtain some results. ldap_search()
+- and friends return results which can be parsed by
+- ldap_result2error(), ldap_first_entry(), ldap_next_entry(), etc.
+-
+-- Close the session. The ldap_unbind() function closes the connec-
+- tion.
+-
+-Operations can be performed either synchronously or asynchronously. The
+-names of the synchronous functions end in _s. For example, a synchronous
+-search can be completed by calling ldap_search_s(). An asynchronous
+-search can be initiated by calling ldap_search(). All synchronous rou-
+-tines return an indication of the outcome of the operation (e.g, the
+-constant LDAP_SUCCESS or some other error code). The asynchronous rou-
+-tines return the message id of the operation initiated. This id can be
+-used in subsequent calls to ldap_result() to obtain the result(s) of the
+-operation. An asynchronous operation can be abandoned by calling
+-ldap_abandon().
+-
+-Results and errors are returned in an opaque structure called LDAPMes-
+-sage. Routines are provided to parse this structure, step through
+-entries and attributes returned, etc. Routines are also provided to
+-interpret errors. Later sections of this document describe these rou-
+-tines in more detail.
+-
+-LDAP version 3 servers may return referrals to other servers. By
+-default, implementations of this API will attempt to follow referrals
+-automatically for the application. This behavior can be disabled glo-
+-bally (using the ldap_set_option() call) or on a per-request basis
+-through the use of a client control.
+-
+-As in the LDAPv3 protocol itself, all DNs and string values that are
+-passed into or produced by the C LDAP API are represented as UTF-8[10]
+-characters.
+-
+-For compatibility with existing applications, implementations of this
+-API will by default use version 2 of the LDAP protocol. Applications
+-that intend to take advantage of LDAP version 3 features will need to
+-
+-
+-
+-Expires: January 1998 [Page 3]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-use the ldap_set_option() call with a LDAP_OPT_PROTOCOL_VERSION to
+-switch to version 3.
+-
+-
+-5. Common Data Structures
+-
+-Some data structures that are common to several LDAP API functions are
+-defined here:
+-
+- typedef struct ldap LDAP;
+-
+- typedef struct ldapmsg LDAPMessage;
+-
+- struct berval {
+- unsigned long bv_len;
+- char *bv_val;
+- };
+-
+- struct timeval {
+- long tv_sec;
+- long tv_usec;
+- };
+-
+-The LDAP structure is an opaque data type that represents an LDAP ses-
+-sion Typically this corresponds to a connection to a single server, but
+-it may encompass several server connections in the face of LDAPv3 refer-
+-rals.
+-
+-The LDAPMessage structure is an opaque data type that is used to return
+-results and error information.
+-
+-The berval structure is used to represent arbitrary binary data and its
+-fields have the following meanings:
+-
+-bv_len Length of data in bytes.
+-
+-bv_val A pointer to the data itself.
+-
+-
+-The timeval structure is used to represent an interval of time and its
+-fields have the following meanings:
+-
+-tv_sec Seconds component of time interval.
+-
+-tv_usec Microseconds component of time interval.
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 4]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-6. LDAP Error Codes
+-
+-Many of the LDAP API routines return LDAP error codes, some of which
+-indicate local errors and some of which may be returned by servers.
+-Supported error codes are (hexadecimal values are given in parentheses
+-after the constant):
+-
+- LDAP_SUCCESS (0x00)
+- LDAP_OPERATIONS_ERROR( 0x01)
+- LDAP_PROTOCOL_ERROR (0x02)
+- LDAP_TIMELIMIT_EXCEEDED (0x03)
+- LDAP_SIZELIMIT_EXCEEDED (0x04)
+- LDAP_COMPARE_FALSE (0x05)
+- LDAP_COMPARE_TRUE (0x06)
+- LDAP_STRONG_AUTH_NOT_SUPPORTED (0x07)
+- LDAP_STRONG_AUTH_REQUIRED (0x08)
+- LDAP_REFERRAL (0x0a) -- new in LDAPv3
+- LDAP_ADMINLIMIT_EXCEEDED (0x0b) -- new in LDAPv3
+- LDAP_UNAVAILABLE_CRITICAL_EXTENSION (0x0c) -- new in LDAPv3
+- LDAP_CONFIDENTIALITY_REQUIRED (0x0d) -- new in LDAPv3
+- LDAP_NO_SUCH_ATTRIBUTE (0x10)
+- LDAP_UNDEFINED_TYPE (0x11)
+- LDAP_INAPPROPRIATE_MATCHING (0x12)
+- LDAP_CONSTRAINT_VIOLATION (0x13)
+- LDAP_TYPE_OR_VALUE_EXISTS (0x14)
+- LDAP_INVALID_SYNTAX (0x15)
+- LDAP_NO_SUCH_OBJECT (0x20)
+- LDAP_ALIAS_PROBLEM (0x21)
+- LDAP_INVALID_DN_SYNTAX (0x22)
+- LDAP_IS_LEAF (0x23) -- not used in LDAPv3
+- LDAP_ALIAS_DEREF_PROBLEM (0x24)
+- LDAP_INAPPROPRIATE_AUTH (0x30)
+- LDAP_INVALID_CREDENTIALS (0x31)
+- LDAP_INSUFFICIENT_ACCESS (0x32)
+- LDAP_BUSY (0x33)
+- LDAP_UNAVAILABLE (0x34)
+- LDAP_UNWILLING_TO_PERFORM (0x35)
+- LDAP_LOOP_DETECT (0x36)
+- LDAP_NAMING_VIOLATION (0x40)
+- LDAP_OBJECT_CLASS_VIOLATION (0x41)
+- LDAP_NOT_ALLOWED_ON_NONLEAF (0x42)
+- LDAP_NOT_ALLOWED_ON_RDN (0x43)
+- LDAP_ALREADY_EXISTS (0x44)
+- LDAP_NO_OBJECT_CLASS_MODS (0x45)
+- LDAP_RESULTS_TOO_LARGE (0x46)
+- LDAP_AFFECTS_MULTIPLE_DSAS (0x47) -- new in LDAPv3
+- LDAP_OTHER (0x50)
+- LDAP_SERVER_DOWN (0x51)
+-
+-
+-
+-Expires: January 1998 [Page 5]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- LDAP_LOCAL_ERROR (0x52)
+- LDAP_ENCODING_ERROR (0x53)
+- LDAP_DECODING_ERROR (0x54)
+- LDAP_TIMEOUT (0x55)
+- LDAP_AUTH_UNKNOWN (0x56)
+- LDAP_FILTER_ERROR (0x57)
+- LDAP_USER_CANCELLED (0x58)
+- LDAP_PARAM_ERROR (0x59)
+- LDAP_NO_MEMORY (0x5a)
+- LDAP_CONNECT_ERROR (0x5b)
+- LDAP_NOT_SUPPORTED (0x5c)
+- LDAP_CONTROL_NOT_FOUND (0x5d)
+- LDAP_NO_RESULTS_RETURNED (0x5e)
+- LDAP_MORE_RESULTS_TO_RETURN (0x5f)
+- LDAP_CLIENT_LOOP (0x60)
+- LDAP_REFERRAL_LIMIT_EXCEEDED (0x61)
+-
+-
+-7. Performing LDAP Operations
+-
+-This section describes each LDAP operation API call in detail. All func-
+-tions take a "session handle," a pointer to an LDAP structure containing
+-per-connection information. Many routines return results in an LDAPMes-
+-sage structure. These structures and others are described as needed
+-below.
+-
+-
+-7.1. Initializing an LDAP Session
+-
+-ldap_init() initializes a session with an LDAP server. The server is not
+-actually contacted until an operation is performed that requires it,
+-allowing various options to be set after initialization.
+-
+- LDAP *ldap_init(
+- char *hostname,
+- int portno
+- );
+-
+-Use of the following routine is deprecated.
+-
+- LDAP *ldap_open(
+- char *hostname,
+- int portno
+- );
+-
+-Parameters are:
+-
+-hostname Contains a space-separated list of hostnames or dotted strings
+-
+-
+-
+-Expires: January 1998 [Page 6]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- representing the IP address of hosts running an LDAP server to
+- connect to. Each hostname in the list can include an optional
+- port number which is separated from the host itself with a
+- colon (:) character. The hosts are tried in the order listed,
+- stopping with the first one to which a successful connection is
+- made. Note that only ldap_open() attempts to make the connec-
+- tion before returning to the caller. ldap_init() does not con-
+- nect to the LDAP server.
+-
+-portno Contains the TCP port number to connect to. The default LDAP
+- port of 389 can be obtained by supplying the constant
+- LDAP_PORT. If a host includes a port number then this parame-
+- ter is ignored.
+-
+-ldap_init() and ldap_open() both return a "session handle," a pointer to
+-an opaque structure that should be passed to subsequent calls pertaining
+-to the session. These routines return NULL if the session cannot be ini-
+-tialized in which case the operating system error reporting mechanism
+-can be checked to see why the call failed.
+-
+-Note that if you connect to an LDAPv2 server, one of the ldap_bind()
+-calls described below must be completed before other operations can be
+-performed on the session. LDAPv3 does not require that a bind operation
+-be completed before other operations can be performed.
+-
+-The calling program can set various attributes of the session by calling
+-the routines described in the next section.
+-
+-
+-7.2. LDAP Session Handle Options
+-
+-The LDAP session handle returned by ldap_init() is a pointer to an
+-opaque data type representing an LDAP session. Formerly, this data type
+-was a structure exposed to the caller, and various fields in the struc-
+-ture could be set to control aspects of the session, such as size and
+-time limits on searches.
+-
+-In the interest of insulating callers from inevitable changes to this
+-structure, these aspects of the session are now accessed through a pair
+-of accessor functions, described below.
+-
+-ldap_get_option() is used to access the current value of various
+-session-wide parameters. ldap_set_option() is used to set the value of
+-these parameters.
+-
+- int ldap_get_option(
+- LDAP *ld,
+- int option,
+-
+-
+-
+-Expires: January 1998 [Page 7]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- void *outvalue
+- );
+-
+- int ldap_set_option(
+- LDAP *ld,
+- int option,
+- void *invalue
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-option The name of the option being accessed or set. This parameter
+- should be one of the following constants, which have the indi-
+- cated meanings. After the constant the actual value of the con-
+- stant is listed in hexadecimal in parentheses followed by the
+- type of the corresponding outvalue or invalue parameter.
+-
+- LDAP_OPT_DESC (0x01) int *
+- The underlying socket descriptor corresponding to the default
+- LDAP connection.
+-
+- LDAP_OPT_DEREF (0x02) int *
+- Controls how aliases are handled during search. It can have
+- one of the following values: LDAP_DEREF_NEVER (0x00),
+- LDAP_DEREF_SEARCHING (0x01), LDAP_DEREF_FINDING (0x02), or
+- LDAP_DEREF_ALWAYS (0x03). The LDAP_DEREF_SEARCHING value
+- means aliases should be dereferenced during the search but not
+- when locating the base object of the search. The
+- LDAP_DEREF_FINDING value means aliases should be dereferenced
+- when locating the base object but not during the search.
+-
+- LDAP_OPT_SIZELIMIT (0x03) int *
+- A limit on the number of entries to return from a search. A
+- value of zero means no limit.
+-
+- LDAP_OPT_TIMELIMIT (0x04) int *
+- A limit on the number of seconds to spend on a search. A value
+- of zero means no limit
+-
+- LDAP_OPT_REBIND_FN (0x06) function pointer
+- See the discussion of ldap_bind() and friends below.
+-
+- LDAP_OPT_REBIND_ARG (0x07) void *
+- See the discussion of ldap_bind() and friends below.
+-
+- LDAP_OPT_REFERRALS (0x08) void *
+-
+-
+-
+-Expires: January 1998 [Page 8]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- This option controls whether the LDAP library automatically
+- follows referrals returned by LDAP servers or not. It can be
+- set to one of the constants LDAP_OPT_ON or LDAP_OPT_OFF.
+-
+- LDAP_OPT_RESTART (0x09) void *
+- This option controls whether LDAP I/O operations should
+- automatically be restarted if they abort prematurely. It
+- should be set to one of the constants LDAP_OPT_ON or
+- LDAP_OPT_OFF. This option is useful if an LDAP I/O operation
+- may be interrupted prematurely, for example by a timer going
+- off, or other interrrupt.
+-
+- LDAP_OPT_PROTOCOL_VERSION (0x11) int *
+- This option indicates the version of the default LDAP server.
+- It can be one of the constants LDAP_VERSION2 or LDAP_VERSION3.
+- If no version is set the default is LDAP_VERSION2.
+-
+- LDAP_OPT_SERVER_CONTROLS (0x12) LDAPControl **
+- A default list of LDAP server controls to be sent with each
+- request. See the Using Controls section below.
+-
+- LDAP_OPT_CLIENT_CONTROLS (0x13) LDAPControl **
+- A default list of client controls that affect the LDAP ses-
+- sion. See the Using Controls section below.
+-
+- LDAP_OPT_HOST_NAME (0x30) char **
+- The host name of the default LDAP server.
+-
+- LDAP_OPT_ERROR_NUMBER (0x31) int *
+- The code of the most recent LDAP error that occurred for this
+- session.
+-
+- LDAP_OPT_ERROR_STRING (0x32) char **
+- The message returned with the most recent LDAP error that
+- occurred for this session.
+-
+-
+-outvalue The address of a place to put the value of the option. The
+- actual type of this parameter depends on the setting of the
+- option parameter.
+-
+-invalue A pointer to the value the option is to be given. The actual
+- type of this parameter depends on the setting of the option
+- parameter. The constants LDAP_OPT_ON and LDAP_OPT_OFF can be
+- given for options that have on or off settings.
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 9]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-7.3. Working with controls
+-
+-LDAPv3 operations can be extended through the use of controls. Controls
+-may be sent to a server or returned to the client with any LDAP message.
+-These controls are referred to as server controls.
+-
+-The LDAP API also supports a client-side extension mechanism through the
+-use of client controls. These controls affect the behavior of the LDAP
+-API only and are never sent to a server. A common data structure is
+-used to represent both types of controls:
+-
+- typedef struct ldapcontrol {
+- char *ldctl_oid;
+- struct berval ldctl_value;
+- char ldctl_iscritical;
+- } LDAPControl, *PLDAPControl;
+-
+-The fields in the ldapcontrol structure have the following meanings:
+-
+-ldctl_oid The control type, represented as a string.
+-
+-ldctl_value The data associated with the control (if any).
+-
+-ldctl_iscritical Indicates whether the control is critical of not. If
+- this field is non-zero, the operation will only be car-
+- ried out if the control is recognized by the server
+- and/or client.
+-
+-Some LDAP API calls allocate an ldapcontrol structure or a NULL-
+-terminated array of ldapcontrol structures. The following routines can
+-be used to dispose of a single control or an array of controls:
+-
+- void ldap_control_free( LDAPControl *ctrl );
+- void ldap_controls_free( LDAPControl **ctrls );
+-
+-A set of controls that affect the entire session can be set using the
+-ldap_set_option() function (see above). A list of controls can also be
+-passed directly to some LDAP API calls such as ldap_search_ext(), in
+-which case any controls set for the session through the use of
+-ldap_set_option() are ignored. Control lists are represented as a NULL-
+-terminated array of pointers to ldapcontrol structures.
+-
+-Server controls are defined by LDAPv3 protocol extension documents; for
+-example, a control has been proposed to support server-side sorting of
+-search results [7].
+-
+-No client controls are defined by this document but they may be defined
+-in future revisions or in any document that extends this API.
+-
+-
+-
+-Expires: January 1998 [Page 10]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-7.4. Authenticating to the directory
+-
+-The following functions are used to authenticate an LDAP client to an
+-LDAP directory server.
+-
+-The ldap_sasl_bind() and ldap_sasl_bind_s() functions can be used to do
+-general and extensible authentication over LDAP through the use of the
+-Simple Authentication Security Layer [8]. The routines both take the dn
+-to bind as, the method to use, as a dotted-string representation of an
+-OID identifying the method, and a struct berval holding the credentials.
+-The special constant value LDAP_SASL_SIMPLE ("") can be passed to
+-request simple authentication, or the simplified routines
+-ldap_simple_bind() or ldap_simple_bind_s() can be used.
+-
+- int ldap_sasl_bind(
+- LDAP *ld,
+- char *dn,
+- char *mechanism,
+- struct berval *cred,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+- int ldap_sasl_bind_s(
+- LDAP *ld,
+- char *dn,
+- char *mechanism,
+- struct berval *cred,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- struct berval **servercredp
+- );
+-
+- int ldap_simple_bind(
+- LDAP *ld,
+- char *dn,
+- char *passwd
+- );
+-
+- int ldap_simple_bind_s(
+- LDAP *ld,
+- char *dn,
+- char *passwd
+- );
+-
+- The use of the following routines is deprecated:
+-
+-
+-
+-
+-Expires: January 1998 [Page 11]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- int ldap_bind( LDAP *ld, char *dn, char *cred, int method );
+-
+- int ldap_bind_s( LDAP *ld, char *dn, char *cred, int method );
+-
+- int ldap_kerberos_bind( LDAP *ld, char *dn );
+-
+- int ldap_kerberos_bind_s( LDAP *ld, char *dn );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry to bind as.
+-
+-mechanism Either LDAP_AUTH_SIMPLE_OID to get simple authentication,
+- or a dotted text string representing an OID identifying the
+- SASL method.
+-
+-cred The credentials with which to authenticate. Arbitrary
+- credentials can be passed using this parameter. The format
+- and content of the credentials depends on the setting of
+- the mechanism parameter.
+-
+-passwd For ldap_simple_bind(), the password to compare to the
+- entry's userPassword attribute.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_sasl_bind() call succeeds.
+-
+-servercredp This result parameter will be set to the credentials
+- returned by the server. This should be freed by calling
+- ldap_If no credentials are returned it will be set to NULL.
+-
+-Additional parameters for the deprecated routines are not described.
+-Interested readers are referred to RFC 1823.
+-
+-The ldap_sasl_bind() function initiates an asynchronous bind operation
+-and returns the constant LDAP_SUCCESS if the request was successfully
+-sent, or another LDAP error code if not. See the section below on error
+-handling for more information about possible errors and how to interpret
+-them. If successful, ldap_sasl_bind() places the message id of the
+-request in *msgidp. A subsequent call to ldap_result(), described below,
+-can be used to obtain the result of the bind.
+-
+-
+-
+-
+-Expires: January 1998 [Page 12]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-The ldap_simple_bind() function initiates a simple asynchronous bind
+-operation and returns the message id of the operation initiated. A sub-
+-sequent call to ldap_result(), described below, can be used to obtain
+-the result of the bind. In case of error, ldap_simple_bind() will return
+--1, setting the session error parameters in the LDAP structure appropri-
+-ately.
+-
+-The synchronous ldap_sasl_bind_s() and ldap_simple_bind_s() functions
+-both return the result of the operation, either the constant
+-LDAP_SUCCESS if the operation was successful, or another LDAP error code
+-if it was not. See the section below on error handling for more informa-
+-tion about possible errors and how to interpret them.
+-
+-Note that if an LDAPv2 server is contacted, no other operations over the
+-connection should be attempted before a bind call has successfully com-
+-pleted.
+-
+-Subsequent bind calls can be used to re-authenticate over the same con-
+-nection, and multistep SASL sequences can be accomplished through a
+-sequence of calls to ldap_sasl_bind() or ldap_sasl_bind_s().
+-
+-
+-7.5. Closing the session
+-
+-The following functions are used to unbind from the directory, close the
+-connection, and dispose of the session handle.
+-
+- int ldap_unbind( LDAP *ld );
+-
+- int ldap_unbind_s( LDAP *ld );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-ldap_unbind() and ldap_unbind_s() both work synchronously, unbinding
+-from the directory, closing the connection, and freeing up the ld struc-
+-ture before returning. There is no server response to an unbind opera-
+-tion. ldap_unbind() returns LDAP_SUCCESS (or another LDAP error code if
+-the request cannot be sent to the LDAP server). After a call to
+-ldap_unbind() or ldap_unbind_s(), the session handle ld is invalid.
+-
+-
+-7.6. Searching
+-
+-The following functions are used to search the LDAP directory, returning
+-a requested set of attributes for each entry matched. There are five
+-variations.
+-
+-
+-
+-Expires: January 1998 [Page 13]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- int ldap_search_ext(
+- LDAP *ld,
+- char *base,
+- int scope,
+- char *filter,
+- char **attrs,
+- int attrsonly,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- struct timeval *timeoutp,
+- int sizelimit,
+- int *msgidp
+- );
+-
+- int ldap_search_ext_s(
+- LDAP *ld,
+- char *base,
+- int scope,
+- char *filter,
+- char **attrs,
+- int attrsonly,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- struct timeval *timeoutp,
+- int sizelimit,
+- LDAPMessage **res
+- );
+-
+- int ldap_search(
+- LDAP *ld,
+- char *base,
+- int scope,
+- char *filter,
+- char **attrs,
+- int attrsonly
+- );
+-
+- int ldap_search_s(
+- LDAP *ld,
+- char *base,
+- int scope,
+- char *filter,
+- char **attrs,
+- int attrsonly,
+- LDAPMessage **res
+- );
+-
+- int ldap_search_st(
+-
+-
+-
+-Expires: January 1998 [Page 14]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- LDAP *ld,
+- char *base,
+- int scope,
+- char *filter,
+- char **attrs,
+- int attrsonly,
+- struct timeval *timeout,
+- LDAPMessage **res
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-base The dn of the entry at which to start the search.
+-
+-scope One of LDAP_SCOPE_BASE (0x00), LDAP_SCOPE_ONELEVEL (0x01),
+- or LDAP_SCOPE_SUBTREE (0x02), indicating the scope of the
+- search.
+-
+-filter A character string as described in [3], representing the
+- search filter.
+-
+-attrs A NULL-terminated array of strings indicating which attri-
+- butes to return for each matching entry. Passing NULL for
+- this parameter causes all available attributes to be
+- retrieved.
+-
+-attrsonly A boolean value that should be zero if both attribute types
+- and values are to be returned, non-zero if only types are
+- wanted.
+-
+-timeout For the ldap_search_st() function, this specifies the local
+- search timeout value. For the ldap_search_ext() and
+- ldap_search_ext_s() functions, this specifies both the
+- local search timeout value and the operation time limit
+- that is sent to the server within the search request.
+-
+-res For the synchronous calls, this is a result parameter which
+- will contain the results of the search upon completion of
+- the call.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_search_ext() call succeeds.
+-
+-
+-
+-Expires: January 1998 [Page 15]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-There are three options in the session handle ld which potentially
+-affect how the search is performed. They are:
+-
+-LDAP_OPT_SIZELIMIT
+- A limit on the number of entries to return from the search.
+- A value of zero means no limit. Note that the value from
+- the session handle is ignored when using the
+- ldap_search_ext() or ldap_search_ext_s() functions.
+-
+-LDAP_OPT_TIMELIMIT
+- A limit on the number of seconds to spend on the search. A
+- value of zero means no limit. Note that the value from the
+- session handle is ignored when using the ldap_search_ext()
+- or ldap_search_ext_s() functions.
+-
+-LDAP_OPT_DEREF
+- One of LDAP_DEREF_NEVER (0x00), LDAP_DEREF_SEARCHING
+- (0x01), LDAP_DEREF_FINDING (0x02), or LDAP_DEREF_ALWAYS
+- (0x03), specifying how aliases should be handled during the
+- search. The LDAP_DEREF_SEARCHING value means aliases should
+- be dereferenced during the search but not when locating the
+- base object of the search. The LDAP_DEREF_FINDING value
+- means aliases should be dereferenced when locating the base
+- object but not during the search.
+-
+-The ldap_search_ext() function initiates an asynchronous search opera-
+-tion and returns the constant LDAP_SUCCESS if the request was success-
+-fully sent, or another LDAP error code if not. See the section below on
+-error handling for more information about possible errors and how to
+-interpret them. If successful, ldap_search_ext() places the message id
+-of the request in *msgidp. A subsequent call to ldap_result(), described
+-below, can be used to obtain the results from the search. These results
+-can be parsed using the result parsing routines described in detail
+-later.
+-
+-Similar to ldap_search_ext(), the ldap_search() function initiates an
+-asynchronous search operation and returns the message id of the opera-
+-tion initiated. As for ldap_search_ext(), a subsequent call to
+-ldap_result(), described below, can be used to obtain the result of the
+-bind. In case of error, ldap_search() will return -1, setting the ses-
+-sion error parameters in the LDAP structure appropriately.
+-
+-The synchronous ldap_search_ext_s(), ldap_search_s(), and
+-ldap_search_st() functions all return the result of the operation,
+-either the constant LDAP_SUCCESS if the operation was successful, or
+-another LDAP error code if it was not. See the section below on error
+-handling for more information about possible errors and how to interpret
+-them. Entries returned from the search (if any) are contained in the
+-
+-
+-
+-Expires: January 1998 [Page 16]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-res parameter. This parameter is opaque to the caller. Entries, attri-
+-butes, values, etc., should be extracted by calling the parsing routines
+-described below. The results contained in res should be freed when no
+-longer in use by calling ldap_msgfree(), described later.
+-
+-The ldap_search_ext() and ldap_search_ext_s() functions support LDAPv3
+-server controls, client controls, and allow varying size and time limits
+-to be easily specified for each search operation. The ldap_search_st()
+-function is identical to ldap_search_s() except that it takes an addi-
+-tional parameter specifying a local timeout for the search.
+-
+-7.7. Reading an Entry
+-
+-LDAP does not support a read operation directly. Instead, this operation
+-is emulated by a search with base set to the DN of the entry to read,
+-scope set to LDAP_SCOPE_BASE, and filter set to "(objectclass=*)". attrs
+-contains the list of attributes to return.
+-
+-
+-7.8. Listing the Children of an Entry
+-
+-LDAP does not support a list operation directly. Instead, this operation
+-is emulated by a search with base set to the DN of the entry to list,
+-scope set to LDAP_SCOPE_ONELEVEL, and filter set to "(objectclass=*)".
+-attrs contains the list of attributes to return for each child entry.
+-
+-7.9. Comparing a Value Against an Entry
+-
+-The following routines are used to compare a given attribute value
+-assertion against an LDAP entry. There are four variations:
+-
+- int ldap_compare_ext(
+- LDAP *ld,
+- char *dn,
+- char *attr,
+- struct berval *bvalue
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+- int ldap_compare_ext_s(
+- LDAP *ld,
+- char *dn,
+- char *attr,
+- struct berval *bvalue,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+-
+-
+-
+-Expires: January 1998 [Page 17]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- );
+-
+- int ldap_compare(
+- LDAP *ld,
+- char *dn,
+- char *attr,
+- char *value
+- );
+-
+- int ldap_compare_s(
+- LDAP *ld,
+- char *dn,
+- char *attr,
+- char *value
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry to compare against.
+-
+-attr The attribute to compare against.
+-
+-bvalue The attribute value to compare against those found in the
+- given entry. This parameter is used in the extended rou-
+- tines and is a pointer to a struct berval so it is possible
+- to compare binary values.
+-
+-value A string attribute value to compare against, used by the
+- ldap_compare() and ldap_compare_s() functions. Use
+- ldap_compare_ext() or ldap_compare_ext_s() if you need to
+- compare binary values.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_compare_ext() call succeeds.
+-
+-The ldap_compare_ext() function initiates an asynchronous compare opera-
+-tion and returns the constant LDAP_SUCCESS if the request was success-
+-fully sent, or another LDAP error code if not. See the section below on
+-error handling for more information about possible errors and how to
+-interpret them. If successful, ldap_compare_ext() places the message id
+-of the request in *msgidp. A subsequent call to ldap_result(), described
+-below, can be used to obtain the result of the compare.
+-
+-
+-
+-Expires: January 1998 [Page 18]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-Similar to ldap_compare_ext(), the ldap_compare() function initiates an
+-asynchronous compare operation and returns the message id of the opera-
+-tion initiated. As for ldap_compare_ext(), a subsequent call to
+-ldap_result(), described below, can be used to obtain the result of the
+-bind. In case of error, ldap_compare() will return -1, setting the ses-
+-sion error parameters in the LDAP structure appropriately.
+-
+-The synchronous ldap_compare_ext_s() and ldap_compare_s() functions both
+-return the result of the operation, either the constant LDAP_SUCCESS if
+-the operation was successful, or another LDAP error code if it was not.
+-See the section below on error handling for more information about pos-
+-sible errors and how to interpret them.
+-
+-The ldap_compare_ext() and ldap_compare_ext_s() functions support LDAPv3
+-server controls and client controls.
+-
+-
+-7.10. Modifying an entry
+-
+-The following routines are used to modify an existing LDAP entry. There
+-are four variations:
+-
+- typedef struct ldapmod {
+- int mod_op;
+- char *mod_type;
+- union {
+- char **modv_strvals;
+- struct berval **modv_bvals;
+- } mod_vals;
+- } LDAPMod;
+- #define mod_values mod_vals.modv_strvals
+- #define mod_bvalues mod_vals.modv_bvals
+-
+- int ldap_modify_ext(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **mods,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+- int ldap_modify_ext_s(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **mods,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+-
+-
+-
+-Expires: January 1998 [Page 19]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- );
+-
+- int ldap_modify(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **mods
+- );
+-
+- int ldap_modify_s(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **mods
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry to modify.
+-
+-mods A NULL-terminated array of modifications to make to the
+- entry.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_modify_ext() call succeeds.
+-
+-The fields in the LDAPMod structure have the following meanings:
+-
+-mod_op The modification operation to perform. It should be one of
+- LDAP_MOD_ADD (0x00), LDAP_MOD_DELETE (0x01), or
+- LDAP_MOD_REPLACE (0x02). This field also indicates the
+- type of values included in the mod_vals union. It is logi-
+- cally ORed with LDAP_MOD_BVALUES (0x80) to select the
+- mod_bvalues form. Otherwise, the mod_values form is used.
+-
+-mod_type The type of the attribute to modify.
+-
+-mod_vals The values (if any) to add, delete, or replace. Only one of
+- the mod_values or mod_bvalues variants should be used,
+- selected by ORing the mod_op field with the constant
+- LDAP_MOD_BVALUES. mod_values is a NULL-terminated array of
+- zero-terminated strings and mod_bvalues is a NULL-
+- terminated array of berval structures that can be used to
+- pass binary values such as images.
+-
+-
+-
+-Expires: January 1998 [Page 20]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-For LDAP_MOD_ADD modifications, the given values are added to the
+-entry, creating the attribute if necessary.
+-
+-For LDAP_MOD_DELETE modifications, the given values are deleted from the
+-entry, removing the attribute if no values remain. If the entire attri-
+-bute is to be deleted, the mod_vals field should be set to NULL.
+-
+-For LDAP_MOD_REPLACE modifications, the attribute will have the listed
+-values after the modification, having been created if necessary, or
+-removed if the mod_vals field is NULL. All modifications are performed
+-in the order in which they are listed.
+-
+-The ldap_modify_ext() function initiates an asynchronous modify opera-
+-tion and returns the constant LDAP_SUCCESS if the request was success-
+-fully sent, or another LDAP error code if not. See the section below on
+-error handling for more information about possible errors and how to
+-interpret them. If successful, ldap_modify_ext() places the message id
+-of the request in *msgidp. A subsequent call to ldap_result(), described
+-below, can be used to obtain the result of the modify.
+-
+-Similar to ldap_modify_ext(), the ldap_modify() function initiates an
+-asynchronous modify operation and returns the message id of the opera-
+-tion initiated. As for ldap_modify_ext(), a subsequent call to
+-ldap_result(), described below, can be used to obtain the result of the
+-modify. In case of error, ldap_modify() will return -1, setting the ses-
+-sion error parameters in the LDAP structure appropriately.
+-
+-The synchronous ldap_modify_ext_s() and ldap_modify_s() functions both
+-return the result of the operation, either the constant LDAP_SUCCESS if
+-the operation was successful, or another LDAP error code if it was not.
+-See the section below on error handling for more information about pos-
+-sible errors and how to interpret them.
+-
+-The ldap_modify_ext() and ldap_modify_ext_s() functions support LDAPv3
+-server controls and client controls.
+-
+-
+-7.11. Modifying the Name of an Entry
+-
+-In LDAPv2, the ldap_modrdn() and ldap_modrdn_s() routines were used to
+-change the name of an LDAP entry. They could only be used to change the
+-least significant component of a name (the RDN or relative distinguished
+-name). LDAPv3 provides the Modify DN protocol operation that allows more
+-general name change access. The ldap_rename() and ldap_rename_s() rou-
+-tines are used to change the name of an entry, and the use of the
+-ldap_modrdn() and ldap_modrdn_s() routines is deprecated.
+-
+- int ldap_rename(
+-
+-
+-
+-Expires: January 1998 [Page 21]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- LDAP *ld,
+- char *dn,
+- char *newrdn,
+- char *newparent,
+- int deleteoldrdn,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+-
+- );
+- int ldap_rename_s(
+- LDAP *ld,
+- char *dn,
+- char *newrdn,
+- char *newparent,
+- int deleteoldrdn,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+- );
+-
+- Use of the following routines is deprecated.
+-
+- int ldap_modrdn(
+- LDAP *ld,
+- char *dn,
+- char *newrdn,
+- int deleteoldrdn
+- );
+- int ldap_modrdn_s(
+- LDAP *ld,
+- char *dn,
+- char *newrdn,
+- int deleteoldrdn
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry whose DN is to be changed.
+-
+-newrdn The new RDN to give the entry.
+-
+-newparent The new parent, or superior entry. If this parameter is
+- NULL, only the RDN of the entry is changed. The root DN
+- may be specified by passing a zero length string, "". The
+- newparent parameter should always be NULL when using ver-
+- sion 2 of the LDAP protocol; otherwise the server's
+-
+-
+-
+-Expires: January 1998 [Page 22]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- behavior is undefined.
+-
+-deleteoldrdn This parameter only has meaning on the rename routines if
+- newrdn is different than the old RDN. It is a boolean
+- value, if non-zero indicating that the old RDN value(s)
+- should be removed, if zero indicating that the old RDN
+- value(s) should be retained as non-distinguished values of
+- the entry.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_rename() call succeeds.
+-
+-The ldap_rename() function initiates an asynchronous modify DN operation
+-and returns the constant LDAP_SUCCESS if the request was successfully
+-sent, or another LDAP error code if not. See the section below on error
+-handling for more information about possible errors and how to interpret
+-them. If successful, ldap_rename() places the DN message id of the
+-request in *msgidp. A subsequent call to ldap_result(), described below,
+-can be used to obtain the result of the rename.
+-
+-The synchronous ldap_rename_s() returns the result of the operation,
+-either the constant LDAP_SUCCESS if the operation was successful, or
+-another LDAP error code if it was not. See the section below on error
+-handling for more information about possible errors and how to interpret
+-them.
+-
+-The ldap_rename() and ldap_rename_s() functions both support LDAPv3
+-server controls and client controls.
+-
+-
+-7.12. Adding an entry
+-
+-The following functions are used to add entries to the LDAP directory.
+-There are four variations:
+-
+- int ldap_add_ext(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **attrs,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+-
+-
+-
+-Expires: January 1998 [Page 23]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- int ldap_add_ext_s(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **attrs,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+- );
+-
+- int ldap_add(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **attrs
+- );
+-
+- int ldap_add_s(
+- LDAP *ld,
+- char *dn,
+- LDAPMod **attrs
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry to add.
+-
+-attrs The entry's attributes, specified using the LDAPMod struc-
+- ture defined for ldap_modify(). The mod_type and mod_vals
+- fields should be filled in. The mod_op field is ignored
+- unless ORed with the constant LDAP_MOD_BVALUES, used to
+- select the mod_bvalues case of the mod_vals union.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_add_ext() call succeeds.
+-
+-Note that the parent of the entry being added must already exist or the
+-parent must be empty (i.e., equal to the root DN) for an add to succeed.
+-
+-The ldap_add_ext() function initiates an asynchronous add operation and
+-returns the constant LDAP_SUCCESS if the request was successfully sent,
+-or another LDAP error code if not. See the section below on error han-
+-dling for more information about possible errors and how to interpret
+-them. If successful, ldap_add_ext() places the message id of the
+-request in *msgidp. A subsequent call to ldap_result(), described below,
+-
+-
+-
+-Expires: January 1998 [Page 24]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-can be used to obtain the result of the add.
+-
+-Similar to ldap_add_ext(), the ldap_add() function initiates an asyn-
+-chronous add operation and returns the message id of the operation ini-
+-tiated. As for ldap_add_ext(), a subsequent call to ldap_result(),
+-described below, can be used to obtain the result of the add. In case of
+-error, ldap_add() will return -1, setting the session error parameters
+-in the LDAP structure appropriately.
+-
+-The synchronous ldap_add_ext_s() and ldap_add_s() functions both return
+-the result of the operation, either the constant LDAP_SUCCESS if the
+-operation was successful, or another LDAP error code if it was not. See
+-the section below on error handling for more information about possible
+-errors and how to interpret them.
+-
+-The ldap_add_ext() and ldap_add_ext_s() functions support LDAPv3 server
+-controls and client controls.
+-
+-
+-
+-7.13. Deleting an entry
+-
+-The following functions are used to delete a leaf entry from the LDAP
+-directory. There are four variations:
+-
+- int ldap_delete_ext(
+- LDAP *ld,
+- char *dn,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+- int ldap_delete_ext_s(
+- LDAP *ld,
+- char *dn,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+- );
+-
+- int ldap_delete(
+- LDAP *ld,
+- char *dn
+- );
+-
+- int ldap_delete_s(
+- LDAP *ld,
+- char *dn
+-
+-
+-
+-Expires: January 1998 [Page 25]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-dn The name of the entry to delete.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_delete_ext() call succeeds.
+-
+-Note that the entry to delete must be a leaf entry (i.e., it must have
+-no children). Deletion of entire subtrees in a single operation is not
+-supported by LDAP.
+-
+-The ldap_delete_ext() function initiates an asynchronous delete opera-
+-tion and returns the constant LDAP_SUCCESS if the request was success-
+-fully sent, or another LDAP error code if not. See the section below on
+-error handling for more information about possible errors and how to
+-interpret them. If successful, ldap_delete_ext() places the message id
+-of the request in *msgidp. A subsequent call to ldap_result(), described
+-below, can be used to obtain the result of the delete.
+-
+-Similar to ldap_delete_ext(), the ldap_delete() function initiates an
+-asynchronous delete operation and returns the message id of the opera-
+-tion initiated. As for ldap_delete_ext(), a subsequent call to
+-ldap_result(), described below, can be used to obtain the result of the
+-delete. In case of error, ldap_delete() will return -1, setting the ses-
+-sion error parameters in the LDAP structure appropriately.
+-
+-The synchronous ldap_delete_ext_s() and ldap_delete_s() functions both
+-return the result of the operation, either the constant LDAP_SUCCESS if
+-the operation was successful, or another LDAP error code if it was not.
+-See the section below on error handling for more information about pos-
+-sible errors and how to interpret them.
+-
+-The ldap_delete_ext() and ldap_delete_ext_s() functions support LDAPv3
+-server controls and client controls.
+-
+-
+-7.14. Extended Operations
+-
+-The ldap_extended_operation() and ldap_extended_operation_s() routines
+-allow extended LDAP operations to be passed to the server, providing a
+-
+-
+-
+-Expires: January 1998 [Page 26]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-general protocol extensibility mechanism.
+-
+- int ldap_extended_operation(
+- LDAP *ld,
+- char *exoid,
+- struct berval *exdata,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- int *msgidp
+- );
+-
+- int ldap_extended_operation_s(
+- LDAP *ld,
+- char *exoid,
+- struct berval *exdata,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls,
+- char **retoidp,
+- struct berval **retdatap
+- );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-requestoid The dotted-OID text string naming the request.
+-
+-requestdata The arbitrary data required by the operation (if NULL, no
+- data is sent to the server).
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-msgidp This result parameter will be set to the message id of the
+- request if the ldap_extended_operation() call succeeds.
+-
+-retoidp Pointer to a character string that will be set to an allo-
+- cated, dotted-OID text string returned by the server. This
+- string should be disposed of using the ldap_memfree() func-
+- tion. If no OID was returned, *retoidp is set to NULL.
+-
+-retdatap Pointer to a berval structure pointer that will be set an
+- allocated copy of the data returned by the server. This
+- struct berval should be disposed of using ber_bvfree(). If
+- no data is returned, *retdatap is set to NULL.
+-
+-The ldap_extended_operation() function initiates an asynchronous
+-
+-
+-
+-Expires: January 1998 [Page 27]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-extended operation and returns the constant LDAP_SUCCESS if the request
+-was successfully sent, or another LDAP error code if not. See the sec-
+-tion below on error handling for more information about possible errors
+-and how to interpret them. If successful, ldap_extended_operation()
+-places the message id of the request in *msgidp. A subsequent call to
+-ldap_result(), described below, can be used to obtain the result of the
+-extended operation which can be passed to ldap_parse_extended_result()
+-to obtain the OID and data contained in the response.
+-
+-The synchronous ldap_extended_operation_s() function returns the result
+-of the operation, either the constant LDAP_SUCCESS if the operation was
+-successful, or another LDAP error code if it was not. See the section
+-below on error handling for more information about possible errors and
+-how to interpret them. The retoid and retdata parameters are filled in
+-with the OID and data from the response. If no OID or data was
+-returned, these parameters are set to NULL.
+-
+-The ldap_extended_operation() and ldap_extended_operation_s() functions
+-both support LDAPv3 server controls and client controls.
+-
+-
+-8. Abandoning An Operation
+-
+-The following calls are used to abandon an operation in progress:
+-
+- int ldap_abandon_ext(
+- LDAP *ld,
+- int msgid,
+- LDAPControl **serverctrls,
+- LDAPControl **clientctrls
+- );
+-
+- int ldap_abandon(
+- LDAP *ld,
+- int msgid
+- );
+-
+-
+-ld The session handle.
+-
+-msgid The message id of the request to be abandoned.
+-
+-serverctrls List of LDAP server controls.
+-
+-clientctrls List of client controls.
+-
+-ldap_abandon_ext() abandons the operation with message id msgid and
+-returns the constant LDAP_SUCCESS if the abandon was successful or
+-
+-
+-
+-Expires: January 1998 [Page 28]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-another LDAP error code if not. See the section below on error handling
+-for more information about possible errors and how to interpret them.
+-
+-ldap_abandon() is identical to ldap_abandon_ext() except that it returns
+-zero if the abandon was successful, -1 otherwise and does not support
+-LDAPv3 server controls or client controls.
+-
+-After a successful call to ldap_abandon() or ldap_abandon_ext(), results
+-with the given message id are never returned from a subsequent call to
+-ldap_result(). There is no server response to LDAP abandon operations.
+-
+-
+-9. Obtaining Results and Peeking Inside LDAP Messages
+-
+-ldap_result() is used to obtain the result of a previous asynchronously
+-initiated operation. Note that depending on how it is called,
+-ldap_result() may actually return a list or "chain" of messages.
+-
+-ldap_msgfree() frees the results obtained from a previous call to
+-ldap_result(), or a synchronous search routine.
+-
+-ldap_msgtype() returns the type of an LDAP message. ldap_msgid()
+-returns the message ID of an LDAP message.
+-
+- int ldap_result(
+- LDAP *ld,
+- int msgid,
+- int all,
+- struct timeval *timeout,
+- LDAPMessage **res
+- );
+-
+- int ldap_msgfree( LDAPMessage *res );
+-
+- int ldap_msgtype( LDAPMessage *res );
+-
+- int ldap_msgid( LDAPMessage *res );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-msgid The message id of the operation whose results are to be
+- returned, or the constant LDAP_RES_ANY (-1) if any result is
+- desired.
+-
+-all Specifies how many messages will be retrieved in a single call
+- to ldap_result(). This parameter only has meaning for search
+-
+-
+-
+-Expires: January 1998 [Page 29]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- results. Pass the constant LDAP_MSG_ONE (0x00) to retrieve one
+- message at a time. Pass LDAP_MSG_ALL (0x01) to request that
+- all results of a search be received before returning all
+- results in a single chain. Pass LDAP_MSG_RECEIVED (0x02) to
+- indicate that all results retrieved so far should be returned
+- in the result chain.
+-
+-timeout A timeout specifying how long to wait for results to be
+- returned. A NULL value causes ldap_result() to block until
+- results are available. A timeout value of zero seconds speci-
+- fies a polling behavior.
+-
+-res For ldap_result(), a result parameter that will contain the
+- result(s) of the operation. For ldap_msgfree(), the result
+- chain to be freed, obtained from a previous call to
+- ldap_result(), ldap_search_s(), or ldap_search_st().
+-
+-Upon successful completion, ldap_result() returns the type of the first
+-result returned in the res parameter. This will be one of the following
+-constants.
+-
+- LDAP_RES_BIND (0x61)
+- LDAP_RES_SEARCH_ENTRY (0x64)
+- LDAP_RES_SEARCH_REFERENCE (0x73) -- new in LDAPv3
+- LDAP_RES_SEARCH_RESULT (0x65)
+- LDAP_RES_MODIFY (0x67)
+- LDAP_RES_ADD (0x69)
+- LDAP_RES_DELETE (0x6B)
+- LDAP_RES_MODDN (0x6D)
+- LDAP_RES_COMPARE (0x6F)
+- LDAP_RES_EXTENDED (0x78) -- new in LDAPv3
+-
+-ldap_result() returns 0 if the timeout expired and -1 if an error
+-occurs, in which case the error parameters of the LDAP session handle
+-will be set accordingly.
+-
+-ldap_msgfree() frees the result structure pointed to by res and returns
+-the type of the message it freed.
+-
+-ldap_msgtype() returns the type of the LDAP message it is passed as a
+-parameter. The type will be one of the types listed above, or -1 on
+-error.
+-
+-ldap_msgid() returns the message ID associated with the LDAP message
+-passed as a parameter.
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 30]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-10. Handling Errors and Parsing Results
+-
+-The following calls are used to extract information from results and
+-handle errors returned by other LDAP API routines.
+-
+- int ldap_parse_result(
+- LDAP *ld,
+- LDAPMessage *res,
+- int *errcodep,
+- char **matcheddnp,
+- char **errmsgp,
+- char ***referralsp,
+- LDAPControl ***serverctrlsp,
+- int freeit
+- );
+-
+- int ldap_parse_sasl_bind_result(
+- LDAP *ld,
+- LDAPMessage *res,
+- struct berval **servercredp,
+- int freeit
+- );
+-
+- int ldap_parse_extended_result(
+- LDAP *ld,
+- LDAPMessage *res,
+- char **resultoidp,
+- struct berval **resultdata,
+- int freeit
+- );
+-
+- char *ldap_err2string( int err );
+-
+- The use of the following routines is deprecated.
+-
+- int ldap_result2error(
+- LDAP *ld,
+- LDAPMessage *res,
+- int freeit
+- );
+-
+- void ldap_perror( LDAP *ld, char *msg );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-res The result of an LDAP operation as returned by
+-
+-
+-
+-Expires: January 1998 [Page 31]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- ldap_result() or one of the synchronous API operation
+- calls.
+-
+-errcodep This result parameter will be filled in with the LDAP error
+- code field from the LDAPResult message. This is the indi-
+- cation from the server of the outcome of the operation.
+- NULL may be passed to ignore this field.
+-
+-matcheddnp In the case of a return of LDAP_NO_SUCH_OBJECT, this result
+- parameter will be filled in with a DN indicating how much
+- of the name in the request was recognized. NULL may be
+- passed to ignore this field. The matched DN string should
+- be freed by calling ldap_memfree() which is described later
+- in this document.
+-
+-errmsgp This result parameter will be filled in with the contents
+- of the error message field from the LDAPResult message.
+- The error message string should be freed by calling
+- ldap_memfree() which is described later in this document.
+- NULL may be passed to ignore this field.
+-
+-referralsp This result parameter will be filled in with the contents
+- of the referrals field from the LDAPResult message, indi-
+- cating zero or more alternate LDAP servers where the
+- request should be retried. The referrals array should be
+- freed by calling ldap_value_free() which is described later
+- in this document. NULL may be passed to ignore this field.
+-
+-serverctrlsp This result parameter will be filled in with an allocated
+- array of controls copied out of the LDAPResult message.
+- The control array should be freed by calling
+- ldap_controls_free() which was described earlier.
+-
+-freeit A boolean that determines whether the res parameter is
+- disposed of or not. Pass any non-zero value to have these
+- routines free res after extracting the requested informa-
+- tion. This is provided as a convenience; you can also use
+- ldap_msgfree() to free the result later.
+-
+-servercredp For SASL bind results, this result parameter will be filled
+- in with the credentials passed back by the server for
+- mutual authentication, if given. An allocated berval struc-
+- ture is returned that should be disposed of by calling
+- ldap_ber_free(). NULL may be passed to ignore this field.
+-
+-resultoidp For extended results, this result parameter will be filled
+- in with the dotted-OID text representation of the name of
+- the extended operation response. This string should be
+-
+-
+-
+-Expires: January 1998 [Page 32]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- disposed of by calling ldap_memfree(). NULL may be passed
+- to ignore this field.
+-
+-resultdatap For extended results, this result parameter will be filled
+- in with a pointer to a struct berval containing the data in
+- the extended operation response. It should be disposed of
+- by calling ldap_ber_free(). NULL may be passed to ignore
+- this field.
+-
+-err For ldap_err2string(), an LDAP error code, as returned by
+- ldap_result2error() or another LDAP API call.
+-
+-Additional parameters for the deprecated routines are not described.
+-Interested readers are referred to RFC 1823.
+-
+-All of the ldap_parse_*_result() routines skip over messages of type
+-LDAP_RES_SEARCH_ENTRY and LDAP_RES_SEARCH_REFERENCE when looking for a
+-result message to parse. They return the constant LDAP_SUCCESS if the
+-result was successfully parsed and another LDAP error code if not. Note
+-that the LDAP error code that indicates the outcome of the operation
+-performed by the server is placed in the errcodep ldap_parse_result()
+-parameter.
+-
+-ldap_err2string() is used to convert a numeric LDAP error code, as
+-returned by one of the ldap_parse_*_result() routines, or one of the
+-synchronous API operation calls, into an informative NULL-terminated
+-character string message describing the error. It returns a pointer to
+-static data.
+-
+-
+-11. Stepping Through a List of Results
+-
+-The ldap_first_message() and ldap_next_message() routines are used to
+-step through the list of messages in a result chain returned by
+-ldap_result(). For search operations, the result chain may actually
+-include referral messages, entry messages, and result messages.
+-ldap_count_messages() is used to count the number of messages returned.
+-The ldap_msgtype() function, described above, can be used to distinguish
+-between the different message types.
+-
+- LDAPMessage *ldap_first_message( LDAP *ld, LDAPMessage *res );
+-
+- LDAPMessage *ldap_next_message( LDAP *ld, LDAPMessage *msg );
+-
+- int ldap_count_messages( LDAP *ld, LDAPMessage *res );
+-
+-Parameters are:
+-
+-
+-
+-
+-Expires: January 1998 [Page 33]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-ld The session handle.
+-
+-res The result chain, as obtained by a call to one of the synchronous
+- search routines or ldap_result().
+-
+-msg The message returned by a previous call to ldap_first_message()
+- or ldap_next_message().
+-
+-ldap_first_message() and ldap_next_message() will return NULL when no
+-more messages exist in the result set to be returned. NULL is also
+-returned if an error occurs while stepping through the entries, in which
+-case the error parameters in the session handle ld will be set to indi-
+-cate the error.
+-
+-ldap_count_messages() returns the number of messages contained in a
+-chain of results. It can also be used to count the number of messages
+-that remain in a chain if called with a message, entry, or reference
+-returned by ldap_first_message(), ldap_next_message(),
+-ldap_first_entry(), ldap_next_entry(), ldap_first_reference(),
+-ldap_next_reference().
+-
+-
+-12. Parsing Search Results
+-
+-The following calls are used to parse the entries and references
+-returned by ldap_search() and friends. These results are returned in an
+-opaque structure that should only be accessed by calling the routines
+-described below. Routines are provided to step through the entries and
+-references returned, step through the attributes of an entry, retrieve
+-the name of an entry, and retrieve the values associated with a given
+-attribute in an entry.
+-
+-
+-12.1. Stepping Through a List of Entries
+-
+-The ldap_first_entry() and ldap_next_entry() routines are used to step
+-through and retrieve the list of entries from a search result chain.
+-The ldap_first_reference() and ldap_next_reference() routines are used
+-to step through and retrieve the list of continuation references from a
+-search result chain. ldap_count_entries() is used to count the number
+-of entries returned. ldap_count_references() is used to count the number
+-of references returned.
+-
+- LDAPMessage *ldap_first_entry( LDAP *ld, LDAPMessage *res );
+-
+- LDAPMessage *ldap_next_entry( LDAP *ld, LDAPMessage *entry );
+-
+- LDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *res );
+-
+-
+-
+-Expires: January 1998 [Page 34]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- LDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *ref );
+-
+- int ldap_count_entries( LDAP *ld, LDAPMessage *res );
+-
+- int ldap_count_references( LDAP *ld, LDAPMessage *res );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-res The search result, as obtained by a call to one of the synchro-
+- nous search routines or ldap_result().
+-
+-entry The entry returned by a previous call to ldap_first_entry() or
+- ldap_next_entry().
+-
+-ldap_first_entry() and ldap_next_entry() will return NULL when no more
+-entries or references exist in the result set to be returned. NULL is
+-also returned if an error occurs while stepping through the entries, in
+-which case the error parameters in the session handle ld will be set to
+-indicate the error.
+-
+-ldap_count_entries() returns the number of entries contained in a chain
+-of entries. It can also be used to count the number of entries that
+-remain in a chain if called with a message, entry or reference returned
+-by ldap_first_message(), ldap_next_message(), ldap_first_entry(),
+-ldap_next_entry(), ldap_first_reference(), ldap_next_reference().
+-
+-ldap_count_references() returns the number of references contained in a
+-chain of search results. It can also be used to count the number of
+-references that remain in a chain.
+-
+-
+-12.2. Stepping Through the Attributes of an Entry
+-
+-The ldap_first_attribute() and ldap_next_attribute() calls are used to
+-step through the list of attribute types returned with an entry.
+-
+- char *ldap_first_attribute(
+- LDAP *ld,
+- LDAPMessage *entry,
+- BerElement **ptr
+- );
+-
+- char *ldap_next_attribute(
+- LDAP *ld,
+- LDAPMessage *entry,
+- BerElement *ptr
+-
+-
+-
+-Expires: January 1998 [Page 35]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- );
+-
+- void ldap_memfree( char *mem );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-entry The entry whose attributes are to be stepped through, as returned
+- by ldap_first_entry() or ldap_next_entry().
+-
+-ptr In ldap_first_attribute(), the address of a pointer used inter-
+- nally to keep track of the current position in the entry. In
+- ldap_next_attribute(), the pointer returned by a previous call to
+- ldap_first_attribute().
+-
+-mem A pointer to memory allocated by the LDAP library, such as the
+- attribute names returned by ldap_first_attribute() and
+- ldap_next_attribute, or the DN returned by ldap_get_dn().
+-
+-ldap_first_attribute() and ldap_next_attribute() will return NULL when
+-the end of the attributes is reached, or if there is an error, in which
+-case the error parameters in the session handle ld will be set to indi-
+-cate the error.
+-
+-Both routines return a pointer to an allocated buffer containing the
+-current attribute name. This should be freed when no longer in use by
+-calling ldap_memfree().
+-
+-ldap_first_attribute() will allocate and return in ptr a pointer to a
+-BerElement used to keep track of the current position. This pointer
+-should be passed in subsequent calls to ldap_next_attribute() to step
+-through the entry's attributes. After a set of calls to
+-ldap_first_attribute() and ldap_next_attibute(), if ptr is non-NULL, it
+-should be freed by calling ldap_ber_free( ptr, 0 ). Note that it is very
+-important to pass the second parameter as 0 (zero) in this call.
+-
+-The attribute names returned are suitable for passing in a call to
+-ldap_get_values() and friends to retrieve the associated values.
+-
+-
+-12.3. Retrieving the Values of an Attribute
+-
+-ldap_get_values() and ldap_get_values_len() are used to retrieve the
+-values of a given attribute from an entry. ldap_count_values() and
+-ldap_count_values_len() are used to count the returned values.
+-ldap_value_free() and ldap_value_free_len() are used to free the values.
+-
+-
+-
+-
+-Expires: January 1998 [Page 36]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- char **ldap_get_values(
+- LDAP *ld,
+- LDAPMessage *entry,
+- char *attr
+- );
+-
+- struct berval **ldap_get_values_len(
+- LDAP *ld,
+- LDAPMessage *entry,
+- char *attr
+- );
+-
+- int ldap_count_values( char **vals );
+-
+- int ldap_count_values_len( struct berval **vals );
+-
+- int ldap_value_free( char **vals );
+-
+- int ldap_value_free_len( struct berval **vals );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-entry The entry from which to retrieve values, as returned by
+- ldap_first_entry() or ldap_next_entry().
+-
+-attr The attribute whose values are to be retrieved, as returned by
+- ldap_first_attribute() or ldap_next_attribute(), or a caller-
+- supplied string (e.g., "mail").
+-
+-vals The values returned by a previous call to ldap_get_values() or
+- ldap_get_values_len().
+-
+-Two forms of the various calls are provided. The first form is only
+-suitable for use with non-binary character string data. The second _len
+-form is used with any kind of data.
+-
+-Note that the values returned are dynamically allocated and should be
+-freed by calling either ldap_value_free() or ldap_value_free_len() when
+-no longer in use.
+-
+-
+-12.4. Retrieving the name of an entry
+-
+-ldap_get_dn() is used to retrieve the name of an entry.
+-ldap_explode_dn() and ldap_explode_rdn() are used to break up a name
+-into its component parts. ldap_dn2ufn() is used to convert the name into
+-
+-
+-
+-Expires: January 1998 [Page 37]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-a more "user friendly" format.
+-
+- char *ldap_get_dn( LDAP *ld, LDAPMessage *entry );
+-
+- char **ldap_explode_dn( char *dn, int notypes );
+-
+- char **ldap_explode_rdn( char *rdn, int notypes );
+-
+- char *ldap_dn2ufn( char *dn );
+-
+-Parameters are:
+-
+-ld The session handle.
+-
+-entry The entry whose name is to be retrieved, as returned by
+- ldap_first_entry() or ldap_next_entry().
+-
+-dn The dn to explode, such as returned by ldap_get_dn().
+-
+-rdn The rdn to explode, such as returned in the components of the
+- array returned by ldap_explode_dn().
+-
+-notypes A boolean parameter, if non-zero indicating that the dn or rdn
+- components should have their type information stripped off
+- (i.e., "cn=Babs" would become "Babs").
+-
+-ldap_get_dn() will return NULL if there is some error parsing the dn,
+-setting error parameters in the session handle ld to indicate the error.
+-It returns a pointer to malloc'ed space that the caller should free by
+-calling ldap_memfree() when it is no longer in use. Note the format of
+-the DNs returned is given by [4].
+-
+-ldap_explode_dn() returns a NULL-terminated char * array containing the
+-RDN components of the DN supplied, with or without types as indicated by
+-the notypes parameter. The array returned should be freed when it is no
+-longer in use by calling ldap_value_free().
+-
+-ldap_explode_rdn() returns a NULL-terminated char * array containing the
+-components of the RDN supplied, with or without types as indicated by
+-the notypes parameter. The array returned should be freed when it is no
+-longer in use by calling ldap_value_free().
+-
+-ldap_dn2ufn() converts the DN into the user friendly format described in
+-[5]. The UFN returned is malloc'ed space that should be freed by a call
+-to ldap_memfree() when no longer in use.
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 38]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-13. Encoded ASN.1 Value Manipulation
+-
+-This section describes routines which may be used to encode and decode
+-BER-encoded ASN.1 values, which are often used inside of control and
+-extension values.
+-
+-With the exceptions of two new functions ber_flatten() and ber_init(),
+-these functions are compatible with the University of Michigan LDAP 3.3
+-implementation of BER.
+-
+-
+-13.1. General
+-
+- struct berval {
+- unsigned long bv_len;
+- char *bv_val;
+- };
+-
+-A struct berval contains a sequence of bytes and an indication of its
+-length. The bv_val is not null terminated. bv_len must always be a
+-nonnegative number. Applications may allocate their own berval struc-
+-tures.
+-
+- typedef struct berelement {
+- /* opaque */
+- } BerElement;
+-
+-The BerElement structure contains not only a copy of the encoded value,
+-but also state information used in encoding or decoding. Applications
+-cannot allocate their own BerElement structures. The internal state is
+-neither thread-specific nor locked, so two threads should not manipulate
+-the same BerElement value simultaneously.
+-
+-A single BerElement value cannot be used for both encoding and decoding.
+-
+- void ber_bvfree ( struct berval *bv);
+-
+-ber_bvfree() frees a berval returned from this API. Both the bv->bv_val
+-string and the berval itself are freed. Applications should not use
+-ber_bvfree() with bervals which the application has allocated.
+-
+- void ber_bvecfree ( struct berval **bv );
+-
+-ber_bvecfree() frees an array of bervals returned from this API. Each
+-of the bervals in the array are freed using ber_bvfree(), then the array
+-itself is freed.
+-
+- struct berval *ber_bvdup (struct berval *bv );
+-
+-
+-
+-Expires: January 1998 [Page 39]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-ber_bvdup() returns a copy of a berval. The bv_val field in the
+-returned berval points to a different area of memory as the bv_val field
+-in the argument berval. The null pointer is returned on error (e.g. out
+-of memory).
+-
+- void ber_free ( BerElement *ber, int fbuf );
+-
+-ber_free() frees a BerElement which is returned from the API calls
+-ber_alloc_t() or ber_init(). Each BerElement must be freed by the
+-caller. The second argument fbuf should always be set to 1.
+-
+-
+-13.2. Encoding
+-
+- BerElement *ber_alloc_t(int options);
+-
+-ber_alloc_t() constructs and returns BerElement. The null pointer is
+-returned on error. The options field contains a bitwise-or of options
+-which are to be used when generating the encoding of this BerElement.
+-One option is defined and must always be supplied:
+-
+- #define LBER_USE_DER 0x01
+-
+-When this option is present, lengths will always be encoded in the
+-minimum number of octets. Note that this option does not cause values
+-of sets and sequences to be rearranged in tag and byte order, so these
+-functions are not suitable for generating DER output as defined in X.509
+-and X.680.
+-
+-Unrecognized option bits are ignored.
+-
+-The BerElement returned by ber_alloc_t() is initially empty. Calls to
+-ber_printf() will append bytes to the end of the ber_alloc_t().
+-
+- int ber_printf(BerElement *ber, char *fmt, ... )
+-
+-The ber_printf() routine is used to encode a BER element in much the
+-same way that sprintf() works. One important difference, though, is
+-that state information is kept in the ber argument so that multiple
+-calls can be made to ber_printf() to append to the end of the BER ele-
+-ment. ber must be a pointer to a BerElement returned by ber_alloc_t().
+-ber_printf() interprets and formats its arguments according to the for-
+-mat string fmt. ber_printf() returns -1 if there is an error during
+-encoding. As with sprintf(), each character in fmt refers to an argu-
+-ment to ber_printf().
+-
+-The format string can contain the following format characters:
+-
+-
+-
+-
+-Expires: January 1998 [Page 40]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-'t' Tag. The next argument is an int specifying the tag to override
+- the next element to be written to the ber. This works across
+- calls. The int value must contain the tag class, constructed
+- bit, and tag value. The tag value must fit in a single octet
+- (tag value is less than 32). For example, a tag of "[3]" for a
+- constructed type is 0xA3.
+-
+-'b' Boolean. The next argument is an int, containing either 0 for
+- FALSE or 0xff for TRUE. A boolean element is output. If this
+- format character is not preceded by the 't' format modifier, the
+- tag 0x01 is used for the element.
+-
+-'i' Integer. The next argument is an int, containing the integer in
+- the host's byte order. An integer element is output. If this
+- format character is not preceded by the 't' format modifier, the
+- tag 0x02 is used for the element.
+-
+-'X' Bitstring. The next two arguments are a char * pointer to the
+- start of the bitstring, followed by an int containing the number
+- of bits in the bitstring. A bitstring element is output, in
+- primitive form. If this format character is not preceded by the
+- 't' format modifier, the tag 0x03 is used for the element.
+-
+-'n' Null. No argument is required. An ASN.1 NULL element is out-
+- put. If this format character is not preceded by the 't' format
+- modifier, the tag 0x05 is used for the element.
+-
+-'o' Octet string. The next two arguments are a char *, followed by
+- an int with the length of the string. The string may contain
+- null bytes and need not by null-terminated. An octet string
+- element is output, in primitive form. If this format character
+- is not preceded by the 't' format modifier, the tag 0x04 is used
+- for the element.
+-
+-'s' Octet string. The next argument is a char * pointing to a
+- null-terminated string. An octet string element in primitive
+- form is output, which does not include the trailing ' ' byte. If
+- this format character is not preceded by the 't' format modif-
+- ier, the tag 0x04 is used for the element.
+-
+-'v' Several octet strings. The next argument is a char **, an array
+- of char * pointers to null-terminated strings. The last element
+- in the array must be a null pointer. The octet strings do not
+- include the trailing SEQUENCE OF octet strings. The 't' format
+- modifier cannot be used with this format character.
+-
+-'V' Several octet strings. A null-terminated array of berval *'s is
+- supplied. Note that a construct like '{V}' is required to get an
+-
+-
+-
+-Expires: January 1998 [Page 41]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- actual SEQUENCE OF octet strings. The 't' format modifier cannot
+- be used with this format character.
+-
+-'{' Begin sequence. No argument is required. If this format char-
+- acter is not preceded by the 't' format modifier, the tag 0x30
+- is used.
+-
+-'}' End sequence. No argument is required. The 't' format modifier
+- cannot be used with this format character.
+-
+-'[' Begin set. No argument is required. If this format character
+- is not preceded by the 't' format modifier, the tag 0x31 is
+- used.
+-
+-']' End set. No argument is required. The 't' format modifier can-
+- not be used with this format character.
+-
+-Each use of a '{' format character must be matched by a '}' character,
+-either later in the format string, or in the format string of a subse-
+-quent call to ber_printf() for that BerElement. The same applies to the
+-'[' and
+-
+-Sequences and sets nest, and implementations of this API must maintain
+-internal state to be able to properly calculate the lengths.
+-
+- int ber_flatten (BerElement *ber, struct berval **bvPtr);
+-
+-The ber_flatten routine allocates a struct berval whose contents are a
+-BER encoding taken from the ber argument. The bvPtr pointer points to
+-the returned berval, which must be freed using ber_bvfree(). This rou-
+-tine returns 0 on success and -1 on error.
+-
+-The ber_flatten API call is not present in U-M LDAP 3.3.
+-
+-The use of ber_flatten on a BerElement in which all '{' and '}' format
+-modifiers have not been properly matched can result in a berval whose
+-contents are not a valid BER encoding.
+-
+-
+-13.3. Encoding Example
+-
+-The following is an example of encoding the following ASN.1 data type:
+-
+- Example1Request ::= SEQUENCE {
+- s OCTET STRING, -- must be printable
+- val1 INTEGER,
+- val2 [0] INTEGER DEFAULT 0
+- }
+-
+-
+-
+-Expires: January 1998 [Page 42]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- int encode_example1(char *s,int val1,int val2,struct berval **bvPtr)
+- {
+- BerElement *ber;
+- int rc;
+-
+- ber = ber_alloc_t(LBER_USE_DER);
+-
+- if (ber == NULL) return -1;
+-
+- if (ber_printf(ber,"{si",s,val1) == -1) {
+- ber_free(ber,1);
+- return -1;
+- }
+-
+- if (val2 != 0) {
+- if (ber_printf(ber,"ti",0x80,val2) == -1) {
+- ber_free(ber,1);
+- return -1;
+- }
+- }
+-
+- if (ber_printf(ber,"}") == -1) {
+- ber_free(ber,1);
+- return -1;
+- }
+-
+- rc = ber_flatten(ber,bvPtr);
+- ber_free(ber,1);
+- return -1;
+- }
+-
+-
+-13.4. Decoding
+-
+-The following two symbols are available to applications.
+-
+- #define LBER_ERROR 0xffffffffL
+- #define LBER_DEFAULT 0xffffffffL
+-
+- BerElement *ber_init (struct berval *bv);
+-
+-The ber_init functions construct BerElement and returns a new BerElement
+-containing a copy of the data in the bv argument. ber_init returns the
+-null pointer on error.
+-
+- unsigned long ber_scanf (BerElement *ber, char *fmt, ... );
+-
+-The ber_scanf() routine is used to decode a BER element in much the same
+-
+-
+-
+-Expires: January 1998 [Page 43]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-way that sscanf() works. One important difference, though, is that some
+-state information is kept with the ber argument so that multiple calls
+-can be made to ber_scanf() to sequentially read from the BER element.
+-The ber argument must be a pointer to a BerElement returned by
+-ber_init(). ber_scanf interprets the bytes according to the format
+-string fmt, and stores the results in its additional arguments.
+-ber_scanf() returns LBER_ERROR on error, and a nonnegative number on
+-success.
+-
+-The format string contains conversion specifications which are used to
+-direct the interpretation of the BER element. The format string can
+-contain the following characters:
+-
+-'a' Octet string. A char ** argument should be supplied. Memory is
+- allocated, filled with the contents of the octet string, null-
+- terminated, and the pointer to the string is stored in the argu-
+- ment. The returned value must be freed using ldap_memfree. The
+- tag of the element must indicate the primitive form (constructed
+- strings are not supported) but is otherwise ignored and dis-
+- carded during the decoding. This format cannot be used with
+- octet strings which could contain null bytes.
+-
+-'O' Octet string. A struct berval ** argument should be supplied,
+- which upon return points to a allocated struct berval containing
+- the octet string and its length. ber_bvfree() must be called to
+- free the allocated memory. The tag of the element must indicate
+- the primitive form (constructed strings are not supported) but
+- is otherwise ignored during the decoding.
+-
+-'b' Boolean. A pointer to an int should be supplied. The int value
+- stored will be 0 for FALSE or nonzero for TRUE. The tag of the
+- element must indicate the primitive form but is otherwise
+- ignored during the decoding.
+-
+-'i' Integer. A pointer to an int should be supplied. The int value
+- stored will be in host byte order. The tag of the element must
+- indicate the primitive form but is otherwise ignored during the
+- decoding. ber_scanf() will return an error if the integer can-
+- not be stored in an int.
+-
+-'B' Bitstring. A char ** argument should be supplied which will
+- point to the allocated bits, followed by an unsigned long *
+- argument, which will point to the length (in bits) of the bit-
+- string returned. ldap_memfree must be called to free the bit-
+- string. The tag of the element must indicate the primitive form
+- (constructed bitstrings are not supported) but is otherwise
+- ignored during the decoding.
+-
+-
+-
+-
+-Expires: January 1998 [Page 44]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-'n' Null. No argument is required. The element is simply skipped
+- if it is recognized as a zero-length element. The tag is
+- ignored.
+-
+-'v' Several octet strings. A char *** argument should be supplied,
+- which upon return points to a allocated null-terminated array of
+- char *'s containing the octet strings. NULL is stored if the
+- sequence is empty. ldap_memfree must be called to free each
+- element of the array and the array itself. The tag of the
+- sequence and of the octet strings are ignored.
+-
+-'V' Several octet strings (which could contain null bytes). A
+- struct berval *** should be supplied, which upon return points
+- to a allocated null-terminated array of struct berval *'s con-
+- taining the octet strings and their lengths. NULL is stored if
+- the sequence is empty. ber_bvecfree() can be called to free the
+- allocated memory. The tag of the sequence and of the octet
+- strings are ignored.
+-
+-'x' Skip element. The next element is skipped. No argument is
+- required.
+-
+-'{' Begin sequence. No argument is required. The initial sequence
+- tag and length are skipped.
+-
+-'}' End sequence. No argument is required.
+-
+-'[' Begin set. No argument is required. The initial set tag and
+- length are skipped.
+-
+-']' End set. No argument is required.
+-
+- unsigned long ber_peek_tag (BerElement *ber, unsigned long *lenPtr);
+-
+-ber_peek_tag() returns the tag of the next element to be parsed in the
+-BerElement argument. The length of this element is stored in the
+-*lenPtr argument. LBER_DEFAULT is returned if there is no further data
+-to be read. The ber argument is not modified.
+-
+- unsigned long ber_skip_tag (BerElement *ber, unsigned long *lenPtr);
+-
+-ber_skip_tag() is similar to ber_peek_tag(), except that the state
+-pointer in the BerElement argument is advanced past the first tag and
+-length, and is pointed to the value part of the next element. This rou-
+-tine should only be used with constructed types and situations when a
+-BER encoding is used as the value of an OCTET STRING. The length of the
+-value is stored in *lenPtr.
+-
+-
+-
+-
+-Expires: January 1998 [Page 45]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- unsigned long ber_first_element(BerElement *ber,
+- unsigned long *lenPtr, char **opaquePtr);
+-
+- unsigned long ber_next_element (BerElement *ber,
+- unsigned long *lenPtr, char *opaque);
+-
+-ber_first_element() and ber_next_element() are used to traverse a SET,
+-SET OF, SEQUENCE or SEQUENCE OF data value. ber_first_element() calls
+-ber_skip_tag(), stores internal information in *lenPtr and *opaquePtr,
+-and calls ber_peek_tag() for the first element inside the constructed
+-value. LBER_DEFAULT is returned if the constructed value is empty.
+-ber_next_element() positions the state at the start of the next element
+-in the constructed type. LBER_DEFAULT is returned if there are no
+-further values.
+-
+-The len and opaque values should not be used by applications other than
+-as arguments to ber_next_element(), as shown in the example below.
+-
+-
+-13.5. Decoding Example
+-
+-The following is an example of decoding an ASN.1 data type:
+-
+- Example2Request ::= SEQUENCE {
+- dn OCTET STRING, -- must be printable
+- scope ENUMERATED { b (0), s (1), w (2) },
+- ali ENUMERATED { n (0), s (1), f (2), a (3) },
+- size INTEGER,
+- time INTEGER,
+- tonly BOOLEAN,
+- attrs SEQUENCE OF OCTET STRING, -- must be printable
+- [0] SEQUENCE OF SEQUENCE {
+- type OCTET STRING -- must be printable,
+- crit BOOLEAN DEFAULT FALSE,
+- value OCTET STRING
+- } OPTIONAL }
+-
+- #define LDAP_TAG_CONTROL_LIST 0xA0L /* context specific cons 0 */
+-
+- int decode_example2(struct berval *bv)
+- {
+- BerElement *ber;
+- unsigned long len;
+- int scope, ali, size, time, tonly;
+- char *dn = NULL, **attrs = NULL;
+- int res,i,rc = 0;
+-
+- ber = ber_init(bv);
+-
+-
+-
+-Expires: January 1998 [Page 46]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- if (ber == NULL) {
+- printf("ERROR ber_init failed0);
+- return -1;
+- }
+-
+- res = ber_scanf(ber,"{aiiiiib{v}",&dn,&scope,&ali,
+- &size,&time,&tonly,&attrs);
+-
+- if (res == -1) {
+- printf("ERROR ber_scanf failed0);
+- ber_free(ber,1);
+- return -1;
+- }
+-
+- /* *** use dn */
+- ldap_memfree(dn);
+-
+- for (i = 0; attrs != NULL && attrs[i] != NULL; i++) {
+- /* *** use attrs[i] */
+- ldap_memfree(attrs[i]);
+- }
+- ldap_memfree(attrs);
+-
+- if (ber_peek_tag(ber,&len) == LDAP_TAG_CONTROL_LIST) {
+- char *opaque;
+- unsigned long tag;
+-
+- for (tag = ber_first_element(ber,&len,&opaque);
+- tag != LBER_DEFAULT;
+- tag = ber_next_element (ber,&len,opaque)) {
+-
+- unsigned long ttag, tlen;
+- char *type;
+- int crit;
+- struct berval *value;
+-
+- if (ber_scanf(ber,"{a",&type) == LBER_ERROR) {
+- printf("ERROR cannot parse type0);
+- break;
+- }
+- /* *** use type */
+- ldap_memfree(type);
+-
+- ttag = ber_peek_tag(ber,&tlen);
+- if (ttag == 0x01) { /* boolean */
+- if (ber_scanf(ber,"b",
+- &crit) == LBER_ERROR) {
+- printf("ERROR cannot parse crit0);
+-
+-
+-
+-Expires: January 1998 [Page 47]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- rc = -1;
+- break;
+- }
+- } else if (ttag == 0x04) { /* octet string */
+- crit = 0;
+- } else {
+- printf("ERROR extra field in controls0);
+- break;
+- }
+-
+- if (ber_scanf(ber,"O}",&value) == LBER_ERROR) {
+- printf("ERROR cannot parse value0);
+- rc = -1;
+- break;
+- }
+- /* *** use value */
+- ldap_bvfree(value);
+- }
+- }
+-
+- ber_scanf(ber,"}");
+-
+- ber_free(ber,1);
+-
+- return rc;
+- }
+-
+-
+-
+-14. Security Considerations
+-
+-LDAPv2 supports security through protocol-level authentication using
+-clear-text passwords. LDAPv3 adds support for SASL [8] (Simple Authen-
+-tication Security Layer) methods. LDAPv3 also supports operation over a
+-secure transport layer using Transport Layer Security TLS [8]. Readers
+-are referred to the protocol documents for discussion of related secu-
+-rity considerations.
+-
+-Implementations of this API should be cautious when handling authentica-
+-tion credentials. In particular, keeping long-lived copies of creden-
+-tials without the application's knowledge is discouraged.
+-
+-
+-15. Acknowledgements
+-
+-Many members of the IETF ASID working group as well as members of the
+-Internet at large have provided useful comments and suggestions that
+-have been incorporated into this revision.
+-
+-
+-
+-Expires: January 1998 [Page 48]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-This original material upon which this revision is based was based upon
+-work supported by the National Science Foundation under Grant No. NCR-
+-9416667.
+-
+-
+-16. Bibliography
+-
+-[1] The Directory: Selected Attribute Syntaxes. CCITT, Recommendation
+- X.520.
+-
+-[2] M. Wahl, A. Coulbeck, T. Howes, S. Kille, W. Yeong, C. Robbins,
+- "Lightweight Directory Access Protocol Attribute Syntax Defini-
+- tions", INTERNET-DRAFT ,
+- 11 July 1997.
+-
+-[3] T. Howes, "A String Representation of LDAP Search Filters,"
+- INTERNET-DRAFT , May 1997.
+-
+-[4] S. Kille, M. Wahl, "A UTF-8 String Representation of Distinguished
+- Names", INTERNET-DRAFT , 29 April
+- 1997.
+-
+-[5] S. Kille, "Using the OSI Directory to Achieve User Friendly Nam-
+- ing," RFC 1781, March 1995.
+-
+-[6] M. Wahl, T. Howes, S. Kille, "Lightweight Directory Access Protocol
+- (v3)", INTERNET-DRAFT , 11
+- July 1997.
+-
+-[7] A. Herron, T. Howes, M. Wahl, "LDAP Control Extension for Server
+- Side Sorting of Search Result," INTERNET-DRAFT , 16 April 1997.
+-
+-[8] J. Meyers, "Simple Authentication and Security Layer", INTERNET-
+- DRAFT , April 1997.
+-
+-[9] "Lightweight Directory Access Protocol (v3) Extension for Transport
+- Layer Security", INTERNET-DRAFT , June 1997.
+-
+-[10] "UTF-8, a transformation format of Unicode and ISO 10646", RFC
+- 2044, October 1996.
+-
+-[11] "IP Version 6 Addressing Architecture,", RFC 1884, December 1995.
+-
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 49]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-17. Author's Addresses
+-
+- Tim Howes
+- Netscape Communications Corp.
+- 501 E. Middlefield Rd., Mailstop MV068
+- Mountain View, CA 94043
+- USA
+- +1 415 937-3419
+- howes@netscape.com
+-
+-
+- Mark Smith
+- Netscape Communications Corp.
+- 501 E. Middlefield Rd., Mailstop MV068
+- Mountain View, CA 94043
+- USA
+- +1 415 937-3477
+- mcs@netscape.com
+-
+- Andy Herron
+- Microsoft Corp.
+- 1 Microsoft Way
+- Redmond, WA 98052
+- USA
+- +1 425 882-8080
+- andyhe@microsoft.com
+-
+- Chris Weider
+- Microsoft Corp.
+- 1 Microsoft Way
+- Redmond, WA 98052
+- USA
+- +1 425 882-8080
+- cweider@microsoft.com
+-
+- Mark Wahl
+- Critical Angle Inc.
+- 4815 W Braker Lane #502-385
+- Austin, TX 78759
+- USA
+- M.Wahl@critical-angle.com
+-
+-
+-18. Appendix A - Sample LDAP API Code
+-
+- #include
+-
+- main()
+-
+-
+-
+-Expires: January 1998 [Page 50]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- {
+- LDAP *ld;
+- LDAPMessage *res, *e;
+- int i;
+- char *a, *dn;
+- BerElement *ptr;
+- char **vals;
+-
+- /* open an LDAP session */
+- if ( (ld = ldap_init( "dotted.host.name", LDAP_PORT )) == NULL )
+- exit( 1 );
+-
+- /* authenticate as nobody */
+- if ( ldap_simple_bind_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
+- ldap_perror( ld, "ldap_simple_bind_s" );
+- exit( 1 );
+- }
+-
+- /* search for entries with cn of "Babs Jensen", return all attrs */
+- if ( ldap_search_s( ld, "o=University of Michigan, c=US",
+- LDAP_SCOPE_SUBTREE, "(cn=Babs Jensen)", NULL, 0, &res )
+- != LDAP_SUCCESS ) {
+- ldap_perror( ld, "ldap_search_s" );
+- exit( 1 );
+- }
+-
+- /* step through each entry returned */
+- for ( e = ldap_first_entry( ld, res ); e != NULL;
+- e = ldap_next_entry( ld, e ) ) {
+- /* print its name */
+- dn = ldap_get_dn( ld, e );
+- printf( "dn: %s\n", dn );
+- ldap_memfree( dn );
+-
+- /* print each attribute */
+- for ( a = ldap_first_attribute( ld, e, &ptr ); a != NULL;
+- a = ldap_next_attribute( ld, e, ptr ) ) {
+- printf( "attribute: %s\n", a );
+-
+- /* print each value */
+- vals = ldap_get_values( ld, e, a );
+- for ( i = 0; vals[i] != NULL; i++ ) {
+- printf( "value: %s\n", vals[i] );
+- }
+- ldap_value_free( vals );
+- }
+- if ( ptr != NULL ) {
+- ldap_ber_free( ptr, 0 );
+-
+-
+-
+-Expires: January 1998 [Page 51]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+- }
+- }
+- /* free the search results */
+- ldap_msgfree( res );
+-
+- /* close and free connection resources */
+- ldap_unbind( ld );
+- }
+-
+-
+-
+-19. Appendix B - Outstanding Issues
+-
+-
+-19.1. Support for multithreaded applications
+-
+-In order to support multithreaded applications in a platform-independent
+-way, some additions to the LDAP API are needed. Different implementors
+-have taken different paths to solve this problem in the past. A common
+-set of thread-related API calls must be defined so that application
+-developers are not unduly burdened. These will be added to a future
+-revision of this specification.
+-
+-
+-19.2. Using Transport Layer Security (TLS)
+-
+-The API calls used to support TLS must be specified. They will be added
+-to a future revision of this specification.
+-
+-
+-19.3. Client control for chasing referrals
+-
+-A client control has been defined that can be used to specify on a per-
+-operation basis whether references and external referrals are automati-
+-cally chased by the client library. This will be added to a future
+-revision of this specification.
+-
+-
+-19.4. Potential confusion between hostname:port and IPv6 addresses
+-
+-String representations of IPv6 network addresses [11] can contain colon
+-characters. The ldap_init() call is specified to take strings of the
+-form "hostname:port" or "ipaddress:port". If IPv6 addresses are used,
+-the latter could be ambiguous. A future revision of this specification
+-will resolve this issue.
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 52]
+-
+-C LDAP API The C LDAP Application Program Interface 29 July 1997
+-
+-
+-19.5. Need to track SASL API standardization efforts
+-
+-If a standard Simple Authentication and Security Layer API is defined,
+-it may be necessary to modify the LDAP API to accommodate it.
+-
+-
+-19.6. Support for character sets other than UTF-8?
+-
+-Some application developers would prefer to pass string data using a
+-character set other than UTF-8. This could be accommodated by adding a
+-new option to ldap_set_option() that supports choosing a character set.
+-If this feature is added, the number of different character sets sup-
+-ported should definitely be minimized.
+-
+-
+-19.7. Use of UTF-8 with LDAPv2 servers
+-
+-Strings are always passed as UTF-8 in this API but LDAP version 2
+-servers do not support the full range of UTF-8 characters. The expected
+-behavior of this API when using LDAP version 2 with unsupported charac-
+-ters should be specified.
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-Expires: January 1998 [Page 53]
+-
+-
+-
+-1. Status of this Memo............................................1
+-2. Introduction...................................................1
+-3. Overview of the LDAP Model.....................................2
+-4. Overview of LDAP API Use.......................................3
+-5. Common Data Structures.........................................4
+-6. LDAP Error Codes...............................................5
+-7. Performing LDAP Operations.....................................6
+-7.1. Initializing an LDAP Session................................6
+-7.2. LDAP Session Handle Options.................................7
+-7.3. Working with controls.......................................10
+-7.4. Authenticating to the directory.............................11
+-7.5. Closing the session.........................................13
+-7.6. Searching...................................................13
+-7.7. Reading an Entry............................................17
+-7.8. Listing the Children of an Entry............................17
+-7.9. Comparing a Value Against an Entry..........................17
+-7.10. Modifying an entry..........................................19
+-7.11. Modifying the Name of an Entry..............................21
+-7.12. Adding an entry.............................................23
+-7.13. Deleting an entry...........................................25
+-7.14. Extended Operations.........................................26
+-8. Abandoning An Operation........................................28
+-9. Obtaining Results and Peeking Inside LDAP Messages.............29
+-10. Handling Errors and Parsing Results............................31
+-11. Stepping Through a List of Results.............................33
+-12. Parsing Search Results.........................................34
+-12.1. Stepping Through a List of Entries..........................34
+-12.2. Stepping Through the Attributes of an Entry.................35
+-12.3. Retrieving the Values of an Attribute.......................36
+-12.4. Retrieving the name of an entry.............................37
+-13. Encoded ASN.1 Value Manipulation...............................39
+-13.1. General.....................................................39
+-13.2. Encoding....................................................40
+-13.3. Encoding Example............................................42
+-13.4. Decoding....................................................43
+-13.5. Decoding Example............................................46
+-14. Security Considerations........................................48
+-15. Acknowledgements...............................................48
+-16. Bibliography...................................................49
+-17. Author's Addresses.............................................50
+-18. Appendix A - Sample LDAP API Code..............................50
+-19. Appendix B - Outstanding Issues................................52
+-19.1. Support for multithreaded applications......................52
+-19.2. Using Transport Layer Security (TLS)........................52
+-19.3. Client control for chasing referrals........................52
+-19.4. Potential confusion between hostname:port and IPv6 addresses52
+-19.5. Need to track SASL API standardization efforts..............53
+-19.6. Support for character sets other than UTF-8?................53
+-19.7. Use of UTF-8 with LDAPv2 servers............................53
+-
+-
+-
+-
+-
+-
+-
+-
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlando/package.mk rabbitmq-server-2.8.4/plugins-src/erlando/package.mk
--- rabbitmq-server-2.7.1/plugins-src/erlando/package.mk 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlando/package.mk 2012-06-22 16:03:48.000000000 +0000
@@ -1,2 +1 @@
STANDALONE_TEST_COMMANDS:=test_do:test() test_cut:test() test_import_as:test()
-
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlando/README.md rabbitmq-server-2.8.4/plugins-src/erlando/README.md
--- rabbitmq-server-2.7.1/plugins-src/erlando/README.md 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlando/README.md 2012-06-22 16:03:48.000000000 +0000
@@ -278,7 +278,8 @@
comma(foo(),
fun (A) -> comma(bar(A, dog),
- fun (B) -> ok end)).
+ fun (B) -> ok end)
+ end).
Thus the function `comma/2` takes all results from the previous
expression, and controls how and whether they are passed to the next
@@ -303,7 +304,8 @@
Monad:'>>='(foo(),
fun (A) -> Monad:'>>='(bar(A, dog),
- fun (B) -> ok end)).
+ fun (B) -> ok end)
+ end).
There is no intention that this latter form is any more readable than
the `comma/2` form - it is not. However, it should be clear that the
@@ -624,4 +626,4 @@
The Original Code is Erlando.
The Initial Developer of the Original Code is VMware, Inc.
-Copyright (c) 2011-2011 VMware, Inc. All rights reserved.
+Copyright (c) 2011-2012 VMware, Inc. All rights reserved.
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlando/src/monad.erl rabbitmq-server-2.8.4/plugins-src/erlando/src/monad.erl
--- rabbitmq-server-2.7.1/plugins-src/erlando/src/monad.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlando/src/monad.erl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is Erlando.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2011-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2011-2012 VMware, Inc. All rights reserved.
%%
-module(monad).
@@ -39,8 +39,10 @@
Y]).
sequence(Monad, Xs) ->
- lists:foldr(fun (X, Acc) ->
- do([Monad || E <- X,
- Es <- Acc,
- return([E|Es])])
- end, Monad:return([]), Xs).
+ sequence(Monad, Xs, []).
+
+sequence(Monad, [], Acc) ->
+ do([Monad || return(lists:reverse(Acc))]);
+sequence(Monad, [X|Xs], Acc) ->
+ do([Monad || E <- X,
+ sequence(Monad, Xs, [E|Acc])]).
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlando/test/erlando_test.erl rabbitmq-server-2.8.4/plugins-src/erlando/test/erlando_test.erl
--- rabbitmq-server-2.7.1/plugins-src/erlando/test/erlando_test.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlando/test/erlando_test.erl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is Erlando.
%%
%% The Initial Developer of the Original Code is Alex Kropivny.
-%% Copyright (c) 2011-2011 Alex Kropivny; VMware, Inc.
+%% Copyright (c) 2011-2012 Alex Kropivny; VMware, Inc.
%% All rights reserved.
%%
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlando/test/src/test_do.erl rabbitmq-server-2.8.4/plugins-src/erlando/test/src/test_do.erl
--- rabbitmq-server-2.7.1/plugins-src/erlando/test/src/test_do.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlando/test/src/test_do.erl 2012-06-22 16:03:48.000000000 +0000
@@ -11,7 +11,7 @@
%% The Original Code is Erlando.
%%
%% The Initial Developer of the Original Code is VMware, Inc.
-%% Copyright (c) 2011-2011 VMware, Inc. All rights reserved.
+%% Copyright (c) 2011-2012 VMware, Inc. All rights reserved.
%%
-module(test_do).
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627.hrl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627.hrl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627.hrl 2012-06-22 16:03:48.000000000 +0000
@@ -1,6 +1,6 @@
%% JSON - RFC 4627 - for Erlang
%%---------------------------------------------------------------------------
-%% Copyright (c) 2007-2010 Tony Garnock-Jones
+%% Copyright (c) 2007-2010, 2011, 2012 Tony Garnock-Jones
%% Copyright (c) 2007-2010 LShift Ltd.
%%
%% Permission is hereby granted, free of charge, to any person
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627_jsonrpc.hrl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627_jsonrpc.hrl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627_jsonrpc.hrl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/include/rfc4627_jsonrpc.hrl 2012-06-22 16:03:48.000000000 +0000
@@ -1,6 +1,6 @@
%% JSON-RPC for Erlang
%%---------------------------------------------------------------------------
-%% Copyright (c) 2007-2010 Tony Garnock-Jones
+%% Copyright (c) 2007-2010, 2011, 2012 Tony Garnock-Jones
%% Copyright (c) 2007-2010 LShift Ltd.
%%
%% Permission is hereby granted, free of charge, to any person
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/Makefile rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/Makefile
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/Makefile 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/Makefile 2012-06-22 16:03:48.000000000 +0000
@@ -10,18 +10,27 @@
SIGNING_KEY_ID=F8D7D525
VERSION=HEAD
PACKAGE_NAME=rfc4627_jsonrpc
-EZ_NAME=$(PACKAGE_NAME).ez
-## The path to httpd.hrl has changed in OTP R14A and newer. Detect the
-## change, and supply a compile-time macro definition to allow
-## rfc4627_jsonrpc_inets.erl to adapt to the new path.
-ifeq ($(shell test R14A \> $$(erl -noshell -eval 'io:format(erlang:system_info(otp_release)), halt().') && echo yes),yes)
-INETS_DEF=
+## The path to httpd.hrl changed at R14A, and then changed again
+## between OTP R14B and R14B01. Detect the changes, and supply
+## compile-time macro definitions to allow rfc4627_jsonrpc_inets.erl
+## to adapt to the new paths.
+ERLANG_OTP_RELEASE:=$(shell erl -noshell -eval 'io:format(erlang:system_info(otp_release)), halt().')
+$(info Building for OTP release $(ERLANG_OTP_RELEASE).)
+ifeq ($(shell test R14A \> $(ERLANG_OTP_RELEASE) && echo yes),yes)
+$(info Using path to INETS httpd.hrl that existed before R14A.)
+INETS_DEF=-Dinets_pre_r14a
+else
+ifeq ($(shell test R14B01 \> $(ERLANG_OTP_RELEASE) && echo yes),yes)
+$(info Using path to INETS httpd.hrl that existed before R14B01.)
+INETS_DEF=-Dinets_pre_r14b01
else
-INETS_DEF=-Dnew_inets
+$(info Using path to INETS httpd.hrl that exists in releases at and after R14B01.)
+INETS_DEF=
+endif
endif
-all: package
+all: $(TARGETS)
$(EBIN_DIR)/%.beam: $(SOURCE_DIR)/%.erl $(INCLUDES)
erlc $(ERLC_OPTS) $<
@@ -32,20 +41,10 @@
rm -rf $(DIST_DIR)
rm -rf $(DOC_DIR)
-dist: $(TARGETS) doc/index.html
+dist: all doc/index.html
mkdir -p $(DIST_DIR)
cp -r doc ebin include src test Makefile $(DIST_DIR)
-package: $(DIST_DIR)/$(PACKAGE).ez
-$(DIST_DIR)/$(PACKAGE).ez: $(TARGETS) dist
- mkdir -p $(DIST_DIR)/$(PACKAGE_NAME)
- cp -r $(DIST_DIR)/$(EBIN_DIR) $(DIST_DIR)/$(PACKAGE_NAME)
- cp -r $(DIST_DIR)/$(INCLUDE_DIR) $(DIST_DIR)/$(PACKAGE_NAME)
- (cd $(DIST_DIR); zip -r $(EZ_NAME) $(PACKAGE_NAME))
-
-echo-package-name:
- @echo $(PACKAGE_NAME)
-
distclean: clean
rm -rf $(DIST_DIR)
find . -name '*~' -exec rm {} \;
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/README.md rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/README.md
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/README.md 1970-01-01 00:00:00.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/README.md 2012-06-22 16:03:48.000000000 +0000
@@ -0,0 +1,120 @@
+# RFC4627 (JSON) and JSON-RPC for Erlang
+
+An implementation of JSON and JSON-RPC for Erlang.
+
+See
+[rfc4627.erl](http://tonyg.github.com/erlang-rfc4627/doc/rfc4627.html),
+the JSON/RFC4627 codec itself, to learn how to encode and decode JSON
+objects from Erlang code.
+
+## Providing and calling JSON-RPC services
+
+See
+[rfc4627\_jsonrpc.erl](http://tonyg.github.com/erlang-rfc4627/doc/rfc4627_jsonrpc.html),
+a JSON-RPC service registry and transport-neutral service method
+invocation mechanism, to learn how to expose Erlang processes as
+remotely-callable JSON-RPC services, and to learn how to invoke local
+JSON-RPC services from Erlang without the overhead of HTTP.
+
+## Exposing JSON-RPC services over HTTP
+
+### Using Inets
+
+See
+[rfc4627\_jsonrpc\_inets.erl](http://tonyg.github.com/erlang-rfc4627/doc/rfc4627_jsonrpc_inets.html),
+an Inets HTTP transport binding for JSON-RPC, to learn how to
+configure the Inets HTTP server to respond to JSON-RPC requests.
+
+### Using Mochiweb
+
+See
+[rfc4627\_jsonrpc\_mochiweb.erl](http://tonyg.github.com/erlang-rfc4627/doc/rfc4627_jsonrpc_mochiweb.html)
+to learn how to delegate incoming Mochiweb HTTP requests to the
+JSON-RPC service dispatcher.
+
+## Running the example test service that comes with the source code
+
+Included with the Erlang RFC4627 source code is a small Inets-based
+example that defines a "hello world"-style JSON-RPC service, and calls
+it from a Javascript program embedded in a web page.
+
+At your Erlang shell,
+
+ - after compiling the code with `make all test-compile`,
+ - when your current working directory contains the `test` directory
+ from the distribution, such that
+ `./test/server_root/conf/httpd.conf` exists,
+
+type `test_jsonrpc_inets:start_httpd().` (Don't forget the trailing
+"."!) This will
+
+ - start the inets httpd on port 5671 (from `./test/server_root/conf/httpd.conf`)
+ - allow HTTP access to JSON-RPC services via a url prefix of `/rpc` (again from `httpd.conf`)
+ - start the `rfc4627_jsonrpc` service registry
+ - register the test service
+
+Visiting in your browser should load a page
+that uses javascript to invoke the Erlang-implemented JSON-RPC test
+service.
+
+## Invoking JSON-RPC procedures from Javascript
+
+See the [relevant
+section](http://tonyg.github.com/erlang-rfc4627/doc/overview-summary.html#Invoking_JSON-RPC_procedures_from_Javascript)
+of the `edoc` documentation included with the source code.
+
+## References
+
+ - the [JSON RFC](http://www.ietf.org/rfc/rfc4627.txt).
+
+ - the [JSON-RPC
+ specification](http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html)
+ 1.1 working draft ([mirrored
+ locally](http://tonyg.github.com/erlang-rfc4627/doc/JSON-RPC-1-1-WD-20060807.html)).
+
+ - Joe Armstrong's
+ [message](http://erlang.org/pipermail/erlang-questions/2005-November/017805.html)
+ describing the basis of the JSON data type mapping that the
+ `rfc4627.erl` module uses.
+
+## Contributors
+
+The codebase and documentation was originally written between 2007 and
+2010 by Tony Garnock-Jones while at LShift in London. Since then, it
+has been maintained by Tony and enhanced with a few generous
+contributions from others:
+
+ - András Veres-Szentkirályi
+ - Eugene Volchek
+ - Simon MacMullen
+ - Andrey Khozov
+
+## Copyright and Licence
+
+Copyrights:
+
+ - Copyright © 2007-2010, 2011, 2012 Tony Garnock-Jones.
+ - Portions copyright 2007-2010 LShift Ltd.
+ - Portions copyright contributors to the project, listed above.
+
+License (MIT):
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use, copy,
+ modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/doc/overview.edoc.in rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/doc/overview.edoc.in
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/doc/overview.edoc.in 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/doc/overview.edoc.in 2012-06-22 16:03:48.000000000 +0000
@@ -1,7 +1,7 @@
@title RFC4627 (JSON) and JSON-RPC for Erlang
@author Tony Garnock-Jones
@author LShift Ltd.
-@copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+@copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
@version %%VERSION%%
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -32,7 +32,7 @@
%% @reference JSON in general
%%
%% @reference Joe Armstrong's
+%% href="http://erlang.org/pipermail/erlang-questions/2005-November/017805.html">
%% message describing the basis of the JSON data type mapping that
%% this module uses
%%
@@ -94,7 +94,7 @@
-export([unicode_decode/1, unicode_encode/1]).
-export([from_record/3, to_record/3]).
-export([hex_digit/1, digit_hex/1]).
--export([get_field/2, get_field/3, set_field/3]).
+-export([get_field/2, get_field/3, set_field/3, exclude_field/2]).
-export([equiv/2]).
%% @spec () -> string()
@@ -357,7 +357,7 @@
{done, Rest};
parse_codepoint([$\\, Key | Rest]) ->
parse_general_char(Key, Rest);
-parse_codepoint([X | Rest]) ->
+parse_codepoint([X | Rest]) ->
{ok, X, Rest}.
parse_general_char($b, Rest) -> {ok, 8, Rest};
@@ -526,6 +526,11 @@
element(Index, Fallback)
end | decode_record_fields(Values, Fallback, Index + 1, Rest)].
+%% @spec (JsonObject::jsonobj(), atom()) -> jsonobj()
+%% @doc Exclude a named field from a JSON "object".
+exclude_field({obj, Props}, Key) ->
+ {obj, lists:keydelete(Key, 1, Props)}.
+
%% @spec (JsonObject::jsonobj(), atom()) -> {ok, json()} | not_found
%% @doc Retrieves the value of a named field of a JSON "object".
get_field({obj, Props}, Key) ->
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_app.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_app.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_app.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_app.erl 2012-06-22 16:03:48.000000000 +0000
@@ -1,6 +1,6 @@
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -164,11 +164,6 @@
%% implementing process at all, the function object could process
%% the request without sending any messages at all.
%%
-%% At the moment, the `rfc4627_jsonrpc' service registry
-%% only allows registration of `gen_server'-based
-%% pid-style services; this restriction will be lifted in a future
-%% release.
-%%
%% To build a service descriptor object with a function handler
%% instead of a pid, call `rfc4627_jsonrpc:service/5'
%% instead of `rfc4627_jsonrpc:service/4':
@@ -180,7 +175,8 @@
%% my_handler(ProcedureNameBin, RequestInfo, Args) -> jsonrpc_response()
%% '''
%%
-%% The resulting service descriptor can be used directly with {@link
+%% The resulting service descriptor can be registered with {@link
+%% register_service/1} as well as used directly with {@link
%% invoke_service_method/8}.
%%
%% @type service() = #service{}. A service description record, as
@@ -220,7 +216,7 @@
-export([start/0, start_link/0]).
--export([lookup_service/1, register_service/2]).
+-export([lookup_service/1, register_service/1, register_service/2]).
-export([gen_object_name/0, system_describe/2]).
-export([jsonrpc_post/3, jsonrpc_post/4, invoke_service_method/8, expand_jsonrpc_reply/2]).
-export([error_response/2, error_response/3, service/4, service/5, proc/2]).
@@ -242,12 +238,18 @@
lookup_service(Service) ->
gen_server:call(?SERVICE, {lookup_service, Service}).
+%% @spec (service()) -> ok
+%% @doc Registers a JSON-RPC service.
+%%
+%% The name of the service is contained within its service record.
+register_service(ServiceDescription) ->
+ gen_server:call(?SERVICE, {register_service, ServiceDescription}).
+
%% @spec (pid(), service()) -> ok
%% @doc Registers a JSON-RPC service.
%%
%% The name of the service is contained within its service record.
register_service(Pid, ServiceDescription) ->
- %%error_logger:info_msg("Registering ~p as ~p", [Pid, ServiceDescription]),
gen_server:call(?SERVICE, {register_service, Pid, ServiceDescription}).
%% @spec () -> string()
@@ -498,7 +500,6 @@
invoke_service1(Handler, RequestInfo, ServiceProc, Args, Timeout).
invoke_service1(Handler, RequestInfo, #service_proc{name = Name, params = Params}, Args, Timeout) ->
- %%error_logger:info_msg("JSONRPC invoking ~p:~p(~p)", [Handler, Name, Args]),
case catch run_handler(Handler, Name, RequestInfo, coerce_args(Params, Args), Timeout) of
{'EXIT', {{function_clause, _}, _}} ->
error_response(404, "Undefined procedure", Name);
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_http.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_http.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_http.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_http.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -148,7 +148,7 @@
rfc4627:get_field(RequestObject, "id", null),
Object,
rfc4627:get_field(RequestObject, "method", undefined),
- rfc4627:get_field(RequestObject, "params", undefined)};
+ rfc4627:get_field(RequestObject, "params", [])};
_ ->
%% GET, presumably. We don't really care, here.
{get,
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_inets.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -88,13 +88,17 @@
-module(rfc4627_jsonrpc_inets).
-include("rfc4627_jsonrpc.hrl").
-%% The path to httpd.hrl has changed in OTP R14A and newer. Our
-%% Makefile detects the change for us, and supplies a compile-time
-%% macro definition to allow us to adapt to the new path.
--ifdef(new_inets).
+%% The path to httpd.hrl has changed with various OTP releases. Our
+%% Makefile detects the changes for us, and supplies compile-time
+%% macro definitions to allow us to adapt.
+-ifdef(inets_pre_r14a).
+-include_lib("inets/src/httpd.hrl").
+-else.
+-ifdef(inets_pre_r14b01).
-include_lib("inets/src/http_server/httpd.hrl").
-else.
--include_lib("inets/src/httpd.hrl").
+-include_lib("inets/include/httpd.hrl").
+-endif.
-endif.
-export([do/1, load/2]).
@@ -157,11 +161,13 @@
{ok, ResultEnc, ResponseInfo} ->
{obj, ResponseHeaderFields} =
rfc4627:get_field(ResponseInfo, "http_headers", {obj, []}),
+ StatusCode =
+ rfc4627:get_field(ResponseInfo, "http_status_code", 200),
Headers = [{K, binary_to_list(V)} || {K,V} <- ResponseHeaderFields],
{proceed, [{response, {response,
- [{code, 200},
+ [{code, StatusCode},
{content_length, integer_to_list(length(ResultEnc))},
- {content_type, "text/plain"}%rfc4627:mime_type()}
+ {content_type, rfc4627:mime_type()}
| Headers],
ResultEnc}} | OldData]}
end.
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_mochiweb.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_mochiweb.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_mochiweb.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_mochiweb.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -99,8 +99,19 @@
no_match ->
no_match;
{ok, ResultEnc, ResponseInfo} ->
+ DefaultType = rfc4627:mime_type(),
+ RespType = case Req:accepts_content_type(DefaultType) of
+ true -> DefaultType;
+ false ->
+ case Req:accepts_content_type("text/plain") of
+ true -> "text/plain";
+ false -> DefaultType
+ end
+ end,
{obj, ResponseHeaderFields} =
rfc4627:get_field(ResponseInfo, "http_headers", {obj, []}),
+ StatusCode =
+ rfc4627:get_field(ResponseInfo, "http_status_code", 200),
Headers = [{K, binary_to_list(V)} || {K,V} <- ResponseHeaderFields],
- {ok, {200, Headers ++ [{"Content-type", "text/plain"}], ResultEnc}}
+ {ok, {StatusCode, Headers ++ [{"Content-type", RespType}], ResultEnc}}
end.
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_registry.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_registry.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_registry.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_registry.erl 2012-06-22 16:03:48.000000000 +0000
@@ -2,7 +2,7 @@
%%---------------------------------------------------------------------------
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
@@ -53,7 +53,7 @@
%% @doc gen_server behaviour callback.
code_change(_OldVsn, State, _Extra) ->
- State.
+ {ok, State}.
%% @doc gen_server behaviour callback.
handle_call({lookup_service, Service}, _From, State) ->
@@ -64,6 +64,10 @@
{reply, ServiceRec, State}
end;
+handle_call({register_service, ServiceDescription = #service{name = Name}}, _From, State) ->
+ ets:insert(?TABLE_NAME, {{service, Name}, ServiceDescription}),
+ {reply, ok, State};
+
handle_call({register_service, Pid, ServiceDescription = #service{name = Name}}, _From, State) ->
SD = ServiceDescription#service{handler = {pid, Pid}},
erlang:monitor(process, Pid),
@@ -81,7 +85,7 @@
case ets:lookup(?TABLE_NAME, {service_pid, DownPid}) of
[] ->
{noreply, State};
- [ServiceName] ->
+ [{_, ServiceName}] ->
ets:delete(?TABLE_NAME, {service_pid, DownPid}),
ets:delete(?TABLE_NAME, {service, ServiceName}),
{noreply, State}
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_sup.erl rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_sup.erl
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_sup.erl 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/src/rfc4627_jsonrpc_sup.erl 2012-06-22 16:03:48.000000000 +0000
@@ -1,6 +1,6 @@
%% @author Tony Garnock-Jones
%% @author LShift Ltd.
-%% @copyright 2007-2010 Tony Garnock-Jones and 2007-2010 LShift Ltd.
+%% @copyright 2007-2010, 2011, 2012 Tony Garnock-Jones and 2007-2010 LShift Ltd.
%% @license
%%
%% Permission is hereby granted, free of charge, to any person
diff -Nru rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/test/server_root/htdocs/index.html rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/test/server_root/htdocs/index.html
--- rabbitmq-server-2.7.1/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/test/server_root/htdocs/index.html 2011-12-16 12:24:15.000000000 +0000
+++ rabbitmq-server-2.8.4/plugins-src/erlang-rfc4627-wrapper/erlang-rfc4627-git/test/server_root/htdocs/index.html 2012-06-22 16:03:48.000000000 +0000
@@ -12,6 +12,10 @@
Expect to see: "Starting" and "ErlangServer: Hello, world!", followed by false.
+
+ Click the following button to crash the server process:
+
+