120 Commits

Author SHA1 Message Date
jonnylamb e484cc4dd9 * Misc. fixes in bongo-standalone, Auth and PropfindView.
* Added Server.py for use in Apache.
 * Note: this currently doesn't work, so unless you have a way to send the
   Authorization header manually, Sundial through Apache will not work. This
   is pretty high up on my TODO list.
2007-09-14 13:18:33 +00:00
jonnylamb 6c8ffc91d8 Disable spewing out debugging messages to the command line. 2007-09-07 15:22:26 +00:00
jonnylamb 3a5cf04f05 * Change URL scheme from using dav/ to calendars/ by default, but can be changed.
* Add SundialUriRoot option which defaults to calendars/ in standalone.
2007-09-07 15:19:39 +00:00
jonnylamb 8e24fbec84 Disallow PUT'ing anything but VEVENTs into the store.
- There is perhaps a more elegant way of implementing this, but it works at the moment.
2007-09-07 11:23:45 +00:00
jonnylamb f209f16e73 * Change hostname function to not rely on User-Agent being set.
* Clean up Alex's comments to use lovely punctuation!
2007-09-04 02:52:09 +00:00
alexhudson 49565942f1 Fix a simple tpoy 2007-08-29 13:45:40 +00:00
alexhudson 54dad69d08 Fix PUT in Sundial - incorrect use of Store protocol exposing bug #9890 2007-08-29 13:19:00 +00:00
jonnylamb 5649d54cbd * Change URL scheme to use filenames instead of bongoIds. As a result, creating new events now works.
* Simplified PUT handler.
2007-08-29 01:35:02 +00:00
jonnylamb ab5d4cb630 * Switch off debugging output by default. It just eats up the terminal window. 2007-08-18 18:25:48 +00:00
jonnylamb 8630a95a6e * Implemented a small bit of PUT:
+ Modifying existing events works.
   + Adding new events is not implemented.
   + There is no error checking at the moment.
 * A fair number of cleanups around the Sundial code. Thanks to lamby for pointing these out:
   + Renamed lxml.etree instance from ET to et.
   + Changed comparisons with "None" to use "is" or "is not", instead of "==" or "!=" respectively.
   + Changed bit long strings being +'d together to formatted strings.
   + Moved SundialHandler and SundialPath to "new-style" Python objects.
 * Removed sneaky cElementTree call in SundialPath.
2007-08-18 18:19:56 +00:00
jonnylamb e14ba20ed9 * Fix GET requests (for now). Unicode characters are still replaced with ? which sucks big time. However, now they actually display in Evolution, which is quite useful. 2007-08-17 23:01:45 +00:00
jonnylamb 3037ba6f17 * Removed dependancy on cElementTree. lxml.etree is now used. Find me if you want to discuss why I did this.
* Removed the ElementTree-specific function, set_prefixes.
   + Namespaces are handled differently now. They use the xmlns="foo" default namespace attribute.
   + Therefore, there are no more C:tag or D:tag tags around.
2007-08-13 23:11:12 +00:00
jonnylamb 2da950507f * Added DELETE support.
* Added small hack to make GET work again. This is a rather serious TODO.
2007-08-13 22:56:49 +00:00
jonnylamb 01fd763518 * Move filename parsing stuff to SundialPath.
+ rp.fileuid now contains the file UID of the request.
 * Implement D:getetag in PROPFIND.
 * Implement using file resources in PROPFIND.
2007-08-13 18:56:29 +00:00
jonnylamb 13a36230dd Small fixes to REPORT handler:
* Now that the calendar data comes in unicode, make sure it can be md5'd.
 * Make sure to include the <?xml header on sending out XML data.
2007-08-13 16:38:26 +00:00
alexhudson 588750dee6 Fix comment style in tests.c 2007-08-13 15:29:09 +00:00
alexhudson 19ad37aaa5 * Add a test library which produces ASCII and Unicode strings
* Attempt our new unicode technique on JsonToIcal() - should now return unicode
2007-08-12 10:45:35 +00:00
jonnylamb beb3c38b89 * Use urllib.unquote to make the calendar name pretty again. It gets screwed up by calendar clients.
* Moved get_hostname() from ReportHandler to SundialPath so more handlers can use it
   + Updated PROPFIND so it uses rp.get_hostname() for <D:href>
 * General switching around of stuff in the REPORT handler, to be more flexible. It was unnecessarily regid before.
   + This description is vague, so view the diff in context to understand!
2007-08-11 18:32:57 +00:00
jonnylamb 182f4e9e4e Fixed the PROPFIND request so that it only returns C:calendar as the D:resourcetype when the resource in question is /actually/ a calendar, according to the store. 2007-08-11 11:01:45 +00:00
jonnylamb 19da4f5d11 * Slight fix to authentication issue. Handling the actual HTTP basic authentication should still be sorted though.
* Change location of store connection, as there's no point in connecting if no username+password has been entered.
   This moves StoreClient from __init__ to do_$(METHOD), if this makes any sense.
2007-08-11 09:54:47 +00:00
jonnylamb 8fc19c1d12 * Added support for single-calendar requests. Getting *all* events from now on is not allowed.
* As a result, a URI parsing function was implemented in SundialPath, to extract the relevant information.
 * Method views were updated to access the right store and other small URI updates.
2007-08-10 01:43:25 +00:00
jonnylamb ff39902139 Solved the Evolution problem, for now, by giving definite URLs to Evolution, and relative URLs to non-Evolution clients. 2007-08-09 11:17:49 +00:00
jonnylamb 572aecf3e3 Some minor implementations and cleanups. Evolution support now works with a slight adjustment.
* Clean up little typo in bongo-standalone.
 * Implement GET properly, even with some error handling.
 * Make OPTIONS require auth, otherwise the current auth handling system will fail miserably.
   This really should be off, but the authenhandler will be updated soon, and modernised.
 * Implement C:is-defined filter, if I can call that an implementation.
 * Add a TODO about different URL support in Evolution.
2007-08-09 01:31:38 +00:00
jonnylamb 8eb18fb855 * Removed a silly sys.path.append line that's only really meant for my testing setup.
* Removed debugging output on each request as it piles up the bongo-standalone window.
  It is only commented out though.
2007-08-08 02:28:51 +00:00
jonnylamb e6492781e5 Added beginnings of Sundial:
* Updated bongo-standalone to accept /dav/.
 * Added some views and handlers for Sundial.
   + GET view is hugely unsupported and is completely out-of-date and static.
   + PROPFIND view has the roots in, but has very very minor support for any prop
     requests.
   + OPTIONS is a total lie, but is implemented.
   + REPORT is the most advanced here, as it's the most important. There is still
     much to do here though. Perhaps separate this into different files later on
	 if things get too bloated.
 * Implemented get_basic_auth_pw() in bongo.commonweb.Standalone.HttpRequest.
 * Added bongo.commonweb.ElementTree with some helper functions.
2007-08-08 02:22:35 +00:00
jonnylamb 213464068c Added Sundial branch. 2007-08-07 23:48:48 +00:00
alexhudson 95aa64d386 Remove python/bongo/Makefile, stops dist tarballs building. 2007-07-31 08:55:39 +00:00
halex 3b1507bc7b Users without a valid From name doesn't crash the composer anymore. This really doesn't fix any 'problem' with prefs, more of a workaround. 2007-07-31 07:54:07 +00:00
halex 2d37fb62db Note to self: mistakenly serialising page elements is bad. 2007-07-30 09:34:38 +00:00
halex 5eb4f67e99 * Fixes the User-Agent from mails sent via Dragonfly.
* Adds a new HTML composer - plain-text does not work at the moment.
* Adds plugins code; note that this is not hooked up _at all_, I was just merely too lazy to checkout a clean version, modify the patch, apply and commit. This will be *sure to change very soon*.
2007-07-28 10:28:56 +00:00
alexhudson cb74eae670 Correct file closing logic for QRETR 2007-07-27 17:06:03 +00:00
alexhudson 9c52b028ae Missed initializing a file handle, oops 2007-07-27 16:22:58 +00:00
alexhudson 785476ba0f Even more stringent file checking in the queue 2007-07-27 16:01:37 +00:00
trisk da1c898909 * Add rule for missing src/libs/python/bongo/Makefile.
* Don't remove bongo-python-wrapper in clean, it's generated by config.status.
2007-07-26 13:35:00 +00:00
trisk f37e40d9aa * Fix some obvious bugs in smtpd's remote host resolution. 2007-07-26 13:31:26 +00:00
alexhudson c8f9670d70 Fixed a bug in a temporary file handle, and made the file open/close checks more correct 2007-07-26 10:38:10 +00:00
halex 50617cbc10 Un-breaks the composer. Requires you RE-SAVE YOUR PREFS. 2007-07-26 09:25:18 +00:00
alexhudson a289b56729 Remove some DMC cruft we missed 2007-07-25 20:20:29 +00:00
alexhudson 8ed1e89fe1 A couple of compiler blatherings fixed. 2007-07-25 19:50:19 +00:00
alexhudson ce0211995d Instrument the queue with some file checking. 2007-07-25 19:46:18 +00:00
alexhudson 05e8852440 Minor logic nit in assertion :D 2007-07-25 19:45:49 +00:00
alexhudson deb78542ce smtp now correctly logs, slight change to API used in queue 2007-07-25 18:01:27 +00:00
alexhudson cf114834d9 Put some logging and assertions into the queue 2007-07-25 17:37:14 +00:00
alexhudson 5878c5116e Another attempt at detecting the CLucene API "correctly" 2007-07-25 16:31:43 +00:00
alexhudson 18441d2231 Hopefully get the API right on more versions of clucene 2007-07-24 22:42:16 +00:00
halex f5b85d0515 Fixes the From: address with a sender name specified in the preferences. 2007-07-23 10:44:32 +00:00
halex fbde82b235 * Fix logged out message.
* Dragonfly version is now 'M3' in SVN, not SVN r2483+.
* Added popup-hide handler (isn't hooked up yet).
* Removed FakeFriendPopup - wasn't used.
* Removed 'This is Me'.
* We now have a user profile in preferences.
* Cleaned up a bit of the Prefs builder, including translated and clickable labels.
2007-07-21 06:02:55 +00:00
dostrow 168af364e8 * Add support for importing maildir format mailboxes in bongo-storetool with the new -t flag
* Add support for importing to collections other then /mail/INBOX with the new -f flag
* Add support for exporting to both maildir and mbox format
* Split the old mail-store subcommand into mail-import (mi) and mail-export (me)
2007-07-20 17:31:21 +00:00
halex bbdfc1d6e3 Fixes the Big Cheese (aka bug #9541). 2007-07-19 11:51:30 +00:00
alexhudson b901178411 Disable outgoing TLS in SMTP, causes bug #9536. 2007-07-18 19:32:48 +00:00
alexhudson cc2146f14b Two fixes to python errors preventing logins 2007-07-18 11:31:11 +00:00
jonnylamb d81014a674 * Added support to Dragonfly preferences to determine how many items to be shown on a mail list view. This first tries to use the DF pref from the store, but if that cannot be used/is invalid then it falls back on ConversationsHandler.defaultPageSize, which is set to 30.
* Started documenting variables and methods in ConversationsHandler using Doxygen syntax.
2007-07-16 23:05:45 +00:00
halex 38b5be0c8d * More colors! :)
* Don't hide the logged out message after loading language.
* Colorise quotes in emails.
2007-07-16 06:50:16 +00:00
halex b186eca218 No more crazy composer POST loops! \o/ 2007-07-16 04:59:25 +00:00
halex 9010d916ab * More noop translations for set names in Mail view.
* It helps to store the pageSize value, you know!
* Update Dragonfly.go so that we check both the handler AND the tab for a getData(loc) function.
* Fixed up MailListView and co. so that we do what pageSize says, not anything else.
  |- Server side still has troubles with values besides 30. No touchy.
2007-07-16 02:40:01 +00:00
alexhudson 79673b9d1b Slightly naughty config fix to make dist work again, and update a python rule 2007-07-15 22:31:31 +00:00
halex 8d72093cd6 * Added ability to adjust default calendar view in Preferences.
* Changed one of my 'bad translation ways' - we now use d.format instead for Logout link.
* Even more event arg bug fixes - this one closes bug #9408.
* We now perform a noop/lazy/late translation for mailbox labels (drafts, sent, inbox etc).
2007-07-15 08:58:13 +00:00
halex 012f72a874 More composer fixes. 2007-07-15 02:24:29 +00:00
halex 97eb5c1356 Remove all reminants of old i10n labels. 2007-07-15 01:58:01 +00:00
trisk 5f533850e0 * Align hashtable entries correctly so that Python modules don't crash! 2007-07-15 01:42:22 +00:00
trisk 6a1aa7b881 * Doh, malloc is not calloc! >< 2007-07-14 18:18:58 +00:00
trisk 1d3b79c1e2 * Prevent potential free of static string. 2007-07-14 18:17:10 +00:00
alexhudson c8d8cdaf9a Fix a lookup table in the mdb-xldap MDB driver, fixes managed-ldap 2007-07-14 11:31:58 +00:00
halex bd5e101f5f * Some more translation string fixups - Prefs, DateTime entry, Calendars.
* Translated most of the Preferences dialog.
* Changed behaviour of untitled conversations in composer - we now call them 'Untitled' (translatable) if there's no subject when we try to save to backend.
* Neater signature stuff.
2007-07-14 10:50:13 +00:00
jonnylamb 968577911d * Move to a more unified python www system. Instead of components being used in both DF and HE calling bongo.dragonfly methods, these "commonweb" things have been moved into bongo.commonweb.
* Removed bongo.admin.BongoSession as bongo.commonweb.BongoSession  is more developed.
* The Auth and *{Handler,Path} modules should probably be merged across DF and HE next, but have been lleft separate foor this commit, for now.
2007-07-13 22:58:05 +00:00
alexhudson a913e011c4 Correct(?!) dist and inst rules for config files and sets 2007-07-13 22:35:08 +00:00
alexhudson d3ddf20189 Friendly-looking Python patch which should clear up lib vs. lib64 issues on RH-type distros 2007-07-13 22:06:45 +00:00
alexhudson fb042f0ac5 Scary looking python patch; separate the C-module stuff from pure python for the benefit of OSes which keep them separately. 2007-07-13 21:17:21 +00:00
alexhudson 1764749c58 Stop Lucene crashing on x86_64 (import only, sadly...), and 'make clean' works again 2007-07-13 16:34:13 +00:00
trisk ba713d88e0 * Go over mdbldap and fix at least a dozen memory leaks. 2007-07-13 15:57:13 +00:00
halex 17eefc5a79 More language fixups (specifically the error on login). 2007-07-13 12:52:17 +00:00
halex 305477029b Fixes unescaped translation string which caused Dragonfly to go haywire (especially the compiled version, which didn't load at all). 2007-07-13 12:19:03 +00:00
jonnylamb 78d49fd7a8 Little fix to make po2json a little more flexible when building. Oh, and removing that horrible temporary line that was meant for me only.. 2007-07-13 11:50:14 +00:00
jonnylamb 1fd6ff820c Update build rules to point to $lang.js, instead of $lang.json. 2007-07-13 11:32:37 +00:00
jonnylamb 9370449931 Remove src/www/l10n/dragonfly.properties from dist_noinst_DATA. 2007-07-13 11:15:57 +00:00
jonnylamb 1de36a6c67 Changed $lang.json to $lang.js, to be more correct. Or, to be correct in the first place. 2007-07-13 10:59:12 +00:00
jonnylamb 67c91f6090 * Change l10n stuff in Dragonfly from labels to strings. This is all Alex Hixon's work.
* Alex also added a different gettext scheme to use the po/ system as opposed to the dragonfly.properties file.
* I have added a po2json script. This uses polib to take strings out of /po/bongo-web.pot and create a json file.
* Currently a few issues are here though:
  + src/www/js/JCal.js is commented out in po/POTFILES.bongo-web because it's creating errors of some charset or something when 'make update-pot' is called. This should be resolved shortly.
  + The po2json script is absolutely disgusting at the moment. It works, but the source is in need of a little cleanup. This should also be rather quick and easy to cut-down.
  + I have edited src/www/js/Gettext.js to use a different directory from what is desired. Ultimately, /l10n/$lang/LC_MESSAGES/dragonfly.js will be used, but at the moment, /l10n/$lang.js is being used. This is also another TODO thing..
  + It currently doesn't work. No joke. This is some JS-issue. However, it pretty much does work if you're using English because now that all gettext msgids are now strings, and not labels, DF falls back on them, and all is fine. There are just some warnings spaffed out on the logs and on the login screen.
  + I have just seen that I made a silly mistake in configure.ac. I'll fix that on the next commit, in a few seconds..
So, please do not try out this commit (or the next) unless your name is Alexander Hixon.
2007-07-13 10:57:11 +00:00
alexhudson c2fbb8f61e Look harder for SQLite libraries on 64bit RH-type distros 2007-07-12 22:28:23 +00:00
trisk 4b0476a596 * Unbreak BongoJsonParserNextNode - leak was actually caused by missing frees.
* Apparent double free in ReadBongoConfiguration (should only BongoJsonNodeFree() parent node, not BongoJsonJPath() node).
2007-07-12 21:45:15 +00:00
alexhudson ca45b1417f * Hopefully the 'dist' is correct again with new config files
* Look for CLucene in 64bit locations on RH-type distros
2007-07-12 21:13:03 +00:00
trisk 8d1f10ad98 * Memory leak in BongoJsonParserNextNode() - duplicated string at return.
* Memory leak in LdapToRelativeMdb() - forgot to free string.
2007-07-12 20:53:52 +00:00
jonnylamb 277769e69d Add directory that SVN previously didn't. Apparently it was already under revision control.. *sigh* 2007-07-12 13:29:36 +00:00
jonnylamb 8ea2a88dcc * Added another gettext package: bongo-web. This is for Dragonfly+Hawkeye translations. The old bongo package remains. This is for the core of Bongo, for example the CLI apps.
* Made the po/ system more flexible. Simply drop a .po file in either po/bongo/ or po/bongo-web/ and everything's done for you.
* Fixed a dirty hack about dist_noinst_DATA. $POFILES was being used ~2000 lines before being set. Thiss is now set much earlier on, from configure.ac.
* POTFILES.in split into .bongo and .bongo-web for the respective gettext package.
2007-07-12 13:15:48 +00:00
alexhudson 41ed4dedc7 Small fix to stop cmuser module leaking handles to a directory 2007-07-12 09:42:13 +00:00
halex ace52e75c4 * New compression code.
* Compression of CSS is now also performed.
* Javascript compression works again - we save about 1/3 bandwidth.
2007-07-12 07:17:11 +00:00
trisk a30612eac7 * Add missing IDs to "small mode" menu.
* Anchor new event popup correctly in "small mode".
2007-07-11 21:46:02 +00:00
alexhudson 25f1a34250 * Update default config for antivirus and antispam
* Hopefully corrected a config bug where we crash on malformed json data
2007-07-11 21:40:55 +00:00
trisk 2bb2877866 * Make avirus crash a bit less. 2007-07-11 20:59:10 +00:00
trisk 9fb528dd0e * default.set should depend on config files. 2007-07-11 20:43:22 +00:00
trisk f9f0282aa0 (Hopefully) fix more issues in new config code. 2007-07-11 19:52:32 +00:00
alexhudson af379dd929 Another way of invoking tar :) 2007-07-11 19:51:16 +00:00
trisk 2e706f5349 Don't crash if parts of schema are missing. 2007-07-11 18:28:31 +00:00
trisk 9816a936e2 Clean up sketchy parts of the store. 2007-07-11 17:58:45 +00:00
alexhudson 4973b31a27 More compatible tar invocation 2007-07-11 16:55:25 +00:00
alexhudson 2963a454c7 * New configuration system
* Default config now comes from a backup file, not hard-coded
2007-07-11 12:11:55 +00:00
halex 8559b8bdb8 * /me is starting to hate Composer.js
* Fixes both Send (save draft first) and Save Draft (trying to assign message to event - similar issue found in Addressbook.Contacts) on Composer view.
2007-07-11 10:51:40 +00:00
halex 58564815a6 * When searching for contacts, provide a ContactPopup, rather than a link to the contact's conversations.
* Get's rid of a minor niggle with 'html' being undefined at login screen.
2007-07-11 07:25:30 +00:00
halex 65a20db8f9 * Entering data into the Subject field in the composer updates the title.
* When we dispose of the Preferences editor, send the user back to whatever page they were on before, not just summary.
2007-07-11 05:53:12 +00:00
trisk f4b73dc601 * Previous message link in conversation always points to first message.
* Tweak composer, make discarding a message go to the previous location.
2007-07-11 05:30:58 +00:00
halex a7af92dcc5 Finally, no more composer scrolling issues! \o/ 2007-07-11 03:27:11 +00:00
halex ff3ec35d27 * Small touchup in compiled Dragonfly HTML to stop search box and button touching.
* Textarea style does not inherit non-monospace fonts (only from browser).
* We now have signature support!
* Ability to adjust items per page in mail list view.
2007-07-11 01:47:59 +00:00
halex 68e73006b5 * Put the links for compiled/uncompiled Dragonfly in the wrong place.
* When we discard a draft, don't bomb out if we try and delete something that didn't exist
* More preference changes - new fields are yet to be hooked up.
* Fixes the scrollable composer window problem.
2007-07-11 00:54:52 +00:00
trisk 01d7e89470 * final.js needs to update when its components change. 2007-07-10 17:08:02 +00:00
trisk 60fdae4c69 * Actually print to the buffer in LoggerOpen(). 2007-07-10 15:23:14 +00:00
alexhudson e355a6fb18 Turn on logging! Thanks to Lance Haig for figuring most of this out. Includes:
* Lance's configuration file
* Small changes to log4c and slapd to make them shut up a bit
2007-07-10 13:21:19 +00:00
jonnylamb 1641302e0d Fixes to the po/ build system. Thanks to Daniel Ostrow for this. 2007-07-10 09:41:10 +00:00
halex d4d0629203 * Speedups in the HTML dept.
* We now have a 'debug' version of Dragonfly.
2007-07-10 09:37:42 +00:00
halex 1a59960bd9 Reset back to no compression, just (in theory) cat-ting the files together. 2007-07-10 06:57:55 +00:00
halex 087ab3dcb5 Hopefully makes standalone composer scrollable. 2007-07-10 05:17:14 +00:00
halex d59c6e89ff Wrong order of script.aculo.us includes. 2007-07-10 03:32:27 +00:00
halex afa1db57b0 * Speeds up Dragonfly load times (a lot). 2007-07-10 01:25:40 +00:00
trisk e52ab32f26 * Fix crash in bongoimap - session->user.name is only set after UserLogin(). 2007-07-09 17:18:17 +00:00
trisk 145b53ca2c * Correct bongo-manager pid file formatting.
* Fix bongo-setup pid handling (thanks to Chris Lamb!).
2007-07-09 15:13:01 +00:00
trisk b6001cdb0b * Use slapdadd (same binary as slapd and has a configurable path) instead of ldapdd in bongo-setup.
* Use Privs module functions for Bongo user.
2007-07-09 15:10:59 +00:00
alexhudson 014f94da0d 'make distclean' fix for po/ files 2007-07-08 19:57:27 +00:00
trisk 1e573957ef Generate a Message-Id if the an email did not include one, to prevent crashing the store on import. 2007-07-08 12:30:04 +00:00
alexhudson 8826f58c02 Some .gmo install rule fixes 2007-07-08 10:00:19 +00:00
alexhudson 741331701e Fix search for clucene-config.h file on self-compiled CLucene install (thanks to dostrow) 2007-07-08 09:14:34 +00:00
halex 9def52095f * Got rid of SummaryView.py (didn't actually do anything)
* Hooray for breadcrumbs!
2007-07-08 01:38:00 +00:00
trisk 26471cf430 Doh. 2007-07-08 00:25:57 +00:00
204 changed files with 8392 additions and 4356 deletions
+6 -2
View File
@@ -110,7 +110,7 @@ include_subdirs := \
src/libs/calcmd \
src/libs/calcmd/tests \
src/libs/python \
src/libs/python/bongo \
src/libs/python/libbongo \
src/agents/alarm \
src/agents/antispam \
src/agents/avirus \
@@ -175,7 +175,7 @@ include src/libs/connmgr/Bongo.rules
include src/libs/calcmd/Bongo.rules
include src/libs/calcmd/tests/Bongo.rules
include src/libs/python/Bongo.rules
include src/libs/python/bongo/Bongo.rules
include src/libs/python/libbongo/Bongo.rules
include src/agents/addressbook/Bongo.rules
include src/agents/alarm/Bongo.rules
include src/agents/antispam/Bongo.rules
@@ -219,4 +219,8 @@ update-makefiles:
@for dir in $(include_subdirs) ; do \
echo " cp $(top_srcdir)/Makefile.am.subdir $(top_srcdir)/$$dir/Makefile.am" ; \
cp "$(top_srcdir)/Makefile.am.subdir" "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
if test "$$dir" == "po" ; then \
echo "" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
echo "distclean:" >> "$(top_srcdir)/$$dir/Makefile.am" || exit 1 ; \
fi ; \
done
+9 -2
View File
@@ -379,6 +379,7 @@ AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_CPPFLAGS)
AS_AC_EXPAND(PYTHONDIR, $pythondir)
AS_AC_EXPAND(PYEXECDIR, $pyexecdir)
# Check for openldap's slapd
AC_ARG_WITH([slapd],
@@ -433,11 +434,17 @@ AC_MSG_CHECKING([for Apache module directory])
AC_MSG_RESULT([$APACHE_MOD_DIR])
htl10n_jsfiles=
for lang in en `cd po && ls *.po | sed s/.po$//`; do
for lang in en `cd po && cd bongo-web && ls *.po | sed s/.po$//`; do
htl10n_jsfiles="$htl10n_jsfiles src/www/l10n/$lang.js"
done
AC_SUBST(htl10n_jsfiles)
POFILES=
for file in `find po -name *.po`; do
POFILES="$POFILES $file"
done
AC_SUBST(POFILES)
PTHREAD_CFLAGS=
PTHREAD_LIBS=
# Check taken from glib
@@ -680,7 +687,7 @@ src/libs/msgapi/Makefile
src/libs/nmap/Makefile
src/libs/python/Makefile
src/libs/python/bongo-python-wrapper
src/libs/python/bongo/Makefile
src/libs/python/libbongo/Makefile
src/libs/python/bongo/Xpl.py
src/libs/bongoutil/Makefile
src/libs/bongoutil/tests/Makefile
+1 -1
View File
@@ -146,7 +146,7 @@
#define CL_MAX_NAME CL_MAX_PATH
//todo: this is a temporary fix for a potential buffer overflow...
//should never use this
#define CL_MAX_DIR CL_MAX_PATH*32
#define CL_MAX_DIR CL_MAX_PATH*2
#ifdef _LARGE_FILES
#define LUCENE_MAX_FILELENGTH LUCENE_INT64_MAX_SHOULDBE
+6
View File
@@ -62,8 +62,14 @@
#define LOGIP(X) inet_ntoa(X.sin_addr)
#define LogFailure(message) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__)
#define LogFailureF(message, ...) Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__, __VA_ARGS__)
#define LogAssert(test, message) if (!(test)) { Log(LOG_ERROR, "Internal Failure (%s:%d) " message, __FILE__, __LINE__); }
#define LogAssertF(test, message, ...) if(!(test)) { Log(LOG_ERROR, "Assert:%s:%d " message, __FILE__, __LINE__, __VA_ARGS__); }
#define Log(...) LogMsg(LOGGERNAME, 0, __VA_ARGS__)
#define LogWithID(...) LogMsg(LOGGERNAME, __VA_ARGS__)
#define LogStart() LoggerOpen(LOGGERNAME);
#define LogStartup() log4c_init()
#define LogShutdown() log4c_fini()
+1 -1
View File
@@ -121,7 +121,7 @@ static int appender_load(log4c_rc_t* this, sd_domnode_t* anode)
if (type) {
log4c_appender_set_type(app, log4c_appender_type_get(type->value));
printf("set to type %s\n", type->value);
// printf("set to type %s\n", type->value);
}
if (layout)
+12
View File
@@ -90,6 +90,18 @@ struct _BongoAgent {
BongoManagee *managee;
};
/* Configuration file reading stuff */
typedef struct _BongoConfigItem {
BongoJsonType type;
char *source;
void *destination;
} BongoConfigItem;
BOOL ReadBongoConfiguration(BongoConfigItem *config, char *filename);
BOOL SetBongoConfigItem(BongoConfigItem *schema, BongoJsonNode *node);
void FreeBongoConfiguration(BongoConfigItem *config);
int BongoAgentInit(BongoAgent *agent,
const char *agentName,
const char *agentDn,
+3 -3
View File
@@ -44,8 +44,7 @@ AC_LANG(C++)
AC_MSG_CHECKING([for CLucene])
clucene_incdirs="/usr/include /usr/local/include /opt/sfw/include /opt/csw/include /usr/pkg/include"
clucene_libdirs="/usr/lib /usr/local/lib /opt/sfw/lib /opt/csw/lib /usr/pkg/lib"
clucene_alldirs="$clucene_libdirs $clucene_incdirs"
clucene_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/sfw/lib /opt/csw/lib /usr/pkg/lib"
if test "$ac_clucene_incdir" = "no"; then
AC_FIND_FILE(CLucene/StdHeader.h, $clucene_incdirs, ac_clucene_incdir)
@@ -55,6 +54,7 @@ AC_LANG(C++)
AC_FIND_FILE(libclucene.so, $clucene_libdirs, ac_clucene_libdir)
fi
clucene_alldirs="$ac_clucene_libdir $ac_clucene_incdir"
AC_FIND_FILE(CLucene/clucene-config.h, $clucene_alldirs, ac_clucene_confdir)
if test "x$ac_clucene_incdir" != "xno" -a "x$ac_clucene_libdir" != "xno" -a "x$ac_clucene_confdir" != "xno"; then
@@ -70,7 +70,7 @@ AC_LANG(C++)
fi
CLUCENE_BONGO_API=`echo "$clucene_ver" | $AWK -F. '{
if ($ 1 > 0 || $ 2 > 9 || ($ 2 == 9 && $ 3 > 18)) {
if ($ 1 > 0 || $ 2 > 9 || ($ 2 == 9 && $ 3 >= 17)) {
print 2;
} else {
print 1;
+1 -1
View File
@@ -62,7 +62,7 @@ AC_DEFUN([AC_CHECK_SQLITE3], [
fi
fi
if test "$ac_sqlite3_libdir" = "no"; then
sqlite3_libdirs="/usr/lib /usr/local/lib /usr/lib/sqlite /usr/local/lib/sqlite /usr/local/sqlite/lib /opt/sqlite/lib"
sqlite3_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /usr/lib/sqlite usr/lib64/sqlite /usr/local/lib/sqlite /usr/local/sqlite/lib /opt/sqlite/lib"
sqlite3_libs="libsqlite3.so libsqlite3.a"
AC_FIND_FILE($sqlite3_libs, $sqlite3_libdirs, ac_sqlite3_libdir)
if test "$ac_sqlite3_libdir" = "no"; then
+26 -13
View File
@@ -1,30 +1,42 @@
# -*- Makefile -*-
POFILES = po/fr.po
GMOFILES=$(POFILES:.po=.gmo)
dist_noinst_DATA += po/fr.po \
po/bongo.pot \
po/POTFILES.in
dist_noinst_DATA += $(POFILES) \
po/bongo.pot \
po/bongo-web.pot \
po/POTFILES.bongo \
po/POTFILES.bongo-web
po/all: update-gmo
po/clean: clean
rm -f po/*.gmo
po/clean:
for file in ${GMOFILES}; do \
rm -f $$file; \
done
po/install: po/all
for file in $(GMOFILES); do \
lang=`echo $$file | sed -e 's,.*/,,'`; \
$(MKINSTALLDIRS) $(localedir)/$$lang/LC_MESSAGES/; \
$(INSTALL) -m 0644 $$file $(localedir)/$$lang/LC_MESSAGES/bongo.gmo; \
lang=`echo $$file | sed -e 's,.*/,,' | sed -e 's/.gmo//'`; \
$(MKINSTALLDIRS) $(DESTDIR)/$(localedir)/$$lang/LC_MESSAGES/; \
installfilename=`echo $$file | sed -e 's,po/\([^/]*\)/.*,\1,'`; \
$(INSTALL) -m 0644 $$file $(DESTDIR)/$(localedir)/$$lang/LC_MESSAGES/$$installfilename.gmo; \
done
bongo.pot:
update-pot:
$(XGETTEXT) --directory=$(srcdir) \
--add-comments=translators \
--keyword=_ --keyword=N_ --keyword=M_ \
--files-from=$(srcdir)/po/POTFILES.in \
--files-from=$(srcdir)/po/POTFILES.bongo \
--msgid-bugs-address="bongo-devel@gna.org" \
-o po/bongo.pot
# This is a bit of a hack. Nevertheless, it works, I hope.
$(XGETTEXT) --directory=$(srcdir) \
--add-comments=translators \
--keyword=_ --keyword=N_ --keyword=M_ \
--files-from=$(srcdir)/po/POTFILES.bongo-web \
--msgid-bugs-address="bongo-devel@gna.org" \
-L python \
-o po/bongo-web.pot
update-gmo: ${GMOFILES}
@@ -33,5 +45,6 @@ update-po: ${POFILES}-update update-gmo
%.gmo:
rm -f $@ && $(GMSGFMT) -o $@ $*.po
%.po-update: bongo.pot
$(MSGMERGE) $*.po po/bongo.pot -o $*.po
%.po-update: update-pot
whichpotfile=`echo $*.po | sed -e 's,po/\([^/]*\)/.*,\1,'`; \
$(MSGMERGE) $*.po po/$$whichpotfile.pot -o $*.po;
+2
View File
@@ -15,3 +15,5 @@
all clean install:
@cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@
distclean:
-1
View File
@@ -1,5 +1,4 @@
# List of source files which contain translatable strings.
src/www/l10n/dragonfly.properties
src/apps/config/config.c
src/apps/backup/backup.c
src/apps/manager/manager.c
+21
View File
@@ -0,0 +1,21 @@
src/www/js/AddressBook.js
src/www/js/CalendarEditor.js
src/www/js/Calendar.js
src/www/js/CalendarView.js
src/www/js/CalendarWidgets.js
src/www/js/Composer.js
src/www/js/Dragonfly.js
src/www/js/Format.js
# This isn't quite playing ball atm.
#src/www/js/JCal.js
src/www/js/Location.js
src/www/js/Login.js
src/www/js/MailConversationView.js
src/www/js/Mail.js
src/www/js/MailListView.js
src/www/js/OccurrenceEditor.js
src/www/js/Preferences.js
src/www/js/Search.js
src/www/js/Summary.js
src/www/js/ValidatingEntry.js
src/www/js/Widgets.js
+853
View File
@@ -0,0 +1,853 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: bongo-devel@gna.org\n"
"POT-Creation-Date: 2007-07-13 11:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/www/js/AddressBook.js:232
msgid "Add Contact"
msgstr ""
#: src/www/js/AddressBook.js:322 src/www/js/AddressBook.js:446
msgid "Show Conversations"
msgstr ""
#: src/www/js/AddressBook.js:323 src/www/js/CalendarEditor.js:127
#: src/www/js/OccurrenceEditor.js:826 src/www/js/Widgets.js:1128
msgid "Add"
msgstr ""
#: src/www/js/AddressBook.js:336 src/www/js/AddressBook.js:641
#: src/www/js/CalendarEditor.js:969 src/www/js/OccurrenceEditor.js:176
#: src/www/js/OccurrenceEditor.js:218
msgid "Saving changes..."
msgstr ""
#: src/www/js/AddressBook.js:352 src/www/js/AddressBook.js:629
#: src/www/js/AddressBook.js:657 src/www/js/CalendarEditor.js:975
#: src/www/js/OccurrenceEditor.js:187 src/www/js/OccurrenceEditor.js:228
msgid "Changes saved."
msgstr ""
#: src/www/js/AddressBook.js:445 src/www/js/AddressBook.js:610
#: src/www/js/AddressBook.js:675 src/www/js/CalendarEditor.js:913
#: src/www/js/CalendarEditor.js:951 src/www/js/CalendarEditor.js:1026
#: src/www/js/Mail.js:154 src/www/js/Mail.js:304
#: src/www/js/OccurrenceEditor.js:109 src/www/js/OccurrenceEditor.js:142
#: src/www/js/OccurrenceEditor.js:262 src/www/js/OccurrenceEditor.js:281
#: src/www/js/OccurrenceEditor.js:823 src/www/js/Widgets.js:1080
msgid "Delete"
msgstr ""
#: src/www/js/AddressBook.js:447 src/www/js/CalendarEditor.js:953
#: src/www/js/OccurrenceEditor.js:110
msgid "Edit"
msgstr ""
#: src/www/js/AddressBook.js:606
msgid "This is Me"
msgstr ""
#: src/www/js/AddressBook.js:608 src/www/js/AddressBook.js:675
#: src/www/js/CalendarEditor.js:808 src/www/js/CalendarEditor.js:914
#: src/www/js/OccurrenceEditor.js:137 src/www/js/OccurrenceEditor.js:143
#: src/www/js/OccurrenceEditor.js:262 src/www/js/Widgets.js:1079
#: src/www/js/Widgets.js:1126
msgid "Cancel"
msgstr ""
#: src/www/js/AddressBook.js:608 src/www/js/CalendarEditor.js:915
#: src/www/js/OccurrenceEditor.js:138 src/www/js/OccurrenceEditor.js:144
#: src/www/js/OccurrenceEditor.js:281
msgid "Save"
msgstr ""
#: src/www/js/AddressBook.js:671
msgid ""
"Are you sure you want to delete the contact \"{0}\"? This cannot be undone."
msgstr ""
#: src/www/js/CalendarEditor.js:14
msgid "Share this calendar"
msgstr ""
#: src/www/js/CalendarEditor.js:73 src/www/js/CalendarEditor.js:100
#: src/www/js/CalendarEditor.js:623 src/www/js/CalendarEditor.js:642
#: src/www/js/Login.js:108
msgid "Name:"
msgstr ""
#: src/www/js/CalendarEditor.js:76 src/www/js/CalendarEditor.js:626
msgid "Color:"
msgstr ""
#: src/www/js/CalendarEditor.js:83
msgid "Import ICS:"
msgstr ""
#: src/www/js/CalendarEditor.js:92 src/www/js/CalendarEditor.js:637
msgid "Allow other users to search for this calendar"
msgstr ""
#: src/www/js/CalendarEditor.js:95 src/www/js/CalendarEditor.js:640
msgid "Password protect this calendar"
msgstr ""
#: src/www/js/CalendarEditor.js:103
msgid "Current password:"
msgstr ""
#: src/www/js/CalendarEditor.js:106 src/www/js/CalendarEditor.js:645
#: src/www/js/Login.js:109
msgid "Password:"
msgstr ""
#: src/www/js/CalendarEditor.js:109
msgid "Password (again):"
msgstr ""
#: src/www/js/CalendarEditor.js:121 src/www/js/CalendarEditor.js:139
#: src/www/js/CalendarEditor.js:952
msgid "Send invitation..."
msgstr ""
#: src/www/js/CalendarEditor.js:123
msgid "Basic"
msgstr ""
#: src/www/js/CalendarEditor.js:127
msgid "Email:"
msgstr ""
#: src/www/js/CalendarEditor.js:133
msgid "Remove"
msgstr ""
#: src/www/js/CalendarEditor.js:136
msgid "Select:"
msgstr ""
#: src/www/js/CalendarEditor.js:136 src/www/js/Mail.js:239
msgid "All"
msgstr ""
#: src/www/js/CalendarEditor.js:136
msgid "None"
msgstr ""
#: src/www/js/CalendarEditor.js:142
msgid "Detailed"
msgstr ""
#: src/www/js/CalendarEditor.js:160 src/www/js/CalendarEditor.js:661
msgid "Loading calendar data..."
msgstr ""
#: src/www/js/CalendarEditor.js:165 src/www/js/CalendarEditor.js:240
#: src/www/js/CalendarEditor.js:666 src/www/js/CalendarEditor.js:696
#: src/www/js/Dragonfly.js:810
msgid "New Calendar"
msgstr ""
#: src/www/js/CalendarEditor.js:340
msgid "a username is required"
msgstr ""
#: src/www/js/CalendarEditor.js:343
msgid "the passwords do not match"
msgstr ""
#: src/www/js/CalendarEditor.js:346
msgid "a password is required"
msgstr ""
#: src/www/js/CalendarEditor.js:536
msgid "Someone wants to share their calendar with you."
msgstr ""
#: src/www/js/CalendarEditor.js:537
msgid "You can view it in a few different ways:"
msgstr ""
#: src/www/js/CalendarEditor.js:538
msgid "ICS"
msgstr ""
#: src/www/js/CalendarEditor.js:539
msgid "CalDAV"
msgstr ""
#: src/www/js/CalendarEditor.js:540
msgid "Web Browser"
msgstr ""
#: src/www/js/CalendarEditor.js:541
msgid "If a password is needed, please ask me for it."
msgstr ""
#: src/www/js/CalendarEditor.js:633 src/www/js/CalendarEditor.js:775
#: src/www/js/CalendarEditor.js:806
msgid "URL:"
msgstr ""
#: src/www/js/CalendarEditor.js:809 src/www/js/CalendarEditor.js:1029
#: src/www/js/Dragonfly.js:811
msgid "Subscribe"
msgstr ""
#: src/www/js/CalendarEditor.js:839 src/www/js/CalendarEditor.js:1081
msgid "Subscribing to {0}..."
msgstr ""
#: src/www/js/CalendarEditor.js:848
msgid "Error subscribing to calendar {0}: {1}"
msgstr ""
#: src/www/js/CalendarEditor.js:993
msgid "Saving calendar"
msgstr ""
#: src/www/js/CalendarEditor.js:1014
msgid "{0} has invited you to a calendar called {1}."
msgstr ""
#: src/www/js/CalendarEditor.js:1020
msgid ""
"You should only subscribe to this calendar if you trust this person and the "
"server {0}."
msgstr ""
#: src/www/js/CalendarEditor.js:1027 src/www/js/Mail.js:155
#: src/www/js/Mail.js:303 src/www/js/OccurrenceEditor.js:824
msgid "Junk"
msgstr ""
#: src/www/js/CalendarEditor.js:1028 src/www/js/OccurrenceEditor.js:825
msgid "Ignore"
msgstr ""
#: src/www/js/CalendarEditor.js:1041 src/www/js/CalendarEditor.js:1052
#: src/www/js/CalendarEditor.js:1062
msgid "genericSavingChanges"
msgstr ""
#: src/www/js/CalendarEditor.js:534
msgid "Invitation to {0}"
msgstr ""
#: src/www/js/Calendar.js:91
msgid "Yesterday"
msgstr ""
#: src/www/js/Calendar.js:93
msgid "Today"
msgstr ""
#: src/www/js/Calendar.js:95
msgid "Tomorrow"
msgstr ""
#: src/www/js/Calendar.js:346
msgid "View:"
msgstr ""
#: src/www/js/Calendar.js:347
msgid "Day"
msgstr ""
#: src/www/js/Calendar.js:349
msgid "Upcoming"
msgstr ""
#: src/www/js/Calendar.js:351
msgid "Week"
msgstr ""
#: src/www/js/Calendar.js:353
msgid "Month"
msgstr ""
#: src/www/js/CalendarView.js:79 src/www/js/CalendarView.js:252
msgid "Prev"
msgstr ""
#: src/www/js/CalendarView.js:81 src/www/js/CalendarView.js:255
msgid "Next"
msgstr ""
#: src/www/js/CalendarWidgets.js:161 src/www/js/CalendarWidgets.js:167
msgid "S"
msgstr ""
#: src/www/js/CalendarWidgets.js:162
msgid "M"
msgstr ""
#: src/www/js/CalendarWidgets.js:163 src/www/js/CalendarWidgets.js:165
msgid "T"
msgstr ""
#: src/www/js/CalendarWidgets.js:164
msgid "W"
msgstr ""
#: src/www/js/CalendarWidgets.js:166
msgid "F"
msgstr ""
#: src/www/js/CalendarWidgets.js:205
msgid "Show Today"
msgstr ""
#: src/www/js/CalendarWidgets.js:363
msgid "View in Calendar"
msgstr ""
#: src/www/js/Composer.js:121
msgid "To:"
msgstr ""
#: src/www/js/Composer.js:125
msgid "CC:"
msgstr ""
#: src/www/js/Composer.js:129
msgid "BCC:"
msgstr ""
#: src/www/js/Composer.js:133
msgid "Subject:"
msgstr ""
#: src/www/js/Composer.js:134
msgid "From:"
msgstr ""
#: src/www/js/Composer.js:135
msgid "Attachments:"
msgstr ""
#: src/www/js/Composer.js:157
msgid "mailAttachLabel"
msgstr ""
#: src/www/js/Composer.js:161
msgid "Discard"
msgstr ""
#: src/www/js/Composer.js:162
msgid "Save Draft"
msgstr ""
#: src/www/js/Composer.js:163
msgid "Send"
msgstr ""
#: src/www/js/Composer.js:321
msgid "Untitled"
msgstr ""
#: src/www/js/Composer.js:324
msgid "Saving draft \"{0}\"..."
msgstr ""
#: src/www/js/Composer.js:328
msgid "Saved draft"
msgstr ""
#: src/www/js/Composer.js:359
msgid "Error saving draft:"
msgstr ""
#: src/www/js/Composer.js:459
msgid "Message sent."
msgstr ""
#: src/www/js/Composer.js:471
msgid "Error sending message: "
msgstr ""
#: src/www/js/Composer.js:774
msgid "Remove attachment"
msgstr ""
#: src/www/js/Composer.js:839
msgid "Uploading {0}..."
msgstr ""
#: src/www/js/Composer.js:872
msgid "Error saving attachment"
msgstr ""
#: src/www/js/Dragonfly.js:893
msgid "Administration"
msgstr ""
#: src/www/js/Dragonfly.js:894
msgid "Preferences"
msgstr ""
#: src/www/js/Dragonfly.js:895 src/www/js/Dragonfly.js:896
msgid "Search"
msgstr ""
#: src/www/js/Dragonfly.js:899 src/www/js/Dragonfly.js:900
#: src/www/js/OccurrenceEditor.js:449
msgid "Summary"
msgstr ""
#: src/www/js/Dragonfly.js:901
msgid "Look at an overview of your mail and events."
msgstr ""
#: src/www/js/Dragonfly.js:903 src/www/js/Dragonfly.js:904
msgid "Mail"
msgstr ""
#: src/www/js/Dragonfly.js:905
msgid "Read your mail."
msgstr ""
#: src/www/js/Dragonfly.js:906
msgid "Compose new mail"
msgstr ""
#: src/www/js/Dragonfly.js:908 src/www/js/Dragonfly.js:909
msgid "Calendar"
msgstr ""
#: src/www/js/Dragonfly.js:910
msgid "View your calendar."
msgstr ""
#: src/www/js/Dragonfly.js:911
msgid "Create new event"
msgstr ""
#: src/www/js/Dragonfly.js:925
msgid "Logged in: loading contacts and calendars..."
msgstr ""
#: src/www/js/Dragonfly.js:940
msgid "Logged in: loading"
msgstr ""
#: src/www/js/Dragonfly.js:953
msgid "Log out"
msgstr ""
#: src/www/js/Dragonfly.js:998
msgid ""
"Bongo has finished saving changes. It is OK to browse to another location."
msgstr ""
#: src/www/js/Dragonfly.js:1001
msgid "Bongo is still busy with a few things, but we should be done shortly."
msgstr ""
#: src/www/js/Dragonfly.js:1002
msgid ""
"Please click Cancel and wait until we are finished, otherwise your changes "
"may be lost."
msgstr ""
#: src/www/js/Dragonfly.js:1004
msgid "Bongo needs some help from you before it's safe to leave."
msgstr ""
#: src/www/js/Dragonfly.js:1005
msgid ""
"Please click Cancel and tie up any loose ends otherwise your changes may be "
"lost."
msgstr ""
#: src/www/js/Dragonfly.js:1036 src/www/js/Login.js:113
msgid "You have logged out successfully."
msgstr ""
#: src/www/js/Login.js:69
msgid "Incorrect username or password."
msgstr ""
#: src/www/js/Login.js:71
msgid "Some error occured while logging in - check the logs."
msgstr ""
#: src/www/js/Login.js:110
msgid "Language"
msgstr ""
#: src/www/js/Login.js:111
msgid "Remember me"
msgstr ""
#: src/www/js/Login.js:112
msgid "Login"
msgstr ""
#: src/www/js/MailConversationView.js:226
msgid "Reply"
msgstr ""
#: src/www/js/MailConversationView.js:237
msgid "Reply to All"
msgstr ""
#: src/www/js/MailConversationView.js:248
msgid "Reply to List"
msgstr ""
#: src/www/js/MailConversationView.js:256
msgid "Forward"
msgstr ""
#: src/www/js/MailConversationView.js:280
msgid "to"
msgstr ""
#: src/www/js/Mail.js:153
msgid "Unarchive"
msgstr ""
#: src/www/js/Mail.js:153 src/www/js/Mail.js:302
msgid "Archive"
msgstr ""
#: src/www/js/Mail.js:154
msgid "Undelete"
msgstr ""
#: src/www/js/Mail.js:155
msgid "Not Junk"
msgstr ""
#: src/www/js/Mail.js:156
msgid "Unstar"
msgstr ""
#: src/www/js/Mail.js:156 src/www/js/Mail.js:305
msgid "Star"
msgstr ""
#: src/www/js/Mail.js:240
msgid "To Me"
msgstr ""
#: src/www/js/Mail.js:241
msgid "From My Contacts"
msgstr ""
#: src/www/js/Mail.js:242
msgid "Mailing Lists"
msgstr ""
#: src/www/js/Mail.js:307
msgid "Select All"
msgstr ""
#: src/www/js/Mail.js:308
msgid "Deselect All"
msgstr ""
#: src/www/js/Mail.js:552
msgid "Conversation"
msgstr ""
#: src/www/js/Mail.js:552 src/www/js/Mail.js:560
msgid "List"
msgstr ""
#: src/www/js/Mail.js:552
msgid "View"
msgstr ""
#: src/www/js/Mail.js:560
msgid "Item"
msgstr ""
#: src/www/js/Mail.js:662
msgid "To"
msgstr ""
#: src/www/js/Mail.js:662
msgid "From"
msgstr ""
#: src/www/js/MailListView.js:101 src/www/js/MailListView.js:182
msgid "No messages here."
msgstr ""
#: src/www/js/MailListView.js:193
msgid "more..."
msgstr ""
#: src/www/js/OccurrenceEditor.js:45
msgid "Enter free-form text for example:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:46
msgid "lunch with Joe tomorrow at noon"
msgstr ""
#: src/www/js/OccurrenceEditor.js:47
msgid "or,"
msgstr ""
#: src/www/js/OccurrenceEditor.js:47
msgid "enter details instead"
msgstr ""
#: src/www/js/OccurrenceEditor.js:48
msgid "Add Event"
msgstr ""
#: src/www/js/OccurrenceEditor.js:259
msgid "Are you sure you want to delete the event"
msgstr ""
#: src/www/js/OccurrenceEditor.js:261
msgid "? This cannot be undone."
msgstr ""
#: src/www/js/OccurrenceEditor.js:272
msgid "This event is part of a series. Would you like"
msgstr ""
#: src/www/js/OccurrenceEditor.js:273
msgid "changes to apply to"
msgstr ""
#: src/www/js/OccurrenceEditor.js:273
msgid "to delete"
msgstr ""
#: src/www/js/OccurrenceEditor.js:275
msgid "only this event"
msgstr ""
#: src/www/js/OccurrenceEditor.js:276
msgid "this and following events"
msgstr ""
#: src/www/js/OccurrenceEditor.js:277
msgid "all events in series"
msgstr ""
#: src/www/js/OccurrenceEditor.js:280 src/www/js/Preferences.js:304
msgid "genericCancel"
msgstr ""
#: src/www/js/OccurrenceEditor.js:366
msgid "all day"
msgstr ""
#: src/www/js/OccurrenceEditor.js:380
msgid "includeEventLabel"
msgstr ""
#: src/www/js/OccurrenceEditor.js:407
msgid "Publish this event on its own"
msgstr ""
#: src/www/js/OccurrenceEditor.js:432
msgid "Event"
msgstr ""
#: src/www/js/OccurrenceEditor.js:433
msgid "Sharomg"
msgstr ""
#: src/www/js/OccurrenceEditor.js:434
msgid "Repeat"
msgstr ""
#: src/www/js/OccurrenceEditor.js:450
msgid "Location"
msgstr ""
#: src/www/js/OccurrenceEditor.js:451
msgid "Notes"
msgstr ""
#: src/www/js/OccurrenceEditor.js:584
msgid "Repeat:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:594
msgid "Every:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:600 src/www/js/OccurrenceEditor.js:606
#: src/www/js/OccurrenceEditor.js:612
msgid "On:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:627
msgid "Ending:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:628
msgid "Never"
msgstr ""
#: src/www/js/OccurrenceEditor.js:628
msgid "On date"
msgstr ""
#: src/www/js/OccurrenceEditor.js:629
msgid "After repeating"
msgstr ""
#: src/www/js/OccurrenceEditor.js:644
msgid "Caution"
msgstr ""
#: src/www/js/OccurrenceEditor.js:645
msgid ""
"This event has a schedule that cannot be edited with Bongo; choosing to edit "
"will replace the existing schedule."
msgstr ""
#: src/www/js/OccurrenceEditor.js:646
msgid "Edit Anyway"
msgstr ""
#: src/www/js/OccurrenceEditor.js:810
msgid "{0} has invited you to:"
msgstr ""
#: src/www/js/OccurrenceEditor.js:812
msgid "Calendar:"
msgstr ""
#: src/www/js/Preferences.js:304
msgid "genericSave"
msgstr ""
#: src/www/js/Search.js:303
msgid "Sorry, but your query returned no results."
msgstr ""
#: src/www/js/Search.js:304
msgid "Here are some tips for getting better results:"
msgstr ""
#: src/www/js/Search.js:306
msgid "Make sure all words are spelt correctly."
msgstr ""
#: src/www/js/Search.js:307
msgid "Try different keywords."
msgstr ""
#: src/www/js/Search.js:308
msgid "Be less specific in your search."
msgstr ""
#: src/www/js/Search.js:338
msgid "Search results for {0}"
msgstr ""
#: src/www/js/Summary.js:43
msgid "Starred Mail"
msgstr ""
#: src/www/js/Summary.js:47
msgid "Mail to Me"
msgstr ""
#: src/www/js/Summary.js:51
msgid "Mail from my contacts"
msgstr ""
#: src/www/js/Summary.js:55
msgid "Mail from mailing lists"
msgstr ""
#: src/www/js/Summary.js:60
msgid "You do not seem to have any new or unread emails."
msgstr ""
#: src/www/js/Summary.js:65
msgid "Invitations"
msgstr ""
#: src/www/js/Summary.js:70
msgid "Upcoming events"
msgstr ""
#: src/www/js/Summary.js:328
msgid "summaryInviteFrom"
msgstr ""
#: src/www/js/ValidatingEntry.js:438
msgid "Start on:"
msgstr ""
#: src/www/js/ValidatingEntry.js:440 src/www/js/ValidatingEntry.js:448
msgid "at:"
msgstr ""
#: src/www/js/ValidatingEntry.js:446
msgid "dateEndOn"
msgstr ""
#: src/www/js/Widgets.js:648
msgid "You have unsaved changes."
msgstr ""
#: src/www/js/Widgets.js:696
msgid "An error has occured:"
msgstr ""
#: src/www/js/Widgets.js:698
msgid "Great."
msgstr ""
#: src/www/js/Widgets.js:950
msgid "Add timezone..."
msgstr ""
#: src/www/js/Widgets.js:952
msgid "Edit list..."
msgstr ""
#: src/www/js/Widgets.js:955
msgid "Other..."
msgstr ""
#: src/www/js/Widgets.js:1081
msgid "Set as Default"
msgstr ""
#: src/www/js/Widgets.js:1082
msgid "Add..."
msgstr ""
#: src/www/js/Widgets.js:1118
msgid "Region"
msgstr ""
#: src/www/js/Widgets.js:1118
msgid "Timezone"
msgstr ""
#: src/www/js/Widgets.js:1129
msgid "Add as Default"
msgstr ""
#: src/www/js/Widgets.js:1131
msgid "Set"
msgstr ""
+1389
View File
File diff suppressed because it is too large Load Diff
+150 -781
View File
File diff suppressed because it is too large Load Diff
-641
View File
@@ -16,647 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "genericError"
msgstr "Une erreur s'est produite:"
msgid "genericErrorOK"
msgstr "Bummér"
msgid "loginNameLabel"
msgstr "Nom:"
msgid "loginPasswordLabel"
msgstr "Mot de passe:"
msgid "loginLanguageLabel"
msgstr "Langue:"
msgid "loginRememberMeLabel"
msgstr "Se rappeler me"
msgid "loginLoginLabel"
msgstr "Connexion"
msgid "loggedOutMessage"
msgstr "Vous vous êtes avec succès déconnectés."
msgid "loggingInMessage"
msgstr "Vous authentifiant..."
msgid "wrongCredentials"
msgstr "Mauvais nom ou mot de passe."
msgid "genericLoginError"
msgstr "Connexion erreur (notations de contrôle)."
msgid "loadingData"
msgstr "Entré: contacts et calendriers de chargement..."
msgid "loadingItemPre"
msgstr "Entré:"
msgid "loadingItemPost"
msgstr " de chargement..."
msgid "administrationLabel"
msgstr "Administration"
msgid "logoutLabel"
msgstr "Se déconnecter"
msgid "preferencesLabel"
msgstr "Préférences"
msgid "searchButtonLabel"
msgstr "Recherche"
msgid "summaryTabLabel"
msgstr "Résumé"
msgid "summaryTabHint"
msgstr "Regarder une vue d'ensemble de votre courrier et événements."
msgid "mailTabLabel"
msgstr "Courrier"
msgid "mailTabHint"
msgstr "Lire votre courrier."
msgid "calendarTabLabel"
msgstr "Calendrier"
msgid "calendarTabHint"
msgstr "Regarder votre calendrier."
msgid "composeMailLabel"
msgstr "Composer le nouveau courrier"
msgid "composeEventLabel"
msgstr "Créer le nouvel événement"
msgid "summaryNoMail"
msgstr "Vous n'avez aucun nouveau courrier."
msgid "upcomingEvents"
msgstr "Upcoming events"
msgid "showToday"
msgstr "Montrer aujourd'hui"
msgid "viewInCal"
msgstr "Vue dans le calendrier"
msgid "starredMailLabel"
msgstr "Starred Mail"
msgid "summaryMailToMeLabel"
msgstr "Mail to Me"
msgid "contactMailLabel"
msgstr "Mail from My Contacts"
msgid "listMailLabel"
msgstr "Mail from Mailing Lists"
msgid "invitationsLabel"
msgstr "Invitations"
msgid "summaryInviteFrom"
msgstr "from"
msgid "shareCalendar"
msgstr "Share this calendar"
msgid "contactAddLabel"
msgstr "Ajouter le contact"
msgid "contactShowConversations"
msgstr "Montrer les conversations"
msgid "contactEditLabel"
msgstr "Éditer"
msgid "contactSelf"
msgstr "This is Me"
msgid "contactConfirmRemovePre"
msgstr "Are you sure you want to delete the contact"
msgid "contactEmail"
msgstr "Email"
msgid "contactPhone"
msgstr "Phone"
msgid "contactFax"
msgstr "Fax"
msgid "contactMobile"
msgstr "Cell"
msgid "contactIM"
msgstr "IM"
msgid "contactWebsite"
msgstr "Website"
msgid "contactCompany"
msgstr "Company"
msgid "contactAddress"
msgstr "Address"
msgid "genericCancel"
msgstr "Annulation"
msgid "genericSave"
msgstr "Économiser"
msgid "genericDelete"
msgstr "Effacement"
msgid "genericEdit"
msgstr "Éditer"
msgid "genericAdd"
msgstr "Ajouter"
msgid "genericSavingChanges"
msgstr "Saving changes..."
msgid "genericChangesSaved"
msgstr "Changes saved."
msgid "genericPrevious"
msgstr "Previous"
msgid "genericPreviousShort"
msgstr "Prev"
msgid "genericNext"
msgstr "Next"
msgid "genericRemovePost"
msgstr "? This cannot be undone."
msgid "unsavedChanges"
msgstr "You have unsaved changes."
msgid "monday"
msgstr "Monday"
msgid "monday-s"
msgstr "M"
msgid "tuesday"
msgstr "Tuesday"
msgid "tuesday-s"
msgstr "T"
msgid "wednesday"
msgstr "Wednesday"
msgid "wednesday-s"
msgstr "W"
msgid "thursday"
msgstr "Thursday"
msgid "thursday-s"
msgstr "T"
msgid "friday"
msgstr "Friday"
msgid "friday-s"
msgstr "F"
msgid "saturday"
msgstr "Saturday"
msgid "saturday-s"
msgstr "S"
msgid "sunday"
msgstr "Sunday"
msgid "sunday-s"
msgstr "S"
msgid "day"
msgstr "Day "
msgid "upcoming"
msgstr "Upcoming"
msgid "week"
msgstr "Week"
msgid "month"
msgstr "Month"
msgid "calendarView"
msgstr "View:"
msgid "freeFormInstructions"
msgstr "Enter free-form text for example:"
msgid "freeFormExample"
msgstr "lunch with Joe tomorrow at noon"
msgid "freeFormOption"
msgstr "or"
msgid "freeFormOptionBody"
msgstr "enter details instead"
msgid "freeFormAddLabel"
msgstr "Add Event"
msgid "deleteEventConfirm"
msgstr "Are you sure you want to delete the event"
msgid "eventSeriesIntro"
msgstr "This event is part of a series. Would you like"
msgid "eventSeriesChanges"
msgstr "changes to apply to"
msgid "eventSeriesDelete"
msgstr "to delete"
msgid "eventScopeSingle"
msgstr "only this event"
msgid "eventScopeFollowing"
msgstr "this and following events"
msgid "eventScopeAll"
msgstr "all events in series"
msgid "includeEventLabel"
msgstr "Include this event in:"
msgid "publishEventSelf"
msgstr "Publish this event on its own"
msgid "allDayLabel"
msgstr "all day"
msgid "eventInfoTabLabel"
msgstr "Event"
msgid "eventSharingTabLabel"
msgstr "Sharing"
msgid "eventRepeatTabLabel"
msgstr "Repeat"
msgid "eventSummaryHint"
msgstr "Summary"
msgid "eventLocationHint"
msgstr "Location"
msgid "eventNoteHint"
msgstr "Notes"
msgid "eventDefaultTitle"
msgstr "New event"
msgid "eventSubscribe"
msgstr "Subscribe"
msgid "defaultCalendarName"
msgstr "New calendar"
msgid "calendarNameLabel"
msgstr "Name:"
#, fuzzy
msgid "calendarUrlLabel"
msgstr "Color:"
#, fuzzy
msgid "calendarPasswordLabel"
msgstr "Password protect this calendar"
msgid "calendarColorLabel"
msgstr "Color:"
msgid "calendarImportICSLabel"
msgstr "Import ICS file:"
msgid "calendarSearchableLabel"
msgstr "Allow other users to search for this calendar"
msgid "calendarPasswordProtectLabel"
msgstr "Password protect this calendar"
msgid "calendarSendInvitation"
msgstr "Send invitation..."
msgid "createNewCalendarLabel"
msgstr "Create calendar"
msgid "subscribeCalendarLabel"
msgstr "Unsubscribe"
#, fuzzy
msgid "calendarSubscribing"
msgstr "Regarder votre calendrier."
msgid "calendarErrorSubscribing"
msgstr "Could not subscribe to"
msgid "inviteDefaultText"
msgstr "has invited you to:"
msgid "inviteCalendarPre"
msgstr "Calendar:"
#, fuzzy
msgid "inviteTrustTextPre"
msgstr "has invited you to:"
#, fuzzy
msgid "inviteTrustTextPost"
msgstr "has invited you to:"
#, fuzzy
msgid "calendarShareLine1"
msgstr "Name:"
#, fuzzy
msgid "calendarShareLine2"
msgstr "Name:"
msgid "caldav"
msgstr "CalDAV"
msgid "ics"
msgstr "ICS"
msgid "webBrowser"
msgstr "Web Browser"
#, fuzzy
msgid "calendarShareFinalLine"
msgstr "Allow other users to search for this calendar"
#, fuzzy
msgid "calendarShareSubjectPre"
msgstr "Allow other users to search for this calendar"
msgid "calendarShareSubjectPost"
msgstr "'s calendar"
#, fuzzy
msgid "calendarShareBasicTab"
msgstr "Allow other users to search for this calendar"
#, fuzzy
msgid "calendarShareDetailedTab"
msgstr "Allow other users to search for this calendar"
#, fuzzy
msgid "calendarShareEmailLabel"
msgstr "Allow other users to search for this calendar"
#, fuzzy
msgid "calendarShareSelect"
msgstr "Name:"
#, fuzzy
msgid "calendarShareSelectAll"
msgstr "Select All"
#, fuzzy
msgid "calendarShareSelectNone"
msgstr "Allow other users to search for this calendar"
#, fuzzy
msgid "calendarShareCurrentPasswordLabel"
msgstr "Password protect this calendar"
#, fuzzy
msgid "calendarShareNewPassword"
msgstr "Password protect this calendar"
msgid "calendarShareNewPasswordConfirm"
msgstr "Password (confirm):"
msgid "buttonArchiveLabel"
msgstr "Archive"
msgid "buttonJunkLabel"
msgstr "Junk"
msgid "buttonIgnoreLabel"
msgstr "Ignore"
msgid "buttonStarLabel"
msgstr "Star"
msgid "buttonUnarchiveLabel"
msgstr "Unarchive"
msgid "buttonNotJunkLabel"
msgstr "Not Junk"
msgid "buttonUndeleteLabel"
msgstr "Undelete"
msgid "buttonUnstarLabel"
msgstr "Unstar"
msgid "buttonAddLabel"
msgstr "Add"
msgid "buttonRemoveLabel"
msgstr "Remove"
msgid "repeatLabel"
msgstr "Repeat:"
msgid "repeatEveryLabel"
msgstr "Every:"
msgid "repeatOnLabel"
msgstr "On:"
msgid "repeatEndingLabel"
msgstr "Ending:"
msgid "repeatEndNeverLabel"
msgstr "Never"
msgid "repeatEndOnDateLabel"
msgstr "On date "
msgid "repeatEndAfterRepeatLabel"
msgstr "After repeating"
msgid "repeatCautionHeadingLabel"
msgstr "Caution"
msgid "repeatCautionBodyText"
msgstr ""
"This event has a schedule that cannot be edited with Bongo; choosing to edit "
"will replace the existing schedule."
msgid "repeatEditAnywayLabel"
msgstr "Edit Anyway"
msgid "calendarYesterdayLabel"
msgstr "Yesterday"
msgid "calendarTodayLabel"
msgstr "Today"
msgid "calendarTomorrowLabel"
msgstr "Tomorrow"
msgid "mailAllLabel"
msgstr "All"
#, fuzzy
msgid "mailToMeSelectionLabel"
msgstr "To Me"
msgid "mailFromContactsLabel"
msgstr "From My Contacts"
msgid "mailSubscriptionsLabel"
msgstr "Mailing Lists"
msgid "mailNoMessages"
msgstr "No messages found."
msgid "mailMoreSuffix"
msgstr "more..."
msgid "mailTo"
msgstr "To:"
msgid "mailFrom"
msgstr "From:"
msgid "mailCc"
msgstr "CC:"
msgid "mailBcc"
msgstr "BCC:"
msgid "mailSubject"
msgstr "Subject:"
msgid "mailAttachments"
msgstr "Attachments:"
msgid "mailAttachLabel"
msgstr "Attach file..."
msgid "mailRemoveAttachment"
msgstr "Remove"
msgid "mailConversation"
msgstr "Conversation"
msgid "mailList"
msgstr "List"
msgid "mailItem"
msgstr "Item"
msgid "mailView"
msgstr "View"
msgid "mailDiscard"
msgstr "Discard"
msgid "mailDraft"
msgstr "Save draft"
msgid "mailSend"
msgstr "Send"
msgid "toolbarSelectAll"
msgstr "Select All"
msgid "toolbarDeselectAll"
msgstr "Deselect All"
msgid "dateStartOn"
msgstr "Start on:"
msgid "dateEndOn"
msgstr "End on:"
msgid "dateAtLabel"
msgstr "at"
msgid "mailSetAllLabel"
msgstr "All"
msgid "mailSetInboxLabel"
msgstr "Inbox"
msgid "mailSetStarredLabel"
msgstr "Starred"
msgid "mailSetSentLabel"
msgstr "Sent"
msgid "mailSetJunkLabel"
msgstr "Junk"
msgid "mailSetDraftsLabel"
msgstr "Drafts"
msgid "mailSetTrashLabel"
msgstr "Trash"
msgid "mailConversationsLabel"
msgstr "Conversations"
msgid "mailContactsLabel"
msgstr "Contacts"
msgid "mailToMeLabel"
msgstr "To Me"
msgid "mailMailingListsLabel"
msgstr "Mailing Lists"
msgid "mailForward"
msgstr "Forward"
msgid "mailReplyToAll"
msgstr "Reply to All"
msgid "mailReplyToSender"
msgstr "Reply to Sender"
msgid "mailReplyToList"
msgstr "Reply to List"
msgid "mail"
msgstr "Courrier"
msgid "inbox"
msgstr "Inbox"
msgid "sent"
msgstr "Sent"
msgid "trash"
msgstr "Trash"
msgid "junk"
msgstr "Junk"
#: src/apps/config/config.c:47
#, c-format
msgid "bongo-config: Could not drop to unpriviliged user '%s'\n"
-26
View File
@@ -352,30 +352,6 @@ AlarmLoop(void *ignored)
XplConsolePrintf(AGENT_NAME ": Shutting down.\r\n");
}
static BOOL
ReadConfiguration(void)
{
#if 0
MDBValueStruct *config;
config = MDBCreateValueStruct(Alarm.agent.directoryHandle,
MsgGetServerDN(NULL));
if (config) {
/* Read your agent's configuration here */
} else {
return FALSE;
}
MDBDestroyValueStruct(config);
#endif
// Since this agent doesn't read any config for the moment,
// just return true (we don't need/want to depend on MDB).
return TRUE;
}
static void
SignalHandler(int sigtype)
{
@@ -406,8 +382,6 @@ XplServiceMain(int argc, char *argv[])
return -1;
}
ReadConfiguration();
XplSignalHandler(SignalHandler);
StreamioInit();
+8 -3
View File
@@ -28,6 +28,7 @@
#include <xpl.h>
#include <memmgr.h>
#include <logger.h>
#include <bongoagent.h>
#include <bongoutil.h>
#include <mdb.h>
#include <nmap.h>
@@ -460,7 +461,7 @@ ProcessConnection(ASpamClient *client)
}
}
if (!blocked && ASpam.spamd.enabled) {
if (!blocked) {
blocked = SpamdCheck(&ASpam.spamd, client, qID, hasFlags, msgFlags, source, senderUserName);
}
@@ -982,7 +983,9 @@ XplServiceMain(int argc, char *argv[])
SpamdStartup(&(ASpam.spamd));
if (ASpam.spamd.enabled || ASpam.allow.used || ASpam.disallow.used) {
// TODO: *.used variables seem to be about spam IP sources. This doesn't seem to be
// the right place, really...
// if (ASpam.allow.used || ASpam.disallow.used) {
if (QueueSocketInit() < 0) {
XplConsolePrintf("bongoantispam: Exiting.\r\n");
@@ -1014,11 +1017,13 @@ XplServiceMain(int argc, char *argv[])
NMAPSetEncryption(ASpam.nmap.ssl.context);
ASpam.state = ASPAM_STATE_RUNNING;
#if 0
} else {
XplConsolePrintf("bongoantispam: spamd integration is not enabled and no hosts allowed or disallowed; unloading\r\n");
XplConsolePrintf("bongoantispam: no hosts allowed or disallowed; unloading\r\n");
ASpam.state = ASPAM_STATE_STOPPING;
}
#endif
XplStartMainThread(PRODUCT_SHORT_NAME, &id, AntiSpamServer, 8192, NULL, ccode);
+1
View File
@@ -69,6 +69,7 @@ typedef struct {
typedef struct {
AddressPool hosts;
BongoArray *hostlist;
BOOL enabled;
unsigned long connectionTimeout;
} SpamdConfig;
+19 -31
View File
@@ -28,6 +28,7 @@
#include <xpl.h>
#include <memmgr.h>
#include <logger.h>
#include <bongoagent.h>
#include <bongoutil.h>
#include <mdb.h>
#include <nmap.h>
@@ -346,39 +347,34 @@ ParseHost(char *buffer, char **host, unsigned short *port, unsigned long *weight
*
*/
static BongoConfigItem SpamdHostList = { BONGO_JSON_STRING, NULL, &ASpam.spamd.hostlist };
static BongoConfigItem SpamdConfigSchema[] = {
{ BONGO_JSON_INT, "o:timeout/i", &ASpam.spamd.connectionTimeout },
{ BONGO_JSON_ARRAY, "o:hosts/a", &SpamdHostList},
{ BONGO_JSON_NULL, NULL, NULL },
};
BOOL
SpamdReadConfiguration(SpamdConfig *spamd, BongoJsonNode *node)
{
BongoJsonResult res;
char *host;
const char *tempHost;
unsigned short port;
unsigned long weight;
unsigned int i;
memset(spamd, 0, sizeof(SpamdConfig));
res = BongoJsonJPathGetBool(node, "o:enabled/b", &ASpam.spamd.enabled);
if ((res != BONGO_JSON_OK) || (!ASpam.spamd.enabled)) {
/* nothing is configured or we are disabled */
return(FALSE);
}
/* Set up default spamd options. */
spamd->connectionTimeout = SPAMD_DEFAULT_CONNECTION_TIMEOUT;
ConnAddressPoolStartup(&spamd->hosts, 0, 0);
if (BongoJsonJPathGetInt(node, "o:timeout/i", (int *)(&spamd->connectionTimeout)) != BONGO_JSON_OK) {
spamd->connectionTimeout = SPAMD_DEFAULT_CONNECTION_TIMEOUT;
}
if (!ReadBongoConfiguration(SpamdConfigSchema, "antispam"))
return FALSE;
/* hmm, GetString needs a const char * since it is pointer to memory space that the caller should not modify,
* however ParseHost is going to need a char *. i've got to strdup it and then free it, or re-write
* ParseHost to do it. annoying! */
if (BongoJsonJPathGetString(node, "o:host/s", &tempHost) == BONGO_JSON_OK) {
char *lHost = MemStrdup(tempHost);
host = SPAMD_DEFAULT_ADDRESS;
port = SPAMD_DEFAULT_PORT;
weight = SPAMD_DEFAULT_WEIGHT;
for (i=0; i < BongoArrayCount(ASpam.spamd.hostlist); i++) {
char *hostitem = &BongoArrayIndex(ASpam.spamd.hostlist, char*, i);
char *lHost = MemStrdup(hostitem);
char *host;
int port, weight;
ParseHost(lHost, &host, &port, &weight);
ConnAddressPoolAddHost(&ASpam.spamd.hosts, host, port, weight);
MemFree(lHost);
@@ -391,7 +387,6 @@ SpamdReadConfiguration(SpamdConfig *spamd, BongoJsonNode *node)
void
SpamdShutdown(SpamdConfig *spamd)
{
spamd->enabled = FALSE;
ConnAddressPoolShutdown(&(spamd->hosts));
memset(spamd, 0, sizeof(SpamdConfig));
@@ -400,14 +395,7 @@ SpamdShutdown(SpamdConfig *spamd)
void
SpamdStartup(SpamdConfig *spamd)
{
if (spamd->enabled) {
if (spamd->hosts.addressCount == 0) {
ConnAddressPoolAddHost(&(spamd->hosts), SPAMD_DEFAULT_ADDRESS, SPAMD_DEFAULT_PORT, SPAMD_DEFAULT_WEIGHT);
}
return;
if (spamd->hosts.addressCount == 0) {
ConnAddressPoolAddHost(&(spamd->hosts), SPAMD_DEFAULT_ADDRESS, SPAMD_DEFAULT_PORT, SPAMD_DEFAULT_WEIGHT);
}
SpamdShutdown(spamd);
return;
}
+19 -56
View File
@@ -18,6 +18,7 @@
* may find current contact information at www.novell.com.
* </Novell-copyright>
* (C) 2007 Patrick Felt
* (C) 2007 Alex Hudson
****************************************************************************/
#include <config.h>
@@ -25,6 +26,7 @@
#include <xpl.h>
#include <memmgr.h>
#include <logger.h>
#include <bongoagent.h>
#include <bongoutil.h>
#include <mdb.h>
#include <nmap.h>
@@ -1174,58 +1176,32 @@ AntiVirusServer(void *ignored)
return;
}
static BongoConfigItem AVirusConfig[] = {
{ BONGO_JSON_INT, "o:flags/i", &AVirus.flags },
{ BONGO_JSON_STRING, "o:patterns/s", &AVirus.path.patterns },
{ BONGO_JSON_INT, "o:queue/i", &AVirus.nmap.queue },
{ BONGO_JSON_STRING, "o:host/s", &AVirus.clam.host },
{ BONGO_JSON_INT, "o:port/i", &AVirus.clam.addr.sin_port },
{ BONGO_JSON_NULL, NULL, NULL }
};
static BOOL
ReadConfiguration(void)
{
unsigned char path[XPL_MAX_PATH + 1];
XplDir *dir;
XplDir *dirEntry;
struct hostent *he;
unsigned char *pconfig;
BongoJsonNode *node;
BOOL retcode = TRUE;
BOOL enabled = FALSE;
const char *tmpBuffer;
BongoJsonResult res;
if (!NMAPReadConfigFile("antivirus", &pconfig)) {
printf("manager: couldn't read config from store\n");
return FALSE;
}
if (BongoJsonParseString(pconfig, &node) != BONGO_JSON_OK) {
printf("manager: couldn't parse JSON config\n");
retcode = FALSE;
goto finish;
}
if (! ReadBongoConfiguration(AVirusConfig, "antivirus"))
return FALSE;
AVirus.clam.addr.sin_family = AF_INET;
res = BongoJsonJPathGetBool(node, "o:enabled/b", &enabled);
if ((res != BONGO_JSON_OK) || (!enabled)) {
/* nothing configured or we are disabled */
return FALSE;
}
res = BongoJsonJPathGetInt(node, "o:flags/i", &AVirus.flags);
res = BongoJsonJPathGetString(node, "o:patterns/s", &AVirus.path.patterns);
res = BongoJsonJPathGetInt(node, "o:queue/i", (int *)&AVirus.nmap.queue);
res = BongoJsonJPathGetString(node, "o:host/s", &tmpBuffer);
if (res == BONGO_JSON_OK) {
struct hostent *he;
he = gethostbyname(tmpBuffer);
if (he) {
memcpy(&AVirus.clam.addr.sin_addr.s_addr, he->h_addr_list[0], sizeof(AVirus.clam.addr.sin_addr.s_addr));
}
MemFree(tmpBuffer);
} else {
AVirus.clam.addr.sin_addr.s_addr = inet_addr(CLAMAV_DEFAULT_ADDRESS);
}
res = BongoJsonJPathGetInt(node, "o:port/i", (int *)&AVirus.clam.addr.sin_port);
if (res == BONGO_JSON_OK) {
AVirus.clam.addr.sin_port = htons(AVirus.clam.addr.sin_port);
} else {
AVirus.clam.addr.sin_port = htons(CLAMAV_DEFAULT_PORT);
he = gethostbyname(AVirus.clam.host);
if (he) {
memcpy(&AVirus.clam.addr.sin_addr.s_addr, he->h_addr_list[0],
sizeof(AVirus.clam.addr.sin_addr.s_addr));
}
MsgGetWorkDir(AVirus.path.work);
@@ -1244,19 +1220,7 @@ ReadConfiguration(void)
XplCloseDir(dirEntry);
}
#if 0
MDBSetValueStructContext(NULL, config);
if (MDBRead(MSGSRV_ROOT, MSGSRV_A_ACL, config) > 0) {
HashCredential(MsgGetServerDN(NULL), config->Value[0], AVirus.nmap.hash);
}
MDBDestroyValueStruct(config);
#endif
finish:
BongoJsonNodeFree(node);
return retcode;
return TRUE;
}
#if defined(NETWARE) || defined(LIBC) || defined(WIN32)
@@ -1390,7 +1354,6 @@ XplServiceMain(int argc, char *argv[])
AVirus.handle.directory = NULL;
AVirus.handle.logging = NULL;
strcpy(AVirus.path.patterns, "sys:/");
strcpy(AVirus.nmap.address, "127.0.0.1");
XplSafeWrite(AVirus.server.active, 0);
+2 -1
View File
@@ -188,7 +188,7 @@ typedef struct _AVirusGlobals {
struct {
unsigned char work[XPL_MAX_PATH + 1];
unsigned char patterns[XPL_MAX_PATH + 1];
unsigned char *patterns;
} path;
struct {
@@ -214,6 +214,7 @@ typedef struct _AVirusGlobals {
} stats;
struct {
char *host;
struct sockaddr_in addr;
} clam;
} AVirusGlobals;
@@ -212,6 +212,7 @@ Cleanup(void *param)
unlink(buffer);
}
}
XplCloseDir(dir);
}
for (i = 0; i < (User.config.timeout * 60) && !UserUnloadOk; i++) {
-410
View File
@@ -111,25 +111,6 @@ static ProtocolCommand ImapProtocolCommands[] = {
void *IMAPConnectionPool = NULL;
/* Management Client Declarations */
BOOL ReadIMAPVariable(unsigned int Variable, unsigned char *Data, size_t *DataLength);
BOOL WriteIMAPVariable(unsigned int Variable, unsigned char *Data, size_t DataLength);
ManagementVariables IMAPManagementVariables[] = {
/* 0 #define PRODUCT_VERSION */ { DMCMV_REVISIONS, DMCMV_REVISIONS_HELP, ReadIMAPVariable, NULL },
/* 1 unsigned long Imap.session.threads.max */ { DMCMV_MAX_CONNECTION_COUNT, DMCMV_MAX_CONNECTION_COUNT_HELP, ReadIMAPVariable, WriteIMAPVariable },
/* 2 XplAtomic IMAPServerThreads */ { DMCMV_SERVER_THREAD_COUNT, DMCMV_SERVER_THREAD_COUNT_HELP, ReadIMAPVariable, NULL },
/* 3 XplAtomic Imap.session.threads.inUse */ { DMCMV_CONNECTION_COUNT, DMCMV_CONNECTION_COUNT_HELP, ReadIMAPVariable, NULL },
/* 4 XplAtomic Imap.session.threads.idle */ { DMCMV_IDLE_CONNECTION_COUNT, DMCMV_IDLE_CONNECTION_COUNT_HELP, ReadIMAPVariable, NULL },
/* 5 BOOL Imap.command.capability.acl.enabled */ { IMAPMV_ACL_ENABLED, IMAPMV_ACL_ENABLED_HELP, ReadIMAPVariable, NULL },
/* 6 BOOL Imap.server.disabled */ { DMCMV_RECEIVER_DISABLED, DMCMV_RECEIVER_DISABLED_HELP, ReadIMAPVariable, WriteIMAPVariable },
/* 7 unsigned char Imap.server.hostname[256] */ { DMCMV_HOSTNAME, DMCMV_HOSTNAME_HELP, ReadIMAPVariable, NULL },
/* 8 unsigned char Imap.server.postmaster[MAXEMAILNAMESIZE + 1] */ { DMCMV_POSTMASTER, DMCMV_POSTMASTER_HELP, ReadIMAPVariable, NULL },
/* 9 XplAtomic Imap.session.served */ { DMCMV_TOTAL_CONNECTIONS, DMCMV_TOTAL_CONNECTIONS_HELP, ReadIMAPVariable, WriteIMAPVariable },
/* 10 XplAtomic Imap.session.badPassword */ { DMCMV_BAD_PASSWORD_COUNT, DMCMV_BAD_PASSWORD_COUNT_HELP, ReadIMAPVariable, WriteIMAPVariable },
/* 11 unsigned char DMC Version */ { DMCMV_VERSION, DMCMV_VERSION_HELP, ReadIMAPVariable, NULL },
};
static void
FreeReturnValueIndex(unsigned long *index)
{
@@ -222,389 +203,6 @@ IMAPShutdown(unsigned char *Arguments, unsigned char **Response, BOOL *CloseConn
return(FALSE);
}
static BOOL
IMAPDMCCommandHelp(unsigned char *Arguments, unsigned char **Response, BOOL *CloseConnection)
{
BOOL responded = FALSE;
if (Response) {
if (Arguments) {
switch(toupper(Arguments[0])) {
case 'M': {
if (XplStrNCaseCmp(Arguments, DMCMC_DUMP_MEMORY_USAGE, sizeof(DMCMC_DUMP_MEMORY_USAGE) - 1) == 0) {
if ((*Response = MemStrdup(DMCMC_DUMP_MEMORY_USAGE_HELP)) != NULL) {
responded = TRUE;
}
break;
}
}
case 'C': {
if (XplStrNCaseCmp(Arguments, DMCMC_CONN_TRACE_USAGE, sizeof(DMCMC_CONN_TRACE_USAGE) - 1) == 0) {
if ((*Response = MemStrdup(DMCMC_CONN_TRACE_USAGE_HELP)) != NULL) {
responded = TRUE;
}
break;
}
}
case 'S': {
if (XplStrNCaseCmp(Arguments, DMCMC_STATS, sizeof(DMCMC_STATS) - 1) == 0) {
if ((*Response = MemStrdup(DMCMC_STATS_HELP)) != NULL) {
responded = TRUE;
}
break;
} else if (XplStrNCaseCmp(Arguments, DMCMC_SHUTDOWN, sizeof(DMCMC_SHUTDOWN) - 1) == 0) {
if ((*Response = MemStrdup(DMCMC_SHUTDOWN_HELP)) != NULL) {
responded = TRUE;
}
break;
}
}
default: {
break;
}
}
} else if ((*Response = MemStrdup(DMCMC_HELP_HELP)) != NULL) {
responded = TRUE;
}
if (responded || ((*Response = MemStrdup(DMCMC_UNKOWN_COMMAND)) != NULL)) {
return(TRUE);
}
}
return(FALSE);
}
static BOOL
SendIMAPStatistics(unsigned char *Arguments, unsigned char **Response, BOOL *CloseConnection)
{
MemStatistics poolStats;
if (!Arguments && Response) {
memset(&poolStats, 0, sizeof(MemStatistics));
*Response = MemMalloc(sizeof(PRODUCT_NAME) /* Long Name */
+ sizeof(PRODUCT_SHORT_NAME) /* Short Name */
+ 10 /* PRODUCT_MAJOR_VERSION */
+ 10 /* PRODUCT_MINOR_VERSION */
+ 10 /* PRODUCT_LETTER_VERSION */
+ 10 /* Connection Pool Alloc Count */
+ 10 /* Connection Pool Memory Usage */
+ 10 /* Connection Pool Pitches */
+ 10 /* Connection Pool Strikes */
+ 10 /* DMCMV_SERVER_THREAD_COUNT */
+ 10 /* DMCMV_CONNECTION_COUNT */
+ 10 /* DMCMV_IDLE_CONNECTION_COUNT */
+ 10 /* DMCMV_MAX_CONNECTION_COUNT */
+ 10 /* DMCMV_TOTAL_CONNECTIONS */
+ 10 /* DMCMV_BAD_PASSWORD_COUNT */
+ 28); /* Formatting */
MemPrivatePoolStatistics(IMAPConnectionPool, &poolStats);
if (*Response) {
sprintf(*Response, "%s (%s: v%d.%d.%d)\r\n%lu:%lu:%lu:%lu:%d:%d:%d:%lu:%d:%d\r\n",
PRODUCT_NAME,
PRODUCT_SHORT_NAME,
PRODUCT_MAJOR_VERSION,
PRODUCT_MINOR_VERSION,
PRODUCT_LETTER_VERSION,
poolStats.totalAlloc.count,
poolStats.totalAlloc.size,
poolStats.pitches,
poolStats.strikes,
XplSafeRead(Imap.server.active),
XplSafeRead(Imap.session.threads.inUse),
XplSafeRead(Imap.session.threads.idle),
Imap.session.threads.max,
XplSafeRead(Imap.session.served),
XplSafeRead(Imap.session.badPassword));
return(TRUE);
}
if ((*Response = MemStrdup("Out of memory.\r\n")) != NULL) {
return(TRUE);
}
} else if ((Arguments) && ((*Response = MemStrdup("Arguments not allowed.\r\n")) != NULL)) {
return(TRUE);
}
return(FALSE);
}
ManagementCommands IMAPManagementCommands[] = {
/* 0 HELP[ <IMAPCommand>] */ { DMCMC_HELP, IMAPDMCCommandHelp },
/* 1 SHUTDOWN */ { DMCMC_SHUTDOWN, IMAPShutdown },
/* 2 STATS */ { DMCMC_STATS, SendIMAPStatistics },
/* 3 MEMORY */ { DMCMC_DUMP_MEMORY_USAGE, ManagementMemoryStats },
/* 4 CONNTRACEFLAGS */ { DMCMC_CONN_TRACE_USAGE, ManagementConnTrace },
};
/* Management Client Read Function */
BOOL ReadIMAPVariable(unsigned int Variable, unsigned char *Data, size_t *DataLength)
{
unsigned long count;
unsigned char *ptr;
switch (Variable) {
case 0: { /* #define PRODUCT_VERSION */
unsigned char version[30];
PVCSRevisionToVersion(PRODUCT_VERSION, version);
count = strlen(version) + 11;
if (Data && (*DataLength > count)) {
ptr = Data;
PVCSRevisionToVersion(PRODUCT_VERSION, version);
ptr += sprintf(ptr, "imapd.c: %s\r\n", version);
*DataLength = ptr - Data;
} else {
*DataLength = count;
}
break;
}
case 1: { /* unsigned long Imap.session.threads.max */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", Imap.session.threads.max);
}
*DataLength = 12;
break;
}
case 2: { /* XplAtomic IMAPServerThreads */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", (long unsigned int)XplSafeRead(Imap.server.active));
}
*DataLength = 12;
break;
}
case 3: { /* XplAtomic Imap.session.threads.inUse */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", (long unsigned int)XplSafeRead(Imap.session.threads.inUse));
}
*DataLength = 12;
break;
}
case 4: { /* XplAtomic Imap.session.threads.idle */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", (long unsigned int)XplSafeRead(Imap.session.threads.idle));
}
*DataLength = 12;
break;
}
case 5: { /* BOOL Imap.command.capability.acl.enabled */
if (Imap.command.capability.acl.enabled == FALSE) {
ptr = "FALSE\r\n";
count = 7;
} else {
ptr = "TRUE\r\n";
count = 6;
}
if (Data && (*DataLength > count)) {
strcpy(Data, ptr);
}
*DataLength = count;
break;
}
case 6: { /* BOOL Imap.server.disabled */
if (Imap.server.disabled == FALSE) {
ptr = "FALSE\r\n";
count = 7;
} else {
ptr = "TRUE\r\n";
count = 6;
}
if (Data && (*DataLength > count)) {
strcpy(Data, ptr);
}
*DataLength = count;
break;
}
case 7: { /* unsigned char Imap.server.hostname[256] */
count = strlen(Imap.server.hostname) + 2;
if (Data && (*DataLength > count)) {
sprintf(Data, "%s\r\n", Imap.server.hostname);
}
*DataLength = count;
break;
}
case 8: { /* unsigned char Imap.server.postmaster[MAXEMAILNAMESIZE + 1] */
count = strlen(Imap.server.postmaster) + 2;
if (Data && (*DataLength > count)) {
sprintf(Data, "%s\r\n", Imap.server.postmaster);
}
*DataLength = count;
break;
}
case 9: { /* XplAtomic Imap.session.served */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", (long unsigned int)XplSafeRead(Imap.session.served));
}
*DataLength = 12;
break;
}
case 10: { /* XplAtomic Imap.session.badPassword */
if (Data && (*DataLength > 12)) {
sprintf(Data, "%010lu\r\n", (long unsigned int)XplSafeRead(Imap.session.badPassword));
}
*DataLength = 12;
break;
}
case 11: { /* unsigned char */
DMC_REPORT_PRODUCT_VERSION(Data, *DataLength);
break;
}
}
return(TRUE);
}
/* Management Client Write Function */
BOOL WriteIMAPVariable(unsigned int Variable, unsigned char *Data, size_t DataLength)
{
unsigned char *ptr;
unsigned char *ptr2;
BOOL result = TRUE;
if (!Data || !DataLength) {
return(FALSE);
}
switch (Variable) {
case 1: { /* unsigned long Imap.session.threads.max */
ptr = strchr(Data, '\n');
if (ptr) {
*ptr = '\0';
}
ptr2 = strchr(Data, '\r');
if (ptr2) {
ptr2 = '\0';
}
Imap.session.threads.max = atol(Data);
if (ptr) {
*ptr = '\n';
}
if (ptr2) {
*ptr2 = 'r';
}
break;
}
case 6: { /* BOOL Imap.server.disabled */
if ((toupper(Data[0]) == 'T') || (atol(Data) != 0)) {
Imap.server.disabled = TRUE;
} else if ((toupper(Data[0] == 'F')) || (atol(Data) == 0)) {
Imap.server.disabled = FALSE;
} else {
result = FALSE;
}
break;
}
case 9: { /* XplAtomic Imap.session.served */
ptr = strchr(Data, '\n');
if (ptr) {
*ptr = '\0';
}
ptr2 = strchr(Data, '\r');
if (ptr2) {
ptr2 = '\0';
}
XplSafeWrite(Imap.session.served, atol(Data));
if (ptr) {
*ptr = '\n';
}
if (ptr2) {
*ptr2 = 'r';
}
break;
}
case 10: { /* XplAtomic Imap.session.badPassword */
ptr = strchr(Data, '\n');
if (ptr) {
*ptr = '\0';
}
ptr2 = strchr(Data, '\r');
if (ptr2) {
ptr2 = '\0';
}
XplSafeWrite(Imap.session.badPassword, atol(Data));
if (ptr) {
*ptr = '\n';
}
if (ptr2) {
*ptr2 = 'r';
}
break;
}
case 0: /* #define PRODUCT_VERSION */
case 2: /* XplAtomic IMAPServerThreads */
case 3: /* XplAtomic Imap.session.threads.inUse */
case 4: /* XplAtomic Imap.session.threads.idle */
case 5: /* BOOL Imap.command.capability.acl.enabled */
case 7: /* unsigned char Imap.server.hostname[256] */
case 8: /* unsigned char Imap.server.postmaster[MAXEMAILNAMESIZE + 1] */
case 11: /* DMC Version */
default: {
result = FALSE;
break;
}
}
return(result);
}
static BOOL
IMAPSessionAllocCB(void *Buffer, void *ClientData)
{
@@ -4398,14 +3996,6 @@ XplServiceMain(int argc, char *argv[])
return 1;
}
/* Management Client Startup */
if ((ManagementInit(MSGSRV_AGENT_IMAP, Imap.directory.handle))
&& (ManagementSetVariables(IMAPManagementVariables, sizeof(IMAPManagementVariables) / sizeof(ManagementVariables)))
&& (ManagementSetCommands(IMAPManagementCommands, sizeof(IMAPManagementCommands) / sizeof(ManagementCommands)))) {
XplBeginThread(&id, ManagementServer, DMC_MANAGEMENT_STACKSIZE, NULL, ccode);
}
XplStartMainThread(PRODUCT_SHORT_NAME, &id, IMAPServer, 8192, NULL, ccode);
XplUnloadApp(XplGetThreadID());
+1 -1
View File
@@ -151,7 +151,7 @@ UserLogin(ImapSession *session, unsigned char **username, unsigned char *passwor
ccode = UserStoreInitialize(session, *username);
if (ccode == STATUS_CONTINUE) {
LoggerEvent(Imap.logHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_LOGIN, LOG_INFO,
0, session->user.name, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
0, *username, NULL, XplHostToLittle(session->client.conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
return(STATUS_CONTINUE);
}
}
+2 -1
View File
@@ -21,6 +21,8 @@
#include <config.h>
#include "queue.h"
#include <xpl.h>
#include <memmgr.h>
#include <logger.h>
@@ -33,7 +35,6 @@
#include <connio.h>
#include "conf.h"
#include "queue.h"
#include "domain.h"
#include "messages.h"
+326 -257
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -22,8 +22,8 @@
#ifndef QUEUE_H
#define QUEUE_H
#include "conf.h"
#include "queued.h"
#include "conf.h"
#define SPOOL_LOCK_ARRAY_SIZE 256
#define SPOOL_LOCK_IDARRAY_SIZE 64
@@ -92,6 +92,11 @@ typedef struct _Queue {
extern MessageQueue Queue;
FILE * fopen_check(FILE **handle, char *path, char *mode, int line);
int fclose_check(FILE **handle, int line);
int unlink_check(char *path, int line);
int rename_check(const char *oldpath, const char *newpath, int line);
BOOL QueueInit(void);
void QueueShutdown(void);
+16 -11
View File
@@ -21,9 +21,11 @@
#include <config.h>
#include "queue.h"
#include "queued.h"
#include <xpl.h>
#include <memmgr.h>
#include <logger.h>
#include <bongoutil.h>
#include <bongoagent.h>
#include <mdb.h>
@@ -32,9 +34,7 @@
#include <msgapi.h>
#include <connio.h>
#include "queued.h"
#include "conf.h"
#include "queue.h"
#include "domain.h"
#include "messages.h"
@@ -122,7 +122,7 @@ CommandAuth(void *param)
return(ConnWrite(client->conn, MSG1000OK, sizeof(MSG1000OK) - 1));
}
LoggerEvent(Agent.agent.loggingHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_WRONG_SYSTEM_AUTH, LOG_NOTICE, 0, NULL, NULL, XplHostToLittle(client->conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
Log(LOG_NOTICE, "SYSTEM AUTH failed from host %s", LOGIP(client->conn->socketAddress));
ConnWrite(client->conn, MSG3242BADAUTH, sizeof(MSG3242BADAUTH) - 1);
@@ -174,7 +174,7 @@ CommandPass(void *param)
return(ConnWrite(client->conn, MSG4120USERLOCKED, sizeof(MSG4120USERLOCKED) - 1));
}
LoggerEvent(Agent.agent.loggingHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_WRONG_USER_AUTH, LOG_NOTICE, 0, ptr, NULL, XplHostToLittle(client->conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
Log(LOG_NOTICE, "PASS USER failed for user from host %s", LOGIP(client->conn->socketAddress));
} else if ( (toupper(ptr[0]) == 'S')
&& (toupper(ptr[1]) == 'Y')
&& (toupper(ptr[2]) == 'S')
@@ -192,7 +192,7 @@ CommandPass(void *param)
}
#endif
LoggerEvent(Agent.agent.loggingHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_WRONG_SYSTEM_AUTH, LOG_NOTICE, 0, NULL, NULL, XplHostToLittle(client->conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
Log(LOG_NOTICE, "PASS SYSTEM failed from host %s", LOGIP(client->conn->socketAddress));
}
}
@@ -308,8 +308,7 @@ HandleCommand(QueueClient *client)
ccode = ConnWrite(client->conn, MSG3240NOAUTH, sizeof(MSG3240NOAUTH) - 1);
}
LoggerEvent(Agent.agent.loggingHandle, LOGGER_SUBSYSTEM_UNHANDLED, LOGGER_EVENT_UNHANDLED_REQUEST, LOG_INFO, 0, "Queue",
client->buffer, XplHostToLittle(client->conn->socketAddress.sin_addr.s_addr), 0, NULL, 0);
Log(LOG_INFO, "Handled command from %s", LOGIP(client->conn->socketAddress));
}
} else if (ccode == -1) {
break;
@@ -456,24 +455,26 @@ CheckDiskspace(BongoAgent *agent)
{
unsigned long freeBlocks;
unsigned long bytesPerBlock;
unsigned long wantFree;
bytesPerBlock = XplGetDiskBlocksize(Conf.spoolPath);
freeBlocks = XplGetDiskspaceFree(Conf.spoolPath);
wantFree = (Conf.minimumFree / bytesPerBlock) + 1;
if (freeBlocks != 0x7f000000) {
if (freeBlocks < ((Conf.minimumFree / bytesPerBlock) + 1)) {
if (freeBlocks < wantFree) {
/* BUG ALERT: */
/* With a block size of 4KB, freeBlocks could */
/* overflow if a volume had more than 16 TB. */
Agent.flags |= QUEUE_AGENT_DISK_SPACE_LOW;
LoggerEvent(Agent.agent.loggingHandle, LOGGER_SUBSYSTEM_GENERAL, LOGGER_EVENT_DISKSPACE_LOW, LOG_ERROR, 0, Conf.spoolPath, NULL, freeBlocks, (Conf.minimumFree/bytesPerBlock)+1, NULL, 0);
Log(LOG_ERROR, "Disk space for %s low: have %ld free, want %ld.", Conf.spoolPath, freeBlocks, wantFree);
} else {
Agent.flags &= ~QUEUE_AGENT_DISK_SPACE_LOW;
}
} else {
XplConsolePrintf("bongoqueue: The OS failed to respond to a disk space query\r\n");
Log(LOG_NOTICE, "Couldn't work out disk space free for %s", Conf.spoolPath);
}
}
@@ -535,6 +536,8 @@ XplServiceMain(int argc, char *argv[])
int ccode;
int startupOpts;
LogStart();
if (XplSetRealUser(MsgGetUnprivilegedUser()) < 0) {
XplConsolePrintf(AGENT_NAME ": Could not drop to unprivileged user '%s'\r\n" AGENT_NAME ": exiting.\n", MsgGetUnprivilegedUser());
return -1;
@@ -591,6 +594,8 @@ XplServiceMain(int argc, char *argv[])
/* Start the server thread */
XplStartMainThread(AGENT_NAME, &id, QueueServer, 8192, NULL, ccode);
LogShutdown();
XplUnloadApp(XplGetThreadID());
+2
View File
@@ -22,6 +22,8 @@
#ifndef QUEUED_H
#define QUEUED_H
#define LOGGERNAME "queue"
#include <xpl.h>
#include <connio.h>
#include <mdb.h>
+14 -24
View File
@@ -1767,8 +1767,8 @@ DeliverSMTPMessage (ConnectionStruct * Client, unsigned char *Sender,
else {
/* The other server supports ESMTP */
/* Should we deliver via SSL? */
if (AllowClientSSL && (Extensions & EXT_TLS)) {
// SSL delivery disabled per bug #9536
if (0 && AllowClientSSL && (Extensions & EXT_TLS)) {
snprintf (Answer, sizeof (Answer), "STARTTLS\r\n");
if (ConnWrite(Client->remotesmtp.conn, Answer, strlen(Answer)) < 1) {
DELIVER_ERROR (DELIVER_TRY_LATER);
@@ -2235,22 +2235,22 @@ DeliverRemoteMessage (ConnectionStruct * Client, unsigned char *Sender,
/* Clean up a potential ip address in the host name (e.g. jdoe@[1.1.1.1] ) */
if (Host[0] == '[') {
int host;
ptr = strchr (Host, ']');
if (ptr)
*ptr = '\0';
memmove (Host, Host + 1, strlen (Host + 1) + 1);
/* Check for an IP address */
int host;
Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = host;
if ((host = inet_addr (Host)) != -1) {
GoByAddr = TRUE;
UsingMX = FALSE;
}
Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = host;
}
if (!GoByAddr && UseRelayHost) {
int relayhost;
Client->remotesmtp.conn->socketAddress.sin_addr.s_addr=relayhost;
int relayhost = inet_addr(RelayHost);
Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = relayhost;
if (relayhost == -1) {
status=XplDnsResolve(RelayHost, &DNSARec, XPL_RR_A);
/*fprintf (stderr, "%s:%d Looked up relay host %s: %d\n", __FILE__, __LINE__, RelayHost, status);*/
@@ -3767,7 +3767,7 @@ ProcessLocalEntry (ConnectionStruct * Client, unsigned long Size,
static void
HandleQueueConnection (void *ClientIn)
{
int ReplyInt, Queue;
int ReplyInt, Queue = Q_INCOMING;
unsigned char Reply[1024];
ConnectionStruct *Client = (ConnectionStruct *) ClientIn;
unsigned char *ptr;
@@ -5093,11 +5093,10 @@ int XplServiceMain (int argc, char *argv[])
int ccode;
XplThreadID ID;
LogStart();
/* Done binding to ports, drop privs permanently */
if (XplSetEffectiveUser (MsgGetUnprivilegedUser ()) < 0) {
XplConsolePrintf
("bongosmtp: Could not drop to unprivileged user '%s', exiting.\n",
MsgGetUnprivilegedUser ());
Log(LOG_ERROR, "Could not drop to unprivileged user %s", MsgGetUnprivilegedUser());
return 1;
}
XplInit();
@@ -5122,15 +5121,12 @@ int XplServiceMain (int argc, char *argv[])
}
else {
MemoryManagerClose (MSGSRV_AGENT_SMTP);
XplConsolePrintf
("SMTPD: Unable to create connection pool; shutting down.\r\n");
Log(LOG_ERROR, "Unable to create connection pool, shutting down");
return (-1);
}
}
else {
XplConsolePrintf
("SMTPD: Unable to initialize memory manager; shutting down.\r\n");
Log(LOG_ERROR, "Unable to initialize memory manager, shutting down");
return (-1);
}
@@ -5138,10 +5134,7 @@ int XplServiceMain (int argc, char *argv[])
MDBInit ();
if ((SMTPDirectoryHandle = (MDBHandle) MsgInit ()) == NULL) {
XplBell ();
XplConsolePrintf
("\rSMTPD: Invalid directory credentials; exiting!\n");
XplBell ();
Log(LOG_ERROR, "Invalid directory credentials, shutting down");
MemoryManagerClose (MSGSRV_AGENT_SMTP);
@@ -5153,7 +5146,6 @@ int XplServiceMain (int argc, char *argv[])
XplRWLockInit (&ConfigLock);
LogStartup ();
for (ccode = 1; argc && (ccode < argc); ccode++) {
if (XplStrNCaseCmp (argv[ccode], "--forwarder=", 12) == 0) {
@@ -5165,7 +5157,7 @@ int XplServiceMain (int argc, char *argv[])
ReadConfiguration ();
if (ServerSocketInit () < 0) {
XplConsolePrintf ("bongosmtp: Exiting.\n");
Log(LOG_WARN, "Can't open ports, exiting");
return 1;
}
@@ -5192,9 +5184,7 @@ int XplServiceMain (int argc, char *argv[])
/* Done binding to ports, drop privs permanently */
if (XplSetRealUser (MsgGetUnprivilegedUser ()) < 0) {
XplConsolePrintf
("bongosmtp: Could not drop to unprivileged user '%s', exiting.\n",
MsgGetUnprivilegedUser ());
Log(LOG_ERROR, "Could not drop to unprivileged user %s", MsgGetUnprivilegedUser());
return 1;
}
+3 -3
View File
@@ -146,7 +146,7 @@ static int
ParseAlarmJson(BongoJsonObject *json, BongoArray *result, BongoMemStack *memstack)
{
BongoArray *alarms;
int i;
unsigned int i;
AlarmInfo *alarm = NULL;
if (BongoJsonObjectGetArray(json, "alarms", &alarms)) {
@@ -216,8 +216,8 @@ StoreSetAlarm(StoreClient *client,
BongoCalTime end;
BongoArray alarms;
BongoArray *occurrences = NULL;
int i;
int j;
unsigned int i;
unsigned int j;
/* parse the alarm info */
+2
View File
@@ -28,6 +28,8 @@ XPL_BEGIN_C_LINKAGE
const char * StoreProcessIncomingEvent(StoreClient *client, DStoreDocInfo *info, uint64_t linkGuid);
CCode StoreSetAlarm(StoreClient *client, DStoreDocInfo *docinfo, const char *alarmtext);
XPL_END_C_LINKAGE
#endif
+19 -23
View File
@@ -26,6 +26,7 @@
#include <time.h>
#include "stored.h"
#include "calendar.h"
#include "mail.h"
#include "conversations.h"
@@ -2147,7 +2148,7 @@ ShowInternalProperty(StoreClient *client,
{
CCode ccode;
BongoArray guidlist;
unsigned i;
unsigned int i;
BongoArrayInit(&guidlist, sizeof(uint64_t), 64);
@@ -3384,7 +3385,7 @@ StoreCommandFLAG(StoreClient *client, uint64_t guid, uint32_t change, int mode)
if (ccode) {
return ccode;
}
return ConnWriteF(client->conn, "1000 %lu %lu\r\n", info.flags, info.flags);
return ConnWriteF(client->conn, "1000 %u %u\r\n", info.flags, info.flags);
case STORE_FLAG_ADD:
oldFlags = info.flags;
info.flags |= change;
@@ -3458,7 +3459,7 @@ finish:
IndexClose(index);
}
return ConnWriteF(client->conn, "1000 %lu %lu\r\n", oldFlags, info.flags);
return ConnWriteF(client->conn, "1000 %u %u\r\n", oldFlags, info.flags);
}
@@ -3587,7 +3588,7 @@ StoreCommandMAILINGLISTS(StoreClient *client, char *source)
{
DStoreStmt *stmt;
uint32_t required;
CCode ccode;
CCode ccode = 0;
int dcode;
GetConversationSourceMask(source, &required);
@@ -3631,7 +3632,6 @@ StoreCommandMESSAGES(StoreClient *client, const char *source, const char *query,
uint64_t *guids = NULL;
char buf[200];
int total;
MaskAndFlagStruct mf = { flagsmask, flags };
uint32_t required;
ccode = StoreCheckAuthorizationGuid(client,
@@ -3700,7 +3700,7 @@ finish:
CCode
StoreCommandMFLAG(StoreClient *client, uint32_t change, int mode)
{
CCode ccode;
CCode ccode = 0;
CollectionLockPool collLocks;
WatchEventList events;
IndexHandle *index;
@@ -3832,7 +3832,7 @@ StoreCommandMFLAG(StoreClient *client, uint32_t change, int mode)
goto finish;
}
ccode = ConnWriteF(client->conn, "2001 %lu %lu\r\n", oldFlags, info.flags);
ccode = ConnWriteF(client->conn, "2001 %u %u\r\n", oldFlags, info.flags);
}
if (0 != DStoreCommitTransaction(client->handle)) {
@@ -3864,12 +3864,9 @@ CCode
StoreCommandMIME(StoreClient *client,
uint64_t guid)
{
#define XPL_MAX_RFC822_LINE 1000
int ccode = 0;
DStoreDocInfo info;
char path[XPL_MAX_PATH + 1];
char buffer[XPL_MAX_RFC822_LINE];
MimeReport *report = NULL;
NLockStruct *lock = NULL;
@@ -4372,8 +4369,8 @@ CCode
StoreCommandREINDEX(StoreClient *client, uint64_t guid)
{
IndexHandle *index;
CCode ccode;
int dcode;
CCode ccode = 0;
int dcode = 1;
DStoreStmt *stmt = NULL;
DStoreDocInfo info;
@@ -4387,9 +4384,13 @@ StoreCommandREINDEX(StoreClient *client, uint64_t guid)
ccode = ConnWriteStr(client->conn, MSG5005DBLIBERR);
goto finish;
}
while (stmt &&
1 == (dcode = DStoreInfoStmtStep(client->handle, stmt, &info)))
while (stmt && 1 == dcode)
{
dcode = DStoreInfoStmtStep(client->handle, stmt, &info);
if (-1 == dcode) {
ccode = ConnWriteStr(client->conn, MSG5005DBLIBERR);
goto finish;
}
if (guid) { /* kludgey */
DStoreStmtEnd(client->handle, stmt);
stmt = NULL;
@@ -4401,10 +4402,6 @@ StoreCommandREINDEX(StoreClient *client, uint64_t guid)
IndexDocument(index, client, &info);
}
if (-1 == dcode) {
ccode = ConnWriteStr(client->conn, MSG5005DBLIBERR);
}
ccode = ConnWriteStr(client->conn, MSG1000OK);
finish:
if (index) {
@@ -4426,12 +4423,12 @@ StoreCommandRENAME(StoreClient *client, DStoreDocInfo *collection,
CCode ccode = 0;
int dcode;
char oldfilename[STORE_MAX_PATH+1];
DStoreStmt *stmt = NULL;
DStoreDocInfo newcollection;
BongoArray subcolls;
BongoArray locks;
unsigned int i;
int success = 0;
DStoreStmt *stmt;
ccode = StoreCheckAuthorizationGuid(client, collection->collection,
STORE_PRIV_UNBIND);
@@ -5197,7 +5194,7 @@ WriteHelper(StoreClient *client,
int propcount)
{
CCode ccode;
size_t written = 0;
int written = 0;
const char *errmsg;
int i;
@@ -5306,7 +5303,7 @@ StoreCommandMWRITE(StoreClient *client,
DStoreDocInfo info;
IndexHandle *index = NULL;
BongoArray guidlist;
int i;
unsigned int i;
BongoArrayInit(&guidlist, sizeof(uint64_t), 64);
@@ -5354,8 +5351,7 @@ StoreCommandMWRITE(StoreClient *client,
unsigned long flags = 0;
int propcount = 0;
StorePropInfo props[PROP_ARR_SZ];
int n;
int status;
unsigned int n;
char buffer[CONN_BUFSIZE];
if (-1 == (ccode = ConnWriteStr(client->conn, MSG2054SENDDOCS)) ||
+5
View File
@@ -300,6 +300,11 @@ StoreProcessIncomingMail(StoreClient *client,
if (data.messageId) {
info->data.mail.messageId =
BongoMemStackPushStr(&client->memstack, data.messageId);
} else {
info->data.mail.messageId =
BONGO_MEMSTACK_ALLOC(&client->memstack, MAXEMAILNAMESIZE + 1);
snprintf(info->data.mail.messageId, MAXEMAILNAMESIZE + 1, "%u.%llu@%s",
info->timeCreatedUTC, info->guid, StoreAgent.agent.officialName);
}
if (data.parentMessageId) {
info->data.mail.parentMessageId =
+3 -4
View File
@@ -902,7 +902,6 @@ ImportIncomingMail(StoreClient *client)
struct stat sb;
IndexHandle *index = NULL;
long offset = 0;
int i;
CollectionLockPool collLocks;
WatchEventList events;
@@ -1700,7 +1699,7 @@ CollectionLockPoolInit(StoreClient *client, CollectionLockPool *pool)
void
CollectionLockPoolDestroy(CollectionLockPool *pool)
{
int i;
unsigned int i;
for (i = 0; i < pool->colls.len; i++) {
colldatum coll = BongoArrayIndex(&pool->colls, colldatum, i);
@@ -1717,7 +1716,7 @@ NLockStruct *
CollectionLockPoolGet(CollectionLockPool *pool, uint64_t guid)
{
colldatum coll;
int i;
unsigned int i;
for (i = 0; i < pool->colls.len; i++) {
colldatum coll = BongoArrayIndex(&pool->colls, colldatum, i);
@@ -1913,7 +1912,7 @@ WatchEventListAdd(WatchEventList *events,
void
WatchEventListFire(WatchEventList *events, StoreClient *client)
{
int i;
unsigned int i;
for (i = 0; i < events->len; i++) {
eventdatum evt = BongoArrayIndex(events, eventdatum, i);
@@ -11,7 +11,7 @@ from bongo.cmdparse import Command
from bongo import Privs, Xpl
from bongo.admin import Schema, Util
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
from bongo.Console import wrap
from bongo.MDB import MDB, MDBError
+1 -1
View File
@@ -22,7 +22,7 @@ def GetAttributeArgs(*objClasses):
return args
def GetAgentArgs():
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
attrs = {}
@@ -118,7 +118,7 @@ class DemoCommand(Command):
store.Flag(uid, DocFlags.Starred, FlagMode.Add)
def ImportCalendars(self, storename, demo) :
from bongo.libs import msgapi
from libbongo.libs import msgapi
dirname = demopath + "/calendars"
@@ -140,7 +140,7 @@ class DemoCommand(Command):
msgapi.IcsImport(storename, calname, None, "file://" + path, None, None)
def run(self, options, args):
from bongo.libs import msgapi
from libbongo.libs import msgapi
if len(args) > 0:
self.print_usage()
+1 -1
View File
@@ -20,7 +20,7 @@ def GetMdb(options, inSetup=False):
return MDB(user, options.authpass)
def GetContext(mdbDn, defContext=None):
from bongo.libs import msgapi
from libbongo.libs import msgapi
if '\\' in mdbDn:
return mdbDn.rsplit('\\', 1)
@@ -11,7 +11,7 @@ from bongo.cmdparse import Command
from bongo import Privs, Xpl
from bongo.admin import Schema, Util
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
from bongo.Console import wrap
import MdbUtil
@@ -10,7 +10,7 @@ from bongo.cmdparse import Command
from bongo import Privs, Xpl
from bongo.admin import Schema, Util
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
from bongo.Console import wrap
from bongo.MDB import MDB
@@ -11,7 +11,7 @@ from bongo.cmdparse import Command
from bongo import Privs, Xpl
from bongo.admin import Schema, Util
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
from bongo.Console import wrap
from bongo.MDB import MDB, MDBError
+14
View File
@@ -1,7 +1,13 @@
# -*- Makefile -*-
sbin_PROGRAMS += bongo-config
conf_defaults = \
src/apps/config/config/manager \
src/apps/config/config/antivirus \
src/apps/config/config/antispam
bongo_config_SOURCES := \
$(conf_defaults) \
src/apps/config/config.h \
src/apps/config/config.c
@@ -19,6 +25,14 @@ bongo_config_LDADD := \
$(GNUTLS_LIBS) \
$(ALL_LIBS)
confdir = $(pkgdatadir)/conf
conf_DATA := \
src/apps/config/default.set
src/apps/config/default.set: $(conf_defaults)
@(cd $(top_srcdir)/src/apps/config && tardir=config && $(am__tar)) > $@
src/apps/config/all: bongo-config
src/apps/config/clean: clean
src/apps/config/install:
+81 -41
View File
@@ -14,6 +14,7 @@
#include <gnutls/x509.h>
#include <gcrypt.h>
#include <time.h>
#include <tar.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "config.h"
@@ -79,13 +80,10 @@ SetAdminRights(StoreClient *client, char *document) {
}
BOOL
PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *content) {
int len;
PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *content, long len) {
CCode ccode;
char command[1024];
len = strlen(content);
snprintf(command, 1000, "INFO %s/%s\r\n", collection, filename);
ccode = NMAPSendCommandF(client->conn, command);
ccode = NMAPReadAnswer(client->conn, client->buffer, sizeof(client->buffer), TRUE);
@@ -94,11 +92,11 @@ PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *
if (ccode == 1000) {
// INFO returned OK, document already exists
snprintf(command, 1000, "REPLACE %s/%s %d\r\n",
snprintf(command, 1000, "REPLACE %s/%s %ld\r\n",
collection, filename, len);
} else {
// INFO errored, so document doesn't exist
snprintf(command, 1000, "WRITE %s %d %d \"F%s\"\r\n",
snprintf(command, 1000, "WRITE %s %d %ld \"F%s\"\r\n",
collection, STORE_DOCTYPE_CONFIG, len, filename);
}
@@ -119,6 +117,75 @@ PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *
return FALSE;
}
BOOL
ImportSystemBackupFile(const StoreClient *client, const char *path)
{
FILE *config;
char header[513];
CCode result;
result = NMAPSimpleCommand(client, "CREATE /config\r\n");
if ((result==1000) || (result==4226)) {
// collection can't be created and doesn't exist
XplConsolePrintf(_("ERROR: Couldn't create collection\n"));
return FALSE;
}
if (! SetAdminRights(client, "/config")) {
XplConsolePrintf(_("ERROR: Couldn't set acls on /config\n"));
return FALSE;
}
config = fopen(path, "r");
if (config == NULL) {
XplConsolePrintf(_("ERROR: Couldn't load default config set\n"));
return FALSE;
}
while(512 == fread(&header, sizeof(char), 512, config)) {
long filesize, blocksize, read;
char str_filesize[13], filename[101];
char *file;
header[512] = 0;
memcpy(&filename, &header, 100);
filename[100] = 0;
memcpy(&str_filesize, &header[124], 12);
str_filesize[12] = 0;
filesize = strtol(str_filesize, NULL, 8);
if (! strncmp(filename, "", 100)) {
// end of tar is _two_ empty blocks... ah well :o>
break;
}
blocksize = filesize / 512;
if (filesize % 512) blocksize++;
blocksize *= 512;
if (blocksize > 0 && !strncmp(filename, "config/", 7)) {
char fullpath[110];
file = MemMalloc((size_t) blocksize);
read = fread(file, sizeof(char), blocksize, config);
if (read != blocksize) {
XplConsolePrintf(" Read error!");
}
snprintf(fullpath, 108, "/%s", filename);
if (!PutOrReplaceConfig(client, "/config",
&filename[7], file, filesize)) {
XplConsolePrintf(_("ERROR: Couldn't write\n"));
} else {
if (! SetAdminRights(client, fullpath)) {
XplConsolePrintf(_("ERROR: rigts\n"));
}
}
MemFree(file);
}
}
fclose(config);
return TRUE;
}
void
InitialStoreConfiguration() {
char path[XPL_MAX_PATH];
@@ -151,7 +218,6 @@ InitialStoreConfiguration() {
exit(1);
} else { // parent
StoreClient *client;
int result = 0;
XplDelay(1000); // FIXME: small hack, wait for store to start.
@@ -174,41 +240,15 @@ InitialStoreConfiguration() {
XplConsolePrintf(_("ERROR: Couldn't access store\n"));
goto nmapcleanup;
}
result = NMAPSimpleCommand(client, "CREATE /config\r\n");
if ((result==1000) || (result==4226)) {
// collection can't be created and doesn't exist
XplConsolePrintf(_("ERROR: Couldn't create collection\n"));
goto nmapcleanup;
}
if (! SetAdminRights(client, "/config")) {
XplConsolePrintf(_("ERROR: Couldn't set acls on /config\n"));
goto nmapcleanup;
}
XplConsolePrintf(_("Setting default agent configuration...\n"));
if (!PutOrReplaceConfig(client, "/config", "manager", bongo_manager_config)) {
XplConsolePrintf(_("ERROR: couldn't write /config/manager\n"));
}
if (! SetAdminRights(client, "/config/manager")) {
XplConsolePrintf(_("ERROR: Couldn't set acls on /config/manager\n"));
goto nmapcleanup;
}
if (!PutOrReplaceConfig(client, "/config", "antivirus", bongo_avirus_config)) {
XplConsolePrintf(_("ERROR: couldn't write /config/antivirus\n"));
}
if (! SetAdminRights(client, "/config/antivirus")) {
XplConsolePrintf(_("ERROR: Couldn't set acls on /config/antivirus\n"));
goto nmapcleanup;
}
if (!PutOrReplaceConfig(client, "/config", "antispam", bongo_aspam_config)) {
XplConsolePrintf(_("ERROR: couldn't write /config/antispam\n"));
}
if (! SetAdminRights(client, "/config/antispam")) {
XplConsolePrintf(_("ERROR: Couldn't set acls on /config/antispam\n"));
goto nmapcleanup;
}
XplConsolePrintf(_("Complete.\n"));
XplConsolePrintf(_("Setting default agent configuration...\n"));
snprintf(path, XPL_MAX_PATH, "%s/conf/default.set", XPL_DEFAULT_DATA_DIR);
if (! ImportSystemBackupFile(client, path)) {
XplConsolePrintf(_("ERROR: Couldn't setup default configuration\n"));
} else {
XplConsolePrintf(_("Complete.\n"));
}
nmapcleanup:
NMAPQuit(client->conn);
+1 -37
View File
@@ -28,49 +28,13 @@ void usage(void);
void RunAsBongoUser(void);
BOOL NMAPSimpleCommand(StoreClient *client, char *command);
BOOL SetAdminRights(StoreClient *client, char *document);
BOOL PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *content);
BOOL PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *content, long len);
void InitialStoreConfiguration(void);
void GetInteractiveData(char *description, char **data, char *def);
BOOL GenerateCryptoData(void);
void CheckVersion(void);
void TzCache(void);
/* bongo manager config is an object. One key should be 'agents', whose value
* is an array of agent objects. Agent objects can have names, pri (priority)
* and be enabled. Priorities are roughly in terms of dependency and/or which
* order we want things to start in. Low pri == important, high pri == do this
* last.
*/
static char *bongo_manager_config =
"{ \"version\": 1, \n"
" \"agents\": [ \n"
" { \"name\": \"bongoqueue\", \"pri\": 3, \"enabled\": true },\n"
" { \"name\": \"bongosmtp\", \"pri\": 3, \"enabled\": true },\n"
" { \"name\": \"bongoantispam\", \"pri\": 5, \"enabled\": true },\n"
" { \"name\": \"bongoavirus\", \"pri\": 5, \"enabled\": true },\n"
" { \"name\": \"bongocollector\", \"pri\": 7, \"enabled\": true },\n"
" { \"name\": \"bongomailprox\", \"pri\": 7, \"enabled\": true },\n"
" { \"name\": \"bongoconnmgr\", \"pri\": 2, \"enabled\": true },\n"
" { \"name\": \"bongopluspack\", \"pri\": 5, \"enabled\": true },\n"
" { \"name\": \"bongorules\", \"pri\": 2, \"enabled\": true },\n"
" { \"name\": \"bongoimap\", \"pri\": 10, \"enabled\": true },\n"
" { \"name\": \"bongopop3\", \"pri\": 10, \"enabled\": true },\n"
" { \"name\": \"bongocalcmd\", \"pri\": 7, \"enabled\": true }\n"
" ]\n"
"}\n";
static char *bongo_aspam_config =
"{ \"version\": 1, \n"
" \"enabled\": true\n"
"}\n";
static char *bongo_avirus_config =
"{ \"version\": 1, \n"
" \"enabled\": true, \n"
" \"flags\": 168\n"
"}\n";
/* compat with older gnutls */
#ifndef GNUTLS_DIG_SHA1
// older GNUTLS
+5
View File
@@ -0,0 +1,5 @@
{
"version": 1,
"timeout": 15,
"hosts": [ "127.0.0.1" ]
}
+8
View File
@@ -0,0 +1,8 @@
{
"version": 1,
"flags": 168,
"patterns": "",
"queue": 5,
"host": "127.0.0.1",
"port": 3310
}
+23
View File
@@ -0,0 +1,23 @@
/* bongo manager config is an object. One key should be 'agents', whose value
* is an array of agent objects. Agent objects can have names, pri (priority)
* and be enabled. Priorities are roughly in terms of dependency and/or which
* order we want things to start in. Low pri == important, high pri == do this
* last.
*/
{ "version": 1,
"agents": [
{ "name": "bongoqueue", "pri": 3, "enabled": true },
{ "name": "bongosmtp", "pri": 3, "enabled": true },
{ "name": "bongoantispam", "pri": 5, "enabled": true },
{ "name": "bongoavirus", "pri": 5, "enabled": true },
{ "name": "bongocollector", "pri": 7, "enabled": true },
{ "name": "bongomailprox", "pri": 7, "enabled": true },
{ "name": "bongoconnmgr", "pri": 2, "enabled": true },
{ "name": "bongopluspack", "pri": 5, "enabled": true },
{ "name": "bongorules", "pri": 2, "enabled": true },
{ "name": "bongoimap", "pri": 10, "enabled": true },
{ "name": "bongopop3", "pri": 10, "enabled": true },
{ "name": "bongocalcmd", "pri": 7, "enabled": true }
]
}
+3 -3
View File
@@ -423,8 +423,7 @@ Lock(BOOL force)
exit(1);
}
snprintf(pidstr, sizeof(pidstr), "%dl\n", pid);
remaining = sizeof(pidstr);
remaining = snprintf(pidstr, sizeof(pidstr), "%ld\n", pid);
ret = 0;
written = 0;
@@ -601,7 +600,7 @@ StartSlapd(BOOL killExisting)
return 1;
}
} else {
fprintf(stderr, _("bongo-manager: managed-slapd appears to be running as pid %dl\n"), pid);
fprintf(stderr, _("bongo-manager: managed-slapd appears to be running as pid %ld\n"), pid);
fprintf(stderr, _("bongo-manager: if this is definitely the bongo slapd, you can run with -e to kill it\n"));
return 1;
}
@@ -638,6 +637,7 @@ StartSlapd(BOOL killExisting)
"-f", XPL_DEFAULT_CONF_DIR "/bongo-slapd.conf",
"-h", url,
"-n", "bongo-slapd",
"-s", "0",
NULL);
exit(1);
+1 -1
View File
@@ -26,7 +26,7 @@ from bongo.nmap.NmapClient import DocFlags as NmapDocFlags
from bongo.store.StoreClient import *
from bongo.libs import bongojson, JsonArray, JsonObject, msgapi, cal, bongoutil
from libbongo.libs import bongojson, JsonArray, JsonObject, msgapi, cal, bongoutil
class EventHolder:
+5 -5
View File
@@ -25,7 +25,7 @@ import os, random, signal, socket, string, sys
from bongo import Xpl, BongoError, Privs
from bongo.admin import ManagedSlapd, Util
from bongo.bootstrap import msgapi
from libbongo.bootstrap import msgapi
from bongo.Console import wrap
@@ -141,7 +141,7 @@ See \"%(bongo_setup)s --help\" for command-line options to further automate the
# see if the bongomanager pid is still running
try:
pid = int(pid)
pid = long(pid)
r = os.kill(pid, 0)
raise BongoError("""A possibly stale bongomanager pid file has been found. Either kill process %d (if it is bongomanager) or remove %s""" % (pid, pidfile))
except OSError, e:
@@ -485,14 +485,14 @@ def ImportObjects(mdbconf, options):
if mdbconf.has_key("slapdConfig"):
slapdConfig = mdbconf["slapdConfig"]
log.debug("initializing slapd with the base Bongo container")
pid = slapdConfig.initSlapd(mdbconf["slapdConfigFile"])
log.debug("starting temporary managed slapd process")
pid = slapdConfig.startSlapd(mdbconf["slapdConfigFile"])
if pid is None:
raise BongoError('Error starting temporary slapd process. Check syslog for information about the failure.')
log.debug("initializing slapd with the base Bongo container")
slapdConfig.initSlapd()
options.file = Input('Enter file for importing objects',
default=options.file, options=options)
+2 -1
View File
@@ -6,7 +6,8 @@ pkgpythonstoretool_PYTHON := \
src/apps/storetool/bongo/storetool/CalendarCommands.py \
src/apps/storetool/bongo/storetool/ContactCommands.py \
src/apps/storetool/bongo/storetool/InteractiveCommands.py \
src/apps/storetool/bongo/storetool/MailCommands.py
src/apps/storetool/bongo/storetool/MailCommands.py \
src/apps/storetool/bongo/storetool/ExportMailbox.py
src/apps/storetool/bongo-storetool: $(top_builddir)/src/libs/python/bongo-python-wrapper
$(INSTALL) -m 755 $< $@
@@ -18,7 +18,7 @@ import bongo.table as table
from bongo.cmdparse import Command
from bongo.Contact import Contact
from bongo.BongoError import BongoError
from bongo.libs import bongojson, msgapi
from libbongo.libs import bongojson, msgapi
from bongo.store.StoreClient import DocTypes, StoreClient, CalendarACL
from bongo.store.QueueClient import QueueClient
@@ -0,0 +1,119 @@
import os
import re
import socket
import errno
import cStringIO
import mailbox
import email, email.Generator
import sys
from time import time, mktime, strptime, ctime, sleep
from rfc822 import Message, parsedate_tz, mktime_tz
class MboxMailbox(mailbox.PortableUnixMailbox):
def __init__(self,file):
mailbox.PortableUnixMailbox.__init__(self, file, email.message_from_file)
self.boxname = file
self.content = ""
def add(self, msg):
fp = cStringIO.StringIO()
g = email.Generator.Generator(fp, mangle_from_=False)
envelope = email.message_from_string(msg)
g.flatten(envelope, unixfrom=True)
self.content += "%s" % fp.getvalue()
def write(self):
outfile=file(self.boxname, "wb")
outfile.write("%s\n" % self.content)
outfile.close()
class MaildirMailbox(mailbox.Maildir):
def __init__(self,file):
if file[-1] == "/":
self.boxname = file
else:
self.boxname = file + "/"
while 1:
try:
os.makedirs(self.boxname + "cur")
os.makedirs(self.boxname + "new")
os.makedirs(self.boxname + "tmp")
except OSError, err:
if err.errno == errno.EEXIST:
break
mailbox.Maildir.__init__(self, file, email.message_from_file)
def tmp_open(self):
hostname = socket.gethostname()
pid = os.getpid()
while 1:
name = "tmp/%.6f%05d.%s" % (time(), pid, hostname)
try:
os.stat(name)
except OSError, err:
if err.errno == errno.ENOENT:
break
fd = os.open(name, os.O_WRONLY|os.O_EXCL|os.O_CREAT, 0600)
return (name, fd)
def status(self, message):
status = message.get("Status")
if status == "O":
dir = "cur"
info = ""
elif status == "RO":
dir = "cur"
info = ":2,S"
else:
dir = "new"
info = ""
return (dir, info)
def get_delivery_time(self, message):
dtime = None
if message.has_key("Date"):
dtime = mktime_tz(parsedate_tz(message["Date"]))
return dtime
def write_message(self, raw_msg, fd, tmp):
try:
os.write(fd, raw_msg)
os.fsync(fd)
os.close(fd)
except OSError, err:
os.unlink(tmp)
raise Error("unable to fsync() or close() temp file: %s" % err)
def finish_message(self, tmp, dir, info, dtime):
base_name = os.path.basename(tmp)
dst_name = os.path.join(dir, base_name + info)
os.link(tmp, dst_name)
if dtime is not None:
atime = os.stat(dst_name).st_atime
os.utime(dst_name, (atime, dtime))
return dst_name
def add(self, raw_msg):
start_dir = os.getcwd()
os.chdir(self.boxname)
(tmp, fd) = self.tmp_open()
try:
fp = cStringIO.StringIO(raw_msg)
message = Message(fp)
(dir, info) = self.status(message)
dtime = self.get_delivery_time(message)
self.write_message(raw_msg, fd, tmp)
dst_name = self.finish_message(tmp, dir, info, dtime)
finally:
os.unlink(tmp)
os.chdir(start_dir)
@@ -3,37 +3,50 @@ import logging
import mailbox
import sys
from gettext import gettext as _
from bongo.cmdparse import Command
from bongo.BongoError import BongoError
from bongo.libs import bongojson, msgapi
from libbongo.libs import bongojson, msgapi
from bongo.store.StoreClient import DocTypes, StoreClient
from bongo.storetool.ExportMailbox import MboxMailbox, MaildirMailbox
class MailStoreCommand(Command):
class MailImportCommand(Command):
log = logging.getLogger("Bongo.StoreTool")
def __init__(self):
Command.__init__(self, "mail-store", aliases=["ms"],
summary="Store individual mail messages",
Command.__init__(self, "mail-import", aliases=["mi"],
summary="Import mail into the store",
usage="%prog %cmd <file1> [<file2> ...]")
def ImportFile(self, store, file):
if file == "-":
import tempfile
fd = tempfile.TemporaryFile(mode="w+b")
try:
for line in sys.stdin: fd.write(line)
except StopIteration: pass
fd.seek(0)
else:
fd = open(file)
self.add_option("-t", "--type", type="string", default="mbox", help=_("Type of mail source [mbox or maildir], defaults to mbox"))
self.add_option("-f", "--folder", type="string", default="INBOX", help=_("Folder to import to, defaults to INBOX"))
mbox = mailbox.PortableUnixMailbox(fd, email.message_from_file)
def ImportFile(self, store, file, type, folder):
collection = "/mail/" + folder
store.Create(collection, existingOk=True)
for msg in mbox:
if type == "mbox":
if file == "-":
import tempfile
fd = tempfile.TemporaryFile(mode="w+b")
try:
for line in sys.stdin: fd.write(line)
except StopIteration: pass
fd.seek(0)
else:
fd = open(file)
mailstore = mailbox.PortableUnixMailbox(fd, email.message_from_file)
elif type == "maildir":
mailstore = mailbox.Maildir(file, email.message_from_file)
for msg in mailstore:
data = msg.as_string(True)
store.Write("/mail/INBOX", DocTypes.Mail, data)
store.Write(collection, DocTypes.Mail, data)
fd.close()
if fd:
fd.close()
def Run(self, options, args):
if len(args) == 0:
@@ -45,7 +58,56 @@ class MailStoreCommand(Command):
try:
for file in args:
try:
self.ImportFile(store, file)
self.ImportFile(store, file, options.type, options.folder)
except IOError, e:
print str(e)
finally:
store.Quit()
class MailExportCommand(Command):
log = logging.getLogger("Bongo.StoreTool")
def __init__(self):
Command.__init__(self, "mail-export", aliases=["me"],
summary="Export mail from the store",
usage="%prog %cmd <file1> [<file2> ...]")
self.add_option("-t", "--type", type="string", default="mbox", help=_("Type of mail destination [mbox or maildir], defaults to mbox"))
self.add_option("-f", "--folder", type="string", default="INBOX", help=_("Folder to export from, defaults to INBOX"))
def ExportFile(self, store, file, type, folder):
collection = "/mail/" + folder
mail_list = list(store.List(collection, ["nmap.guid"]))
if type == "mbox":
mbox = MboxMailbox(file)
for mail in mail_list:
if mail.type != DocTypes.Mail:
continue
msg = store.Read(mail.props["nmap.guid"])
mbox.add(msg)
mbox.write()
elif type == "maildir":
maildir = MaildirMailbox(file)
for mail in mail_list:
if mail.type != DocTypes.Mail:
continue
msg = store.Read(mail.props["nmap.guid"])
maildir.add(msg)
def Run(self, options, args):
if len(args) == 0:
self.print_help()
self.exit()
store = StoreClient(options.user, options.store)
try:
for file in args:
try:
self.ExportFile(store, file, options.type, options.folder)
except IOError, e:
print str(e)
finally:
+2 -2
View File
@@ -223,7 +223,7 @@ BongoHashtableCreateFull(int buckets,
DeleteFunction keydeletefunc, DeleteFunction valuedeletefunc)
{
BongoHashtable *table;
const int size = sizeof(BongoHashtable) + buckets * sizeof(struct BongoHashtableEntry *);
const int size = ALIGN_SIZE(sizeof(BongoHashtable), ALIGNMENT) + buckets * ALIGN_SIZE(sizeof(struct BongoHashtableEntry *), ALIGNMENT);
table = MemMalloc(size);
if (!table) {
@@ -237,7 +237,7 @@ BongoHashtableCreateFull(int buckets,
table->keydeletefunc = keydeletefunc;
table->valuedeletefunc = valuedeletefunc;
memset(&(table->buckets[0]), 0, buckets * sizeof(struct BongoHashtableEntry *));
//memset(&(table->buckets[0]), 0, buckets * ALIGN_SIZE(sizeof(struct BongoHashtableEntry *), ALIGNMENT));
return table;
}
+3
View File
@@ -479,10 +479,13 @@ BongoJsonParserNextNode(BongoJsonParser *t)
BongoStrTrim(s);
if (!strcmp(s, "true")) {
MemFree(s);
return BongoJsonNodeNewBool(TRUE);
} else if (!strcmp(s, "false")) {
MemFree(s);
return BongoJsonNodeNewBool(FALSE);
} else if (!strcmp(s, "null")) {
MemFree(s);
return BongoJsonNodeNewNull();
}
+5
View File
@@ -1,6 +1,11 @@
# -*- Makefile -*-
lib_LTLIBRARIES += libbongologger.la
logconfdir := $(XPL_DEFAULT_CONF_DIR)
dist_logconf_DATA := \
src/libs/logger/logs.conf
libbongologger_la_SOURCES := \
src/libs/logger/bongo.lsc \
src/libs/logger/logger-format.pl \
+9 -1
View File
@@ -45,7 +45,15 @@ LoggerClose(LoggingHandle *handle)
EXPORT LoggingHandle *
LoggerOpen(const char *name)
{
log4c_init();
char bongo_log_file[XPL_MAX_PATH];
if (log4c_init() == -1) {
// log4c couldn't find a file itself, let's default to etc/bongo/logs.conf
snprintf(bongo_log_file, XPL_MAX_PATH, "%s/logs.conf", XPL_DEFAULT_CONF_DIR);
if (log4c_load(bongo_log_file) == -1) {
XplConsolePrintf("ERROR: Unable to find log config %s\n", bongo_log_file);
}
}
return (LoggingHandle*)1;
}
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE log4c SYSTEM "">
<log4c version="0.1.0">
<config>
<bufsize>0</bufsize>
<debug level="2"/>
<nocleanup>0</nocleanup>
<reread>1</reread>
</config>
<category name="root" priority="unknown" appender="syslog"/>
<category name="smtpd" priority="unknown" appender="syslog"/>
<category name="connmgr" priority="unknown" appender="syslog"/>
<category name="antispamd" priority="unknown" appender="syslog"/>
<category name="avirusd" priority="unknown" appender="syslog"/>
<category name="connmgrd" priority="unknown" appender="syslog"/>
<category name="imapd" priority="unknown" appender="syslog"/>
<category name="mailproxd" priority="unknown" appender="syslog"/>
<category name="mailproxdimapd" priority="unknown" appender="syslog"/>
<category name="mailproxdpopd" priority="unknown" appender="syslog"/>
<category name="pluspackd" priority="unknown" appender="syslog"/>
<category name="pop3d" priority="unknown" appender="syslog"/>
<category name="queued" priority="unknown" appender="syslog"/>
<category name="rulesd" priority="unknown" appender="syslog"/>
<category name="queueagnt" priority="unknown" appender="syslog"/>
<category name="queueagnt" priority="unknown" appender="syslog"/>
<category name="queueagnt" priority="unknown" appender="syslog"/>
<category name="funtest" priority="unknown" appender="stderr"/>
<appender name="stdout" type="stream" layout="basic"/>
<appender name="stderr" type="stream" layout="dated"/>
<appender name="syslog" type="syslog" layout="basic"/>
<layout name="basic" type="basic"/>
<layout name="dated" type="dated"/>
</log4c>
+56 -56
View File
@@ -371,7 +371,10 @@ MdbToLdap(char *MdbDn)
LDAPMessage *entry = NULL;
XplRWReadLockAcquire(&(MdbLdap.PathLock));
path = (char *) BongoHashtableGet(MdbLdap.PathTable, MdbDn);
path = BongoHashtableGet(MdbLdap.PathTable, MdbDn);
if (path) {
path = strdup(path);
}
XplRWReadLockRelease(&(MdbLdap.PathLock));
if (!path) {
@@ -380,7 +383,8 @@ MdbToLdap(char *MdbDn)
if (obj) {
if (obj == MdbDn) {
*obj++ = '\0';
base = "";
base = malloc(MDB_MAX_OBJECT_CHARS + 1);
base[0] = '\0';
scope = LDAP_SCOPE_BASE;
} else {
*obj++ = '\0';
@@ -402,7 +406,7 @@ MdbToLdap(char *MdbDn)
if (dn) {
expdn = ldap_explode_dn(dn, 1);
if (expdn && expdn[0]) {
if (expdn) {
/* Some directories allow multiple entries at
the same level that have the same name but
different naming types. This comparison
@@ -412,7 +416,7 @@ MdbToLdap(char *MdbDn)
MDB API and can only be fixed by
introducing naming types into MDB or by
restricting use of the directory. */
if (!strcasecmp(expdn[0], obj)) {
if (expdn[0] && !strcasecmp(expdn[0], obj)) {
path = strdup(dn);
}
@@ -451,7 +455,7 @@ MdbToLdap(char *MdbDn)
XplMutexUnlock(MdbLdap.LdapMutex);
if (*base != '\0') {
if (base) {
free(base);
}
}
@@ -462,42 +466,19 @@ MdbToLdap(char *MdbDn)
}
if (path) {
char *mdbDn;
char *ldapDn;
XplRWReadLockAcquire(&(MdbLdap.PathLock));
if (!(ldapDn = BongoHashtableGet(MdbLdap.PathTable, MdbDn))) {
XplRWReadLockRelease(&(MdbLdap.PathLock));
mdbDn = strdup(MdbDn);
if (mdbDn) {
XplRWWriteLockAcquire(&(MdbLdap.PathLock));
if (BongoHashtablePut(MdbLdap.PathTable, mdbDn, path)) {
free(mdbDn);
free(path);
path = NULL;
}
XplRWWriteLockRelease(&(MdbLdap.PathLock));
} else {
free(path);
path = NULL;
}
} else {
XplRWReadLockRelease(&(MdbLdap.PathLock));
free(path);
path = ldapDn;
char *mdbDn, *ldapDn;
mdbDn = strdup(MdbDn);
ldapDn = strdup(path);
XplRWWriteLockAcquire(&(MdbLdap.PathLock));
if (BongoHashtablePut(MdbLdap.PathTable, mdbDn, ldapDn)) {
free(mdbDn);
free(ldapDn);
}
XplRWWriteLockRelease(&(MdbLdap.PathLock));
}
}
if (path) {
return strdup(path);
}
return NULL;
return path;
}
static char *
@@ -542,6 +523,7 @@ LdapToAbsoluteMdb(const char *LdapDn, const char *Base)
if (mdbDn) {
absDn = GetAbsoluteDn(mdbDn, Base);
free(mdbDn);
}
return absDn;
@@ -557,6 +539,7 @@ LdapToRelativeMdb(const char *LdapDn, const char *Base)
if (mdbDn) {
relDn = GetRelativeDn(mdbDn, Base);
free(mdbDn);
}
return relDn;
@@ -1514,11 +1497,15 @@ AttrUpdate(char *key, MDBLDAPSchemaAttr *attr, void *data)
attr->singleval = ptr->singleval;
}
/* FIXME: this function already recurses.
figure out what this is supposed to do. */
#if 0
if (ptr->sup) {
ptr = BongoHashtableGet(MdbLdap.AttrTable, ptr->sup);
} else {
ptr = NULL;
}
#endif
}
attr->visited = TRUE;
@@ -1594,8 +1581,8 @@ LoadSchemaAttrs(void)
if (attr) {
memset(attr, 0, sizeof(MDBLDAPSchemaAttr));
attr->val = vals[i];
result = ParseAttributeTypeDescription(vals[i], attr);
attr->val = strdup(vals[i]);
result = ParseAttributeTypeDescription(attr->val, attr);
if (result && attr->names && attr->names[0]) {
for (j = 0; attr->names[j]; j++) {
@@ -1606,10 +1593,13 @@ LoadSchemaAttrs(void)
}
} else {
result = FALSE;
free(attr->val);
free(attr);
break;
}
} else {
result = FALSE;
break;
}
}
@@ -1617,6 +1607,7 @@ LoadSchemaAttrs(void)
BongoHashtableForeach(MdbLdap.AttrTable, (HashtableForeachFunc)AttrUpdate, NULL);
}
FreeValArray(vals);
free(vals);
} else {
result = FALSE;
@@ -1817,8 +1808,8 @@ LoadSchemaClasses(void)
if (class) {
memset(class, 0, sizeof(MDBLDAPSchemaClass));
class->val = vals[i];
result = ParseObjectClassDescription(vals[i], class);
class->val = strdup(vals[i]);
result = ParseObjectClassDescription(class->val, class);
if (result && class->names && class->names[0]) {
for (j = 0; class->names[j]; j++) {
@@ -1862,10 +1853,13 @@ LoadSchemaClasses(void)
}
} else {
result = FALSE;
free(class->val);
free(class);
break;
}
} else {
result = FALSE;
break;
}
}
@@ -1873,6 +1867,7 @@ LoadSchemaClasses(void)
BongoHashtableForeach(MdbLdap.ClassTable, (HashtableForeachFunc)ClassUpdate, NULL);
}
FreeValArray(vals);
free(vals);
} else {
result = FALSE;
@@ -1946,7 +1941,7 @@ InitTranslations(void)
translations. If translation is NULL, no specific translation is known.
If the name contains illegal LDAP characters, a translation will be
generated and registered for the name. */
char *trans_table[][2] = {
static char *trans_table[][2] = {
{C_AFP_SERVER, NULL},
{C_ALIAS, "alias"}, /* RFC2256 */
{C_BINDERY_OBJECT, NULL},
@@ -2200,7 +2195,7 @@ static BongoHashtable *
MdbAttrsToLdapAttrs(MDBValueStruct *Attribute, MDBValueStruct *Data)
{
char *type, *value, **values;
MDBLDAPSchemaAttr *attr;
MDBLDAPSchemaAttr *attr = NULL;
int inc = 12, last;
unsigned int i;
BongoHashtable *attrs;
@@ -2236,6 +2231,7 @@ MdbAttrsToLdapAttrs(MDBValueStruct *Attribute, MDBValueStruct *Data)
}
if (BongoHashtablePut(attrs, type, values)) {
FreeValArray(values);
break;
}
}
@@ -2499,27 +2495,19 @@ MDBLDAPFreeValues(MDBValueStruct * V)
BOOL
MDBLDAPAddValue(const unsigned char *Value, MDBValueStruct *V)
{
char *ptr;
unsigned char **ptr;
if (V->Used + 1 > V->allocated) {
ptr = realloc(V->Value, (V->allocated + VALUE_ALLOC_SIZE) *
ptr = (unsigned char **)realloc(V->Value, (V->allocated + VALUE_ALLOC_SIZE) *
sizeof(unsigned char *));
if (ptr) {
V->Value = (unsigned char **) ptr;
V->Value = ptr;
V->allocated += VALUE_ALLOC_SIZE;
} else {
if (V->allocated) {
MDBLDAPFreeValues(V);
if (V->Value) {
free(V->Value);
}
}
V->Value = NULL;
V->Used = 0;
V->allocated = 0;
return FALSE;
}
}
@@ -3181,6 +3169,7 @@ MDBLDAPEnumerateObjectsEx(const unsigned char *Container,
E->next = 0;
}
FreeValArray(vals);
free(vals);
}
@@ -3228,6 +3217,7 @@ MDBLDAPEnumerateAttributesEx(const unsigned char *Object, MDBEnumStruct *E,
E->next = 0;
}
FreeValArray(vals);
free(vals);
}
@@ -3362,6 +3352,7 @@ MDBLDAPDeleteObject(const unsigned char *Object, BOOL Recursive,
}
}
FreeValArray(vals);
free(vals);
}
@@ -3476,6 +3467,10 @@ MDBLDAPRenameObject(const unsigned char *ObjectOld,
}
}
if (newSuperior) {
free(newSuperior);
}
free(baseNew);
}
@@ -3794,11 +3789,14 @@ MDBLDAPInit(MDBDriverInitStruct *Init)
XplRWWriteLockAcquire(&(MdbLdap.PathLock));
if (BongoHashtablePut(MdbLdap.PathTable, mdbDn, ldapDn)) {
free(mdbDn);
free(ldapDn);
result = FALSE;
}
XplRWWriteLockRelease(&(MdbLdap.PathLock));
} else {
free(mdbDn);
result = FALSE;
}
} else {
@@ -3829,8 +3827,10 @@ MDBLDAPInit(MDBDriverInitStruct *Init)
vals = LdapRead("", "subschemaSubentry", MdbLdap.Ldap);
XplMutexUnlock(MdbLdap.LdapMutex);
if (vals && vals[0]) {
MdbLdap.LdapSchemaDn = strdup(vals[0]);
if (vals) {
if (vals[0]) {
MdbLdap.LdapSchemaDn = strdup(vals[0]);
}
if (!MdbLdap.LdapSchemaDn) {
result = FALSE;
+1 -1
View File
@@ -155,7 +155,7 @@ typedef struct _MemPoolEntry {
union {
double dummy; /* Force appropriate alignment */
unsigned char suffix[4]; /* Base pointer for allocations */
}
};
} MemPoolEntry;
typedef struct _MemPoolControl {
+184 -22
View File
@@ -18,8 +18,11 @@
* may find current contact information at www.novell.com.
* </Novell-copyright>
****************************************************************************/
// Parts (C) 2007 Alex Hudson. See Bongo Project Licensing.
/* Helpers for queue agent implementation */
/** \file
* Helpers for Bongo agents. Mainly for queue agents, also contains configuration reading helpers
*/
#include <config.h>
@@ -58,31 +61,190 @@ BongoAgentHandleSignal(BongoAgent *agent,
return;
}
static BOOL
ReadConfiguration(BongoAgent *agent)
{
MDBValueStruct *config;
BOOL ReadConfiguration(BongoAgent *agent);
config = MDBCreateValueStruct(agent->directoryHandle,
MsgGetServerDN(NULL));
if (config) {
if (MDBRead(".", MSGSRV_A_OFFICIAL_NAME, config)) {
strcpy(agent->officialName, config->Value[0]);
MDBFreeValues(config);
} else {
agent->officialName[0] = '\0';
}
BOOL ReadConfiguration(BongoAgent *agent) {
return TRUE;
}
if (MDBRead(agent->name, MSGSRV_A_PORT, config)) {
agent->port = (unsigned short)atol(config->Value[0]);
MDBFreeValues(config);
}
/**
* Free any memory allocated as part of reading the agent's configuration.
* \param config BongoConfigItem array which defines configuration variables
*/
void
FreeBongoConfiguration(BongoConfigItem *config) {
while (config->type != BONGO_JSON_NULL) {
switch (config->type) {
case BONGO_JSON_STRING:
if (config->destination) MemFree(config->destination);
break;
case BONGO_JSON_ARRAY: {
BongoConfigItem *sub = config->destination;
/* if (sub->type == BONGO_JSON_STRING) {
int i;
for (i=0; i<BongoArrayCount(sub->destination); i++) {
char *s = &BongoArrayIndex(sub->destination, char*, i);
MemFree(s);
}
}*/
BongoArrayFree(sub->destination, TRUE);
}
break;
default:
// nothing to do?
break;
}
}
}
MDBDestroyValueStruct(config);
return TRUE;
}
/**
* \internal
* Take an individual BongoConfigItem, and a JSON tree, and try to find the config item
* \param schema pointer to a single BongoConfigItem
* \param node JSON tree we want to look in
* \return Whether or not it was successful
*/
return FALSE;
BOOL
SetBongoConfigItem(BongoConfigItem *schema, BongoJsonNode *node) {
if (!node || node->type != schema->type) {
XplConsolePrintf("config: didn't find data at %s (type: %d, want: %d) \r\n", schema->source, node->type, schema->type);
return FALSE;
}
switch (node->type) {
case BONGO_JSON_BOOL: {
BOOL *dest = (BOOL *)schema->destination;
*dest = BongoJsonNodeAsBool(node);
}
break;
case BONGO_JSON_DOUBLE: {
double *dest = (double *)schema->destination;
*dest = BongoJsonNodeAsDouble(node);
}
break;
case BONGO_JSON_INT: {
int *dest = (int *)schema->destination;
*dest = BongoJsonNodeAsInt(node);
}
break;
case BONGO_JSON_STRING: {
char **dest = (char **)schema->destination;
*dest = BongoJsonNodeAsString(node);
}
break;
case BONGO_JSON_ARRAY: {
BongoConfigItem *subschema = (BongoConfigItem *)schema->destination;
BongoArray **output = (BongoArray **)subschema->destination;
BongoArray *data, *result = NULL;
int size;
data = BongoJsonNodeAsArray(node);
size = BongoArrayCount(data);
switch (subschema->type) {
case BONGO_JSON_BOOL: {
BOOL dest;
int i;
result = BongoArrayNew(sizeof(BOOL), size);
for(i = 0; i < size; i++) {
if (BongoJsonArrayGetBool(data, i, &dest) == BONGO_JSON_OK) {
BongoArrayAppendValue(result, dest);
} else {
return FALSE;
}
}
}
break;
case BONGO_JSON_INT: {
int dest, i;
result = BongoArrayNew(sizeof(int), size);
for(i = 0; i < size; i++) {
if (BongoJsonArrayGetInt(data, i, &dest) == BONGO_JSON_OK) {
BongoArrayAppendValue(result, dest);
} else {
return FALSE;
}
}
}
break;
case BONGO_JSON_STRING: {
const char *dest;
int i;
result = BongoArrayNew(sizeof(char *), size);
for (i=0; i<size; i++) {
if (BongoJsonArrayGetString(data, i, &dest) == BONGO_JSON_OK) {
BongoArrayAppendValue(result, dest);
} else {
return FALSE;
}
}
}
break;
default:
XplConsolePrintf("config: type not yet implemented\r\n");
break;
}
*output = result;
}
break;
case BONGO_JSON_OBJECT:
/* What to do here? We could take ->destination as a pointer
to a BongoConfigItem[], and recurse. Makes less sense for
objects, though */
XplConsolePrintf("config: object type not implemented\r\n");
break;
default:
XplConsolePrintf("config: unknown type %d!\r\n", node->type);
return FALSE;
break;
}
return TRUE;
}
/**
* Read a configuration document from the Bongo Store, and bring information
* from that document into the agent
* \param config BongoConfigItem array which defines configuration variables
* \param filename Filename we wish to read from the store
* \return Whether or not we were successful
*/
BOOL
ReadBongoConfiguration(BongoConfigItem *config, char *filename) {
unsigned char *pconfig;
BOOL retcode = FALSE;
BongoJsonNode *node = NULL;
if (! NMAPReadConfigFile(filename, &pconfig)) {
XplConsolePrintf("config: couldn't read config '%s' from store\r\n", filename);
return FALSE;
}
if (BongoJsonParseString(pconfig, &node) != BONGO_JSON_OK) {
XplConsolePrintf("config: couldn't parse JSON content in '%s'\r\n", filename);
goto finish;
}
while (config->type != BONGO_JSON_NULL) {
BongoJsonNode *result = BongoJsonJPath(node, config->source);
if (!result) {
XplConsolePrintf("config: JSON tree for schema source %s not found\r\n", config->source);
goto finish;
}
if (!SetBongoConfigItem(config, result)) {
// can't set item
XplConsolePrintf("config: schema source %s not found\r\n", config->source);
}
config++;
}
retcode = TRUE;
finish:
if (node) BongoJsonNodeFree(node);
return retcode;
}
int
+3 -2
View File
@@ -40,7 +40,6 @@ pkgpythonadmin_PYTHON := \
src/libs/python/bongo/admin/Calcmd.py \
src/libs/python/bongo/admin/Collector.py \
src/libs/python/bongo/admin/Handler.py \
src/libs/python/bongo/admin/BongoSession.py \
src/libs/python/bongo/admin/Imap.py \
src/libs/python/bongo/admin/Itip.py \
src/libs/python/bongo/admin/JsonUtil.py \
@@ -146,13 +145,15 @@ pkgpythonstore_PYTHON := \
src/libs/python/bongo/store/StoreConnection.py
CLEANFILES += \
src/libs/python/bongo-python-wrapper \
src/libs/python/bongo/*.pyc \
src/libs/python/bongo/external/*.pyc \
src/libs/python/bongo/external/simplejson/*.pyc \
src/libs/python/bongo/nmap/*.pyc \
src/libs/python/bongoy/store/*.pyc
src/libs/python/bongo/Xpl.py: $(top_builddir)/config.status $(srcdir)/src/libs/python/bongo/Xpl.py.in
cd $(top_builddir) && $(SHELL) ./config.status $@
src/libs/python/bongo-python-wrapper: $(top_builddir)/config.status $(srcdir)/src/libs/python/bongo-python-wrapper.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+1
View File
@@ -12,6 +12,7 @@ if binpath.endswith("bin"):
if envpath is not None:
newpath = envpath.split(os.pathsep)
newpath.insert(0, "@PYTHONDIR@")
newpath.insert(0, "@PYEXECDIR@")
os.environ["PYTHONPATH"] = os.pathsep.join(newpath)
script = os.path.join("@PKGLIBEXECDIR@",
-82
View File
@@ -1,82 +0,0 @@
# -*- Makefile -*-
pkgpyexecdir = $(pyexecdir)/bongo
pkgpyexec_LTLIBRARIES := \
libs.la \
bootstrap.la
libs_la_SOURCES := \
src/libs/python/bongo/cal.c \
src/libs/python/bongo/calcmd.c \
src/libs/python/bongo/libs.c \
src/libs/python/bongo/libs.h \
src/libs/python/bongo/mdb.c \
src/libs/python/bongo/msgapi.c \
src/libs/python/bongo/msgapi-defs.c \
src/libs/python/bongo/msgapi-defs.h \
src/libs/python/bongo/pybongo.c \
src/libs/python/bongo/pybongo.h \
src/libs/python/bongo/streamio.c \
src/libs/python/bongo/json.c \
src/libs/python/bongo/json.h \
src/libs/python/bongo/bongoutil.c
libs_la_CPPFLAGS := $(AM_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
$(bongo_CFLAGS)
libs_la_LDFLAGS := -avoid-version -module
libs_la_LIBADD := \
$(PYTHON_LIBS) \
libbongocal.la \
libbongocalcmd.la \
libbongoutil.la \
libbongo-json.la \
libbongomdb.la \
libbongomsgapi.la \
libbongostreamio.la
bootstrap_la_SOURCES := \
src/libs/python/bongo/bootstrap.c \
src/libs/python/bongo/bootstrap.h \
src/libs/python/bongo/mdb.c \
src/libs/python/bongo/msgapi-defs.c \
src/libs/python/bongo/msgapi-defs.h \
src/libs/python/bongo/pybongo.c \
src/libs/python/bongo/pybongo.h
bootstrap_la_CPPFLAGS := $(AM_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
$(bongo_CFLAGS)
bootstrap_la_LDFLAGS := -avoid-version -module
bootstrap_la_LIBADD := \
$(PYTHON_LIBS) \
libbongomdb.la \
libbongomsgapi.la
src/libs/python/bongo/libs.so: libs.la
cp .libs/libs.so $@
src/libs/python/bongo/bootstrap.so: bootstrap.la
cp .libs/bootstrap.so $@
src/libs/python/bongo/Xpl.py: $(top_builddir)/config.status src/libs/python/bongo/Xpl.py.in
cd $(top_builddir) && $(SHELL) ./config.status $@
noinst_DATA += \
src/libs/python/bongo/libs.so \
src/libs/python/bongo/bootstrap.so \
src/libs/python/bongo/Xpl.py
CLEANFILES += \
src/libs/python/bongo/libs.so \
src/libs/python/bongo/bootstrap.so \
src/libs/python/bongo/Xpl.py
src/libs/python/bongo/all: \
src/libs/python/bongo/libs.so \
src/libs/python/bongo/bootstrap.so \
src/libs/python/bongo/Xpl.py
src/libs/python/bongo/clean: clean
+1 -1
View File
@@ -1,4 +1,4 @@
from bongo.libs import calcmd
from libbongo.libs import calcmd
from datetime import datetime
class Command:
+1 -1
View File
@@ -20,7 +20,7 @@
#
#############################################################################
from bongo.bootstrap import mdb
from libbongo.bootstrap import mdb
from bongo.BongoError import BongoError
+1 -1
View File
@@ -1,4 +1,4 @@
from bongo.libs import streamio
from libbongo.libs import streamio
import cStringIO as StringIO
class Stream:
@@ -1,47 +0,0 @@
import os
import time
import random
import pickle
import md5
from bongo.dragonfly import BongoCookie as Cookie
class BongoSession(dict):
def __init__(self, req, lock=1):
self.req = req
cookie = Cookie.get_cookies(req).get('sid', None)
if cookie is None:
digest = md5.new(req.oldreq.address_string())
digest.update(str(time.time()))
self.sid = digest.hexdigest()
# 'path' should be the application path. e.g. '/bongoadmin'
Cookie.add_cookie(req, 'sid', self.sid, path='/', \
expires=time.time()+3600)
else:
self.sid = cookie.value
# FIXME: find a better place to store sessions
self.path = '/tmp/' + str(self.sid) + '.session'
def save(self):
f = open(self.path, 'w')
pickle.dump(dict(self), f)
f.close()
def load(self):
try:
f = open(self.path)
self.update(pickle.load(f))
f.close()
except IOError, e:
pass
def invalidate(self):
os.remove(self.path)
try:
from mod_python import Session as ApacheSession
Session = ApacheSession.Session
except ImportError:
Session = BongoSession
+2 -2
View File
@@ -1,7 +1,7 @@
import inspect
from bongo.libs import msgapi
from libbongo.libs import msgapi
from bongo import MDB
import BongoSession as Session
import bongo.commonweb.BongoSession as Session
import bongoutil as util
import Alias, Mdb, Security, Template, User, JsonUtil
import Imap, Pop3, Calcmd, Webservices, Itip, Webadmin, Proxy, Store, Smtp, Queue, Addressbook, Collector, Antispam, Msgserver
+41 -17
View File
@@ -12,7 +12,6 @@ import signal
import socket
import string
import sys
import tempfile
import time
from bongo import Xpl, Privs
@@ -111,7 +110,7 @@ class ConfigSlapd:
"-f", confFile,
"-h", "ldap://127.0.0.1:%d" % self.port,
"-n", "bongo-slapd"]
if Xpl.BONGO_USER is not None:
if Privs.HaveBongoUser():
args.extend(("-u", Xpl.BONGO_USER))
self.preDaemonize()
@@ -153,28 +152,52 @@ class ConfigSlapd:
self.slapdPid = None
def initSlapd(self):
fd, tmpname = tempfile.mkstemp(".ldif")
os.write(fd, """\
def initSlapd(self, confFile):
if not os.path.exists(self.binary):
print "Slapd path doesn't exist: %s" % self.binary
return None
readfd, writefd = os.pipe()
pid = os.fork()
if not pid:
Privs.DropPrivs()
os.close(writefd)
os.dup2(readfd, sys.stdin.fileno())
sys.stdin.close()
args = ["slapadd",
"-f", confFile]
os.execv(self.binary, args)
sys.exit(1)
os.close(readfd)
os.write(writefd, """\
dn: %(suffix)s
objectclass: dcObject
objectclass: organization
objectClass: dcObject
objectClass: organization
o: Example, Inc.
dc: example
dn: %(rootdn)s
objectclass: inetOrgPerson
surname: Admin
cn: admin
userpassword: %(userpw)s
objectClass: inetOrgPerson
sn: Admin
userPassword: %(userpw)s
""" % {"suffix" : self.suffix, "rootdn" : self.rootdn,
"userpw" : self.encodePassword("bongo")})
os.close(fd)
os.close(writefd)
os.system("ldapadd -h 127.0.0.1 -p %d -x -D %s -w %s -f %s" %
(self.port, self.rootdn, self.password, tmpname))
os.unlink(tmpname)
pid, status = os.waitpid(pid, 0)
if (status >> 8) != 0:
return None
return pid
def writeSlapdConf(self, file, writeRootpw=True):
ldapdir = "%s/ldap" % Xpl.DEFAULT_STATE_DIR
@@ -182,9 +205,10 @@ userpassword: %(userpw)s
if not os.path.exists(ldapdir):
os.makedirs(ldapdir)
if Xpl.BONGO_USER is not None:
pw = pwd.getpwnam(Xpl.BONGO_USER)
os.chown(ldapdir, pw[2], pw[3])
Privs.Chown(ldapdir)
for file in os.listdir(ldapdir):
Privs.Chown(os.path.join(ldapdir, file))
config = """\
include %(sysschemadir)s/core.schema
+1 -1
View File
@@ -1,6 +1,6 @@
import Handler, Mdb, Security, Template, Util
from bongo import MDB
from bongo.libs import msgapi
from libbongo.libs import msgapi
def CreateUser(req):
if not req.fields.has_key('newusername'):
+7 -7
View File
@@ -21,7 +21,7 @@
#############################################################################
import os, random, socket
from bongo.bootstrap import msgapi, mdb
from libbongo.bootstrap import msgapi, mdb
from bongo import MDB, Xpl, Privs
from bongo.admin import Schema
from xml.dom import minidom, Node
@@ -32,7 +32,7 @@ log = logging.getLogger("bongo.admin.Util")
def AddBongoUser(mdb, context, username, attributes, password = None):
"""Add a User object in the directory."""
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
userobject = username
required = {}
if context:
@@ -54,7 +54,7 @@ def AddBongoUser(mdb, context, username, attributes, password = None):
def ModifyBongoUser(mdb, context, username, attributes, password = None):
"""Modify a User object in the directory."""
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
userobject = username
if context:
userobject = context + '\\' + username
@@ -70,7 +70,7 @@ def ModifyBongoUser(mdb, context, username, attributes, password = None):
def RemoveBongoUser(mdb, context, username):
"""Remove a User object from the directory."""
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
userobject = username
if context:
userobject = context + '\\' + username
@@ -91,7 +91,7 @@ def RemoveBongoUser(mdb, context, username):
def DelegateBongoUser(mdb, context, username, community):
"""Delegate a User object as a community manager."""
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
userobject = username
if context:
userobject = context + '\\' + username
@@ -326,7 +326,7 @@ def FindInheritedAttrs(classname, schema, attrs):
def GetUserAttributes(mdb, context, username):
"""Return a dict of (set and unset) attributes on a User."""
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
fields = {}
userobject = username
if context:
@@ -448,7 +448,7 @@ def SetupFromXML(mdb, base, xmlfile):
for obj, attrib in allowedattrs.iteritems():
if objs[obj] == mdb.C_USER:
try:
from bongo.libs import msgapi as MsgApi
from libbongo.libs import msgapi as MsgApi
except:
#TODO: for setup, chop users out of the xml file,
# save it in /tmp somewhere, do the rest of the
+1 -1
View File
@@ -1,5 +1,5 @@
import logging
from bongo.libs import msgapi
from libbongo.libs import msgapi
from CommandStream import *
from NmapConnection import NmapConnection
from cStringIO import StringIO
+2 -2
View File
@@ -1,6 +1,6 @@
import socket
import CommandStream
import bongo, bongo.libs
import bongo, libbongo.libs
import logging
@@ -14,7 +14,7 @@ def Auth(stream):
elif r.code == 4242:
greeting_salt = r.message
hash = bongo.libs.msgapi.NmapChallenge(greeting_salt)
hash = libbongo.libs.msgapi.NmapChallenge(greeting_salt)
stream.Write("AUTH %s", hash)
r = stream.GetResponse()
+1 -1
View File
@@ -1,5 +1,5 @@
import logging
import bongo, bongo.libs
import bongo, libbongo.libs
from CommandStream import *
from StoreConnection import StoreConnection
+1 -1
View File
@@ -359,7 +359,7 @@ class CalendarACL :
class StoreClient:
def __init__(self, user, owner, authToken=None, authCookie=None,
authPassword=None):
from bongo.libs import msgapi
from libbongo.libs import msgapi
self.owner = self.user = None
addr = msgapi.FindUserNmap(owner)
@@ -6,7 +6,7 @@ import logging
def Auth(stream):
"""Authenticate against a Store connection on socket s"""
from bongo.libs import msgapi
from libbongo.libs import msgapi
r = stream.GetResponse()
+80
View File
@@ -0,0 +1,80 @@
# -*- Makefile -*-
pkgpyexecdir = $(pyexecdir)/libbongo
pkgpyexec_PYTHON := \
src/libs/python/libbongo/__init__.py
pkgpyexec_LTLIBRARIES := \
libs.la \
bootstrap.la
libs_la_SOURCES := \
src/libs/python/libbongo/cal.c \
src/libs/python/libbongo/calcmd.c \
src/libs/python/libbongo/libs.c \
src/libs/python/libbongo/libs.h \
src/libs/python/libbongo/mdb.c \
src/libs/python/libbongo/msgapi.c \
src/libs/python/libbongo/msgapi-defs.c \
src/libs/python/libbongo/msgapi-defs.h \
src/libs/python/libbongo/pybongo.c \
src/libs/python/libbongo/pybongo.h \
src/libs/python/libbongo/streamio.c \
src/libs/python/libbongo/json.c \
src/libs/python/libbongo/json.h \
src/libs/python/libbongo/tests.c \
src/libs/python/libbongo/bongoutil.c
libs_la_CPPFLAGS := $(AM_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
$(bongo_CFLAGS)
libs_la_LDFLAGS := -avoid-version -module
libs_la_LIBADD := \
$(PYTHON_LIBS) \
libbongocal.la \
libbongocalcmd.la \
libbongoutil.la \
libbongo-json.la \
libbongomdb.la \
libbongomsgapi.la \
libbongostreamio.la
bootstrap_la_SOURCES := \
src/libs/python/libbongo/bootstrap.c \
src/libs/python/libbongo/bootstrap.h \
src/libs/python/libbongo/mdb.c \
src/libs/python/libbongo/msgapi-defs.c \
src/libs/python/libbongo/msgapi-defs.h \
src/libs/python/libbongo/pybongo.c \
src/libs/python/libbongo/pybongo.h
bootstrap_la_CPPFLAGS := $(AM_CPPFLAGS) \
$(PYTHON_CPPFLAGS) \
$(bongo_CFLAGS)
bootstrap_la_LDFLAGS := -avoid-version -module
bootstrap_la_LIBADD := \
$(PYTHON_LIBS) \
libbongomdb.la \
libbongomsgapi.la
src/libs/python/libbongo/libs.so: libs.la
cp .libs/libs.so $@
src/libs/python/libbongo/bootstrap.so: bootstrap.la
cp .libs/bootstrap.so $@
noinst_DATA += \
src/libs/python/libbongo/libs.so \
src/libs/python/libbongo/bootstrap.so
CLEANFILES += \
src/libs/python/libbongo/libs.so \
src/libs/python/libbongo/bootstrap.so
src/libs/python/libbongo/all: \
src/libs/python/libbongo/libs.so \
src/libs/python/libbongo/bootstrap.so
src/libs/python/bongo/clean: clean
+17
View File
@@ -0,0 +1,17 @@
# -*- Makefile -*-
#
# Do not edit!
#
# (unless this is Makefile.am.subdir)
#
# This file is a copy of the toplevel Makefile.am.subdir. If changes
# need to be made, edit that file, and make update-makefiles, and
# check the new files in.
#
# This is a skeletal automake file. The real automake fules for
# building the targets for this directory can be found in the
# Bongo.rules file. This file is simply here so that 'make all' can
# work in each subdirectory.
all clean install:
@cd $(top_builddir) && $(MAKE) $(MFLAGS) $(subdir)/$@
@@ -180,7 +180,8 @@ cal_JsonToIcal(PyObject *self, PyObject *args)
if (comp) {
PyObject *ret;
ret = Py_BuildValue("s", icalcomponent_as_ical_string(comp));
char *data = icalcomponent_as_ical_string(comp);
ret = PyUnicode_Decode(data, strlen(data), "utf-8", "strict");
icalcomponent_free(comp);
return ret;
} else {
@@ -50,7 +50,7 @@ extern EnumItemDef MsgApiEnums[];
extern PyMethodDef StreamIOMethods[];
extern PyMethodDef BongoJsonMethods[];
extern PyMethodDef BongoUtilMethods[];
extern PyMethodDef TestMethods[];
PyMODINIT_FUNC
initlibs()
@@ -115,6 +115,7 @@ initlibs()
AddLibrary(module, "streamio", StreamIOMethods, NULL);
AddLibrary(module, "bongojson", BongoJsonMethods, NULL);
AddLibrary(module, "bongoutil", BongoUtilMethods, NULL);
AddLibrary(module, "tests", TestMethods, NULL);
BongoJsonPostInit(module);
BongoCalPostInit(module);
+47
View File
@@ -0,0 +1,47 @@
#include <Python.h>
#include <bongo-config.h>
#include "libs.h"
#ifdef __cplusplus
extern "C" {
#endif
// to test this:
// from libbongo.libs import tests
// print tests.GetAsciiString()
// print tests.GetUnicodeString()
static PyObject *
test_GetAsciiString(void)
{
char *hello_english = "Hello";
PyObject *ret;
ret = Py_BuildValue("s", hello_english);
return ret;
}
static PyObject *
test_GetUnicodeString(void)
{
char *hello_finnish = "hyvää päivää";
PyObject *ret;
ret = PyUnicode_Decode(hello_finnish, strlen(hello_finnish),
"utf-8", "strict");
return ret;
}
PyMethodDef TestMethods[] = {
{"GetAsciiString", test_GetAsciiString, METH_VARARGS | METH_STATIC},
{"GetUnicodeString", test_GetUnicodeString, METH_VARARGS | METH_STATIC},
{NULL, NULL, 0, NULL}
};
#ifdef __cplusplus
}
#endif

Some files were not shown because too many files have changed in this diff Show More