4 commit f470b55b86fd59f31dd142d8cb55fe812265892e
5 Author: Bill Erickson <berick@esilibrary.com>
6 Date: Mon Feb 20 14:40:30 2012 -0500
8 Detect remote disconnect in Perl XMPP reader
10 When the jabber server severs the connection, it leaves the Perl libs
11 with a socket that perpetually appears ready for reading, but always
12 returns 0 bytes. This produces a loop in the client code. This change
13 detects this situation, logs an error, and throws an exception.
15 Signed-off-by: Bill Erickson <berick@esilibrary.com>
16 Signed-off-by: Dan Scott <dscott@laurentian.ca>
18 13 2 src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
20 commit 974d3a0dd4ddd134033b16bcd9e2fde34302ffd5
21 Author: Dan Wells <dbw2@calvin.edu>
22 Date: Tue Mar 6 15:08:33 2012 -0500
24 Protect gateway from format-string crashes in data
26 As a common security measure, printf-style formatting codes are
27 not allowed to be directly interpreted from a writable segment.
28 The gateway code currently has the following function call:
30 osrfLogActivity( OSRF_LOG_MARK, act->buf );
32 This is a variadic function which expects the 'act->buf' position
33 to contain a format string and any trailing arguments to be the
34 values passed to the formatter. Since act->buf is the value of
35 what we passed in, some data inadvertantly contains format strings,
36 and since it is a writable segment, the program crashes. Here is
37 an example of a crash-causing call:
39 http://localhost/osrf-gateway-v1?service=test&method=test¶m=%22%251n%22
41 The param is interpreted as "%1n" and abruptly fails.
43 The simple solution is to include a formatter so that our param gets
44 demoted to being mere data, i.e.:
46 osrfLogActivity( OSRF_LOG_MARK, "%s", act->buf );
48 Signed-off-by: Dan Wells <dbw2@calvin.edu>
49 Signed-off-by: Dan Scott <dscott@laurentian.ca>
51 1 1 src/gateway/osrf_json_gateway.c
53 commit fd92a859e2ba3eeeaafe4904cd04973eb8cd572b
54 Author: Thomas Berezansky <tsbere@mvlc.org>
55 Date: Wed Mar 7 16:42:21 2012 -0500
57 Stop warning about missing parentheses...
61 Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
63 1 1 src/perl/lib/OpenSRF/Application/Validator.pm
65 commit 8cfa0ae50935176a1574e8f233c8d4d88442c0ad
66 Author: Bill Erickson <berick@esilibrary.com>
67 Date: Thu Feb 16 17:31:29 2012 -0500
69 Refresh child file handles on status read
71 If a child process dies while the parent is attempting to read status
72 information from the child, the pipe connecting the two will be cleaned
73 up. The parent mustn't attempt to read from the dead pipe or it will
74 result in a bad file descriptor error, culminating in a high-cpu
75 infinite loop on the parent (Listener) process.
78 Signed-off-by: Bill Erickson <berick@esilibrary.com>
79 Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
80 Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
82 4 3 src/perl/lib/OpenSRF/Server.pm
84 commit 37606bf64f2829258cc612e730782e081e2ac6bb
85 Author: Bill Erickson <berick@esilibrary.com>
86 Date: Fri Jan 13 10:57:59 2012 -0500
88 Python libs for OpenSRF ingress tracking
90 osrf.ses.Session.ingress(ingress)
92 This also set the "srfsh" ingress value for srfsh.py.
94 Signed-off-by: Bill Erickson <berick@esilibrary.com>
95 Signed-off-by: Mike Rylander <mrylander@gmail.com>
97 11 1 src/python/osrf/ses.py
98 2 0 src/python/osrf/stack.py
99 1 0 src/python/srfsh.py
101 commit 26c31a9d5728adbd884a1369034caff41471130b
102 Author: Bill Erickson <berick@esilibrary.com>
103 Date: Fri Jan 13 09:35:18 2012 -0500
105 Set OpenSRF ingress value for srfsh/gateways
107 Sets the "srfsh", "gateway-v1", and "translator-v1" ingress values
110 For the translater, it's necessary to stamp the unpacked messages with
111 the updated ingress, then re-serialize before sending the messages along.
113 Signed-off-by: Bill Erickson <berick@esilibrary.com>
114 Signed-off-by: Mike Rylander <mrylander@gmail.com>
116 18 21 src/gateway/osrf_http_translator.c
117 1 0 src/gateway/osrf_json_gateway.c
118 1 0 src/srfsh/srfsh.c
120 commit 7ec92808fea116ead923e475ad5242a54b688798
121 Author: Bill Erickson <berick@esilibrary.com>
122 Date: Fri Jan 13 09:15:05 2012 -0500
124 C libs for OpenSRF ingress tracking
126 osrfAppSessionSetIngress(<ingress>);
128 Signed-off-by: Bill Erickson <berick@esilibrary.com>
129 Signed-off-by: Mike Rylander <mrylander@gmail.com>
131 5 0 include/opensrf/osrf_app_session.h
132 5 0 include/opensrf/osrf_message.h
133 26 0 src/libopensrf/osrf_app_session.c
134 32 0 src/libopensrf/osrf_message.c
135 4 0 src/libopensrf/osrf_stack.c
137 commit b12de37f9480c68b1c8b033da18c3cc0d0ebc8f0
138 Author: Bill Erickson <berick@esilibrary.com>
139 Date: Thu Jan 12 16:36:16 2012 -0500
141 Perl libs for OpenSRF ingress tracking
143 Ingress is a free-form text value which represents the entry point for
144 the client into the opensrf network. The value is passed within opensrf
145 messages, similar to "locale". Clients should specify the ingress
146 before any opensrf communication occurs.
148 OpenSRF::AppSession->ingress($ingress);
150 Stock values include the following:
157 Signed-off-by: Bill Erickson <berick@esilibrary.com>
158 Signed-off-by: Mike Rylander <mrylander@gmail.com>
160 9 0 src/perl/lib/OpenSRF/AppSession.pm
161 20 1 src/perl/lib/OpenSRF/DomainObject/oilsMessage.pm
162 2 0 src/perl/lib/OpenSRF/Transport.pm
164 commit 67d4d5de8656128f32b20f4c04dbf81a1028e929
165 Author: Dan Scott <dscott@laurentian.ca>
166 Date: Wed Feb 29 10:48:38 2012 -0500
168 Copy opensrf_core.xml.example to a clean opensrf_core.xml file
170 Ben Shum with the assist again.
172 Also, add ~/.srfsh.xml to the definition list of interesting OpenSRF
175 Signed-off-by: Dan Scott <dscott@laurentian.ca>
179 commit 68025993b01cc95f66a0ca723841e1abb406709f
180 Author: Dan Scott <dscott@laurentian.ca>
181 Date: Wed Feb 29 10:42:58 2012 -0500
183 Include explicit instructions to copy the opensrf config files
185 Also noted by the sharp-eyed Ben Shum, we didn't tell people to actually
186 copy opensrf.xml.example / opensrf_core.xml.example, which could lead to
189 Signed-off-by: Dan Scott <dscott@laurentian.ca>
193 commit 75f27021d4b45eebbf52a89a35f96e775f92a207
194 Author: Dan Scott <dscott@laurentian.ca>
195 Date: Wed Feb 29 10:27:36 2012 -0500
197 Update max_user_sessions suggestion to 10000 to match wiki
199 Ben Shum noticed that the README still specified 1000 for
200 max_user_sessions in the ejabberd.cfg file, whereas current larger
201 OpenSRF systems with many services may blow past that limit. Update to
202 match the current wiki specification of 10000.
204 Signed-off-by: Dan Scott <dscott@laurentian.ca>
208 commit 61fdb582dc918a1003351ff25842a23aaff24f71
209 Author: Dan Scott <dscott@laurentian.ca>
210 Date: Wed Jan 4 15:21:36 2012 -0500
212 Remove reference to Fedora specific version in prereq installer
214 Fedora changes every 6 months, so it's probably silly to have a make
215 target of "fedora14" when that is no longer supported by the Fedora
216 project itself. As Fedora has packaged all of the OpenSRF dependencies
217 (thanks, Ben Webb!), in theory it should be supported by the latest
218 releases of Fedora in the future... as long as we don't introduce any
219 dependencies on deprecated versions of packages.
221 Signed-off-by: Dan Scott <dscott@laurentian.ca>
223 2 2 src/extras/Makefile.install
225 commit ba6d4c7cc2988dafb6ca8de2d1f2f93194dcf3b3
226 Author: Dan Scott <dscott@laurentian.ca>
227 Date: Wed Jan 4 15:17:48 2012 -0500
229 Update README to match Evergreen's format
231 Reference the various accounts in use consistently.
233 Correct reference to "fedora" target in Makefile.install.
235 Put the developer preamble up front.
237 Provide more Fedora examples.
239 Do not include leading "#" and "$" in bash examples, to make it easier
240 for people to copy and paste.
242 Include source highlighting instructions and titles for example
245 Signed-off-by: Dan Scott <dscott@laurentian.ca>
249 commit cc7a12f74a9ce4555d5abd8989dfab43290fb41c
250 Author: Bill Erickson <berick@esilibrary.com>
251 Date: Fri Feb 24 16:28:27 2012 -0500
253 Java dependencies update
255 As of Java 6, XML Stax parsing is natively supported. This change
256 removes the external Stax dependencies and updates how the JSON libs are
257 fetched (in deps.sh), which now come from github.
259 Signed-off-by: Bill Erickson <berick@esilibrary.com>
260 Signed-off-by: Dan Scott <dscott@laurentian.ca>
262 17 20 src/java/deps.sh
263 1 4 src/java/org/opensrf/net/xmpp/XMPPReader.java
264 1 4 src/java/org/opensrf/util/XMLFlattener.java
266 commit 07b2eff0a7dfc492afd8e67788eae159c5ab96b7
267 Author: Dan Scott <dscott@laurentian.ca>
268 Date: Tue Feb 21 09:55:57 2012 -0500
270 We're not in Subversion anymore, Dorothy
272 We're in git now, make the README reflect that accordingly. Thanks to
273 Warren Layton for the tip!
275 Signed-off-by: Dan Scott <dscott@laurentian.ca>
279 commit aeeb4acdc8695a640021dbc6902ab3279652583d
280 Author: Bill Erickson <berick@esilibrary.com>
281 Date: Tue Feb 14 09:10:58 2012 -0500
283 Perl parent/child write improvements
285 * Updated variable names for clarity
286 * Added more inline comments
287 * Added additional error logging
288 * For severe read errors, allow the child to gracefully skip the request
290 Signed-off-by: Bill Erickson <berick@esilibrary.com>
291 Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
292 Signed-off-by: Mike Rylander <mrylander@gmail.com>
294 25 19 src/perl/lib/OpenSRF/Server.pm
296 commit 08ee4f993fe773e37233b139961cbcdae2fe93b8
297 Author: Bill Erickson <berick@esilibrary.com>
298 Date: Mon Feb 13 16:53:59 2012 -0500
300 Perl pipe reading overhaul : data size header
302 The lockfile mechanism for preventing premature end of reads on child
303 processes suffers from one serious flaw: if the data to write exceeds
304 the pipe buffer size, the parent will block on syswrite and the service
305 will lock up. It's also not as effecient (for the normal case) as the
306 code was without the lockfile, becasue the writes and reads are
309 This commit replaces the lockfile mechanism with a protocol header in
310 the data. The first X (currently 12) bytes of data written to the child
311 process will contain the full length of the data to be written (minus
312 the header size). The child now reads the data in parallel with the parent as
313 data is available. If the child reads all available data (in the pipe)
314 but not all of the expected data, the child will go back into a select()
315 wait pending more data from the parent. The process continues until all
318 This same mechanism is already used to commicate status info from child
319 processes to the parent.
321 Signed-off-by: Bill Erickson <berick@esilibrary.com>
322 Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
323 Signed-off-by: Mike Rylander <mrylander@gmail.com>
325 49 73 src/perl/lib/OpenSRF/Server.pm
326 1 2 src/perl/lib/OpenSRF/System.pm
328 commit 04558f38c1c1d314acb978a37193dacb4a6eba31
329 Author: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
330 Date: Fri Jan 27 09:05:07 2012 -0500
332 JSON_v0 has been superseded, and it has insidious bugs anyway.
334 For example, you cannot round-trip this through JSON2js() and js2JSON()
335 in IE8: http://paste.lisp.org/display/127338
337 This will make Evergreen's build fail until the change specified in
338 LP #922609 is applied.
340 Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
341 Signed-off-by: Bill Erickson <berick@esilibrary.com>
344 0 135 src/javascript/JSON_v0.js
345 delete mode 100644 src/javascript/JSON_v0.js
347 commit 89f41c82798dbac56716fdd5beeb6c0de3e4ce2e
348 Author: Bill Erickson <berick@esilibrary.com>
349 Date: Mon Nov 7 17:30:44 2011 -0500
351 Sync parent/child write/read with lock file
353 Wrap parent writes to child socket and initial child reads of the
354 socket in file lock (via flock()) to prevent rare race condition
355 where child process reads to the end of the data before the parent
356 has written all bytes.
358 This create a new lock file on the system, which resides in the same
359 directory as the pid files. The lock file is created and destroyed by
360 the opensrf perl mods at service start up and shutdown.
362 See also https://bugs.launchpad.net/opensrf/+bug/883155
364 Signed-off-by: Bill Erickson <berick@esilibrary.com>
365 Signed-off-by: Dan Scott <dscott@laurentian.ca>
367 1 1 bin/opensrf-perl.pl.in
368 60 8 src/perl/lib/OpenSRF/Server.pm
369 3 2 src/perl/lib/OpenSRF/System.pm
371 commit 3d089bdfd067676f99807f7cb2014e122c4dbf72
372 Author: Dan Scott <dscott@laurentian.ca>
373 Date: Mon Dec 12 13:09:13 2011 -0500
375 Update Perl OpenSRF build and tests for O:A:Validator
377 Kickstarted by wanting to bring OpenSRF::Application::Validator into the
378 MANIFEST and testing coverage, I noticed a few other files that needed
379 to be added to the MANIFEST as well. This gets us closer to acceptable
380 according to "./Build distcheck"
382 Signed-off-by: Dan Scott <dscott@laurentian.ca>
384 1 0 src/perl/Build.PL
385 22 0 src/perl/MANIFEST
386 6 1 src/perl/t/01-Application.t
388 commit 5e1fbcc1c8ae2f969dbeac93fe1da80c008ca42b
389 Author: Thomas Berezansky <tsbere@mvlc.org>
390 Date: Fri Dec 9 15:19:12 2011 -0500
392 OpenSRF Validator Service
394 Add a new Validator service, and EmailAddress validators.
396 The service runs a chain of one or more validators, each one being fed the
397 normalized output of the previous one.
399 The return from each validator should be a hash of valid (0 or 1), the new
400 normalized output (the untouched input if invalid or nothing needed to be
401 changed), and if invalid an error string. Optionally, a validator can also
402 include an "additionals" hash of extra information to be included in the
405 The complete list of validators included is:
407 OpenSRF::Application::Validator::Base
408 The base validator. Always returns valid.
409 OpenSRF::Application::Validator::Invalid
410 Always returns invalid for testing purposes.
411 OpenSRF::Application::Validator::EmailAddress::Regex
412 Does a very basic regular expression check on email addresses.
413 OpenSRF::Application::Validator::EmailAddress::DNS
414 Uses Net::DNS to look up the domain on an email address
416 Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
417 Signed-off-by: Dan Scott <dscott@laurentian.ca>
419 40 0 examples/opensrf.xml.example
420 3 0 src/extras/Makefile.install
421 50 0 src/perl/lib/OpenSRF/Application/Validator.pm
422 12 0 src/perl/lib/OpenSRF/Application/Validator/Base.pm
423 96 0 src/perl/lib/OpenSRF/Application/Validator/EmailAddress/DNS.pm
424 23 0 src/perl/lib/OpenSRF/Application/Validator/EmailAddress/Regex.pm
425 16 0 src/perl/lib/OpenSRF/Application/Validator/Invalid.pm
426 create mode 100644 src/perl/lib/OpenSRF/Application/Validator.pm
427 create mode 100644 src/perl/lib/OpenSRF/Application/Validator/Base.pm
428 create mode 100644 src/perl/lib/OpenSRF/Application/Validator/EmailAddress/DNS.pm
429 create mode 100644 src/perl/lib/OpenSRF/Application/Validator/EmailAddress/Regex.pm
430 create mode 100644 src/perl/lib/OpenSRF/Application/Validator/Invalid.pm
432 commit b6b64deb16ed3f005d64f99365b0220a82d72431
433 Author: Jason Stephenson <jstephenson@mvlc.org>
434 Date: Wed Dec 7 15:08:42 2011 -0500
436 Support installation for Ubuntu 12.04 Precise Pangolin.
438 Update the README to include Precise Pangolin as a supported release.
440 Update src/extras/Makefile.install to install two new debs required on
443 Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
444 Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
447 15 1 src/extras/Makefile.install
449 commit 3a4ae77be13349fae180fdc81bcc23e5a93032b4
450 Author: Dan Scott <dscott@laurentian.ca>
451 Date: Fri Nov 4 09:42:50 2011 -0400
453 Add explicit chown command to README
455 Warren Layton noticed that there was no explicit command to change the
456 ownership of the files in the /<PREFIX> directory to be owned by
457 "opensrf", although there was a statement that the files needed to be
458 owned by "opensrf". To reduce the chance of failure, add the explicit
461 TODO (for a willing volunteer): teach the installer to change the
462 ownership at the time the files are installed!
464 Signed-off-by: Dan Scott <dscott@laurentian.ca>
468 commit a7be31f137ccf6e2f4522c9a4c690a23b5636db8
469 Author: Bill Erickson <berick@esilibrary.com>
470 Date: Fri Oct 28 11:33:24 2011 -0400
472 Add SIGPIPE retry handling to child data sysread
474 Similar to the SIGPIPE retry logic wrapped around the parent process'
475 syswrite call (for sending data to a child process), protect the child's
476 sysread call (as it reads data from the parent). In pre-2.0, the
477 sysread step was handled by Net::Server, but now we need to protect it
480 Signed-off-by: Bill Erickson <berick@esilibrary.com>
481 Signed-off-by: Galen Charlton <gmc@esilibrary.com>
483 10 0 src/perl/lib/OpenSRF/Server.pm
485 commit 40a753b10a3db58baa9179d75a76df1266589ea1
486 Author: Dan Scott <dscott@laurentian.ca>
487 Date: Wed Oct 19 11:39:41 2011 -0400
489 LP878284: stop_osrf action should stop, not start, Perl
491 As reported by Vicent Mas <uvemas@gmail.com> to the Evergreen
492 developer's mailing list:
495 It seems I've found a small bug in the
496 /openils/bin/osrf_ctl.sh script. The line for the osrf_stop action is:
498 "stop_osrf") stop_python; stop_c; start_perl;;
502 "stop_osrf") stop_python; stop_c; stop_perl;;
505 Signed-off-by: Dan Scott <dscott@laurentian.ca>
507 1 1 bin/osrf_ctl.sh.in
509 commit 07b5a335656be741353ab70c1d4717dacdbebc1b
510 Author: Bill Erickson <berick@esilibrary.com>
511 Date: Tue Oct 18 09:17:10 2011 -0400
513 Warn when sending very large messages
515 Depending on configuration, messages of a certain size sent through a
516 Jabber server will cause the jabber server to disconnect the client.
517 This change allows admins to configure a message size warning threshold.
518 When a message meets or exceeds the size threshold, a warning is issued
519 to the logs with the message size (in bytes) and the message recipient.
520 It does not prevent the message from being delivered. It's purely
523 Use 1 800 000 as the default threhold.
525 Signed-off-by: Bill Erickson <berick@esilibrary.com>
526 Signed-off-by: Galen Charlton <gmc@esilibrary.com>
528 3 0 examples/opensrf_core.xml.example
529 11 1 src/perl/lib/OpenSRF/Transport/SlimJabber/Client.pm
531 commit ffb8bb73a2f505cfda9d8b97fab1f82aa3fb7097
532 Author: Dan Scott <dscott@laurentian.ca>
533 Date: Sat Sep 10 12:22:08 2011 -0400
535 Fix README typo: 'mod_offlinex'
537 mod_offline is not that x-treme.
539 Signed-off-by: Dan Scott <dscott@laurentian.ca>
543 commit 0725d1ddced0f16c351a5953f5fd3c14714cda1a
544 Author: Dan Scott <dan@coffeecode.net>
545 Date: Thu Aug 25 11:41:19 2011 -0400
547 Don't define a variable inside a conditional block
549 ./configure --disable-core --enable-javascript was dying with an error
550 due to CHECK_TESTS not being defined; move it outside the conditional
551 block so that we can ensure that it is defined as either yes or no.
553 Signed-off-by: Dan Scott <dscott@laurentian.ca>