aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
Commit message (Collapse)AuthorAgeLines
* Move `handle_settings` before `xt_handle`.Fangrui Song2017-04-16-2/+2
| | | | `utf8_nicks` should be enabled before handling `nick` fields in <setting> because `nick_strip` uses `IRC_UTF8_NICKS` which is only available after calling `handle_settings`.
* Manual merge with wilmer's approach to handling missing protocolsdequis2016-11-21-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | Turns out he already implemented pretty much the same thing in the parson branch... last year. The differences between the two approaches are subtle (there aren't too many ways to do this, some lines are the exact same thing) but I decided I like his version better, so this mostly reverts a handful of my changes while keeping others. The main advantage of his approach is that no fake protocols are registered, no actual prpl functions are called, and the missing prpl is a singleton constant. New things compared to the implementation in the other branch: - The explain_unknown_protocol() function. - Fixed named chatrooms throwing a warning and losing the "account" setting when saving. See changes in irc_im.c - Fixed the "server" setting dropping when saving. See account.c Differences with my previous implementation: - Accounts with missing protocols don't autoconnect - 'account list' marks them as "(missing!)"
* Improve handling of unknown protocols / missing pluginsdequis2016-11-19-6/+15
| | | | | | | | | | | | | | | Instead of failing to load the config, a fake prpl is created to load the account, keep its settings, and refuse to log in with a helpful error message. Also added a new explain_unknown_protocol() function which returns text which attempts to explain why a protocol is missing, handling several typical cases, including the future removal of several dead libpurple plugins. That message is shown when logging in to a loaded account with a missing protocol and when adding a new one with 'account add', with the difference that the latter doesn't leave a placeholder fake account.
* Fix use of un-initialized valueMarius Halden2016-03-26-1/+1
|
* Authentication: scaffolding for multiple authentication backendsDennis Kaarsemaker2016-03-25-62/+74
| | | | | | | | | | | | | | | | | | | | | | | Instead of always putting users passwords in XML files, allow site admins to configure a different authentication method to integrate authentication with other systems. This doesn't add any authentication backends yet, merely the scaffolding. Notably: - Password checking and loading/removing from storage has been decoupled. A new auth_check_pass function is used to check passwords. It does check against the configured storage first, but will handle the authentication backends as well. The XML storage merely signals that a user's password should be checked using an authentication backend. - If unknown-to-bitlbee users identify using an authentication backend, they are automatically registered. - If an authentication backend is used, that fact is stored in the XML file, the password is not. Passwords are also stored unencrypted in this case, as the password used to encrypt them can change underneath us. - configure and Makefile changes for the backend objects
* Allow individual settings to be locked downDennis Kaarsemaker2016-03-23-0/+11
| | | | | | This allows a site admin who pregenerates configs to mark certain settings as untouchable, ensuring that users cannot mess up their settings too badly.
* Support for locked-down accountsDennis Kaarsemaker2016-03-23-1/+8
| | | | | | | | | | | | | In certain situations, e.g. when working with pregenerated configurations, it is useful to be able lock down accounts so they cannot be deleted and authentication information (user, password, server) cannot be changed. We mark such sensitive settings with ACC_SET_LOCKABLE and will refuse to change them if the account is locked by setting the ACC_FLAG_LOCKED flag. This flag is stored in the xml files as account attribute locked="true".
* Fix a bunch of memory leaksdequis2015-03-22-0/+2
| | | | | | | | | | | | | | | | | | | - irc_im.c: - bee_irc_user_msg: strdup leaks when otr swallows messages - bee_irc_user_action_response: GString leak in all ctcp replies - otr.c: - call g_slist_free() on the list of the otr_policy setting - otr_filter_msg_in: call otrl_tlv_free() if "tlvs" are returned - otr_filter_msg_out: don't g_strdup() if the message should be ignored - log_otr_message: g_strdup_vprintf() leaks always - nogaim.c: - imcb_ask_auth/imcb_ask_add: leaks in g_strdup_printf() - imcb_ask_add leaks imcb_ask_cb_data if the user already exists - add imcb_ask_cb_free() to correctly free its data - msn_util.c: add msn_buddy_ask_free(), ditto - storage_xml.c: pass_cr/password if base64_decode or arc_decode fail - ssl_gnutls.c: conn->hostname leak in error conditions, like invalid certs - jabber_util.c: jabber_buddy_by_ext_jid() leaks jid if it's not an ext jid
* Various user experience/error reporting improvementsdequis2015-03-10-4/+11
| | | | | | | | | | | - Show version as part of the initial message of &bitlbee - Use g_strerror() to show actual errors when saving xml configs - Only show "The nick is (probably) not registered" for ENOENT, use g_strerror() for the rest of OS errors when loading xml configs - Show "Protocol not found: <name>" when find_protocol() returns null, useful when the user uninstalls a plugin accidentally. - Suggest the user to check the system clock when getting error 401 from the twitter stream (other REST endpoints show a better error message)
* storage_xml: replace hackish code with a GHashTableIterdequis2015-02-22-20/+9
|
* Reindent everything to K&R style with tabsIndent2015-02-20-238/+245
| | | | | | | Used uncrustify, with the configuration file in ./doc/uncrustify.cfg Commit author set to "Indent <please@skip.me>" so that it's easier to skip while doing git blame.
* Fix incorrect Free Software Foundation addressMatej Cepl2015-01-16-2/+2
|
* Gadugadu local contact storage (ticket #917)dequis2014-07-24-1/+6
| | | | Patch originally by MichaƂ Siejak, adapted for 3.2.1
* Merging utf8-nicks branch. This adds a utf8_nicks setting which removes theWilmer van der Gaast2013-06-16-3/+3
|\ | | | | | | | | ASCII restriction on contact nicknames. Use at your own risk!
| * Add irc_t* argument to all relevant nick_*() functions.Wilmer van der Gaast2013-04-20-3/+3
| |
* | NULL initialisation, fixes crash on trying to load configs from inaccessibleWilmer van der Gaast2013-06-01-1/+1
|/ | | | | file.
* Const is hard, let's go hacking.Wilmer van der Gaast2013-04-20-1/+1
|
* Merging "storage" branch which I wrote long ago. It separates generation ofWilmer van der Gaast2013-04-20-418/+236
|\ | | | | | | | | | | XML-formatted user configs from disk I/O so we can try to start using other mechanisms to store them (a REST API or something, for example).
| * Add xml_generate_settings(), little less code duplication.Wilmer van der Gaast2012-06-07-23/+18
| |
| * s/ACC_SET_NOSAVE/SET_NOSAVE/.Wilmer van der Gaast2012-06-07-1/+1
| |
| * Fixed some small leaks, restored proper read buffer size.Wilmer van der Gaast2012-06-05-12/+17
| |
| * Add xt_to_string_i() and use it to get indentation back in saved settings.Wilmer van der Gaast2012-06-05-1/+1
| | | | | | | | | | | | Also, use it in xt_print() instead of replicating most of xt_to_string() in it. This changed four-space indents into tabs but oh well, we'll live.
| * Small cleanup of xml_save().Wilmer van der Gaast2012-06-05-21/+24
| |
| * xml_load using xmltree. About half as much code as the old stuff. Likely aWilmer van der Gaast2012-06-05-314/+137
| | | | | | | | | | little slower, but IMHO also a little less annoying to work with.
| * Use xmltree to save user settings, in preparation for allowing other storageWilmer van der Gaast2012-06-04-75/+73
| | | | | | | | | | media than local fs.
| * Remove two hacks for some glib<2.14 versions that are no longer supported.Wilmer van der Gaast2012-06-04-6/+0
|/
* An empty password is still a password, don't refuse accounts for that.Wilmer van der Gaast2011-12-24-1/+1
|
* rename irc_usermsg to irc_rootmsg.unknown2011-10-03-5/+5
| | | | | | add new irc_usermsg, irc_usernotice. deliver user-specific messages from libotr as notices to that user.
* Don't save the global "away" settings, leave that to the IRC /AWAY infoWilmer van der Gaast2010-11-21-1/+1
| | | | | | coming from the IRC client. Also, hide it from the settings list, it doesn't belong there.
* Allow changing the display_name, now permanently!Wilmer van der Gaast2010-08-14-0/+10
|
* Use the account tag in a few places and store it in the XML file as anWilmer van der Gaast2010-07-24-10/+8
| | | | | attribute, not as a setting (since all accounts have it anyway).
* Merging mainline.Wilmer van der Gaast2010-07-17-2/+18
|\
| * Skip unsupported tags in user configs. (This should make downgrades fromWilmer van der Gaast2010-07-03-2/+18
| | | | | | | | | | ui-fix for whatever reason less painful.)
* | Use bee_user structs in all nick_* functions. Prepare for a nick_get() withWilmer van der Gaast2010-07-11-1/+1
| | | | | | | | | | more flexible nickname generation.
* | Also allow selecting contacts for a channel by protocol instead of account.Wilmer van der Gaast2010-06-30-0/+4
| | | | | | | | | | | | If someone has two MSN accts and wants contacts from both in one channel, this is now possible.
* | Mark nameless groupchat channels as temporary so they don't stick aroundWilmer van der Gaast2010-06-28-0/+3
| | | | | | | | | | forever.
* | Save and load channels. Also fixing a bug in creating non-control channelsWilmer van der Gaast2010-06-27-9/+47
| | | | | | | | | | with a &-name.
* | Import chatrooms configured in older BitlBee versions. Settings are currentlyWilmer van der Gaast2010-06-27-27/+24
| | | | | | | | | | | | ignored though. Also removing the old chat.[ch] files since they're really not important anymore.
* | Merging memory leak fixes from devel, time to find the ui-fix-specificWilmer van der Gaast2010-06-08-3/+3
|\| | | | | | | | | leaks.
| * Use mkstemp() instead of just a tilde-file when writing new configs to aWilmer van der Gaast2010-06-06-3/+3
| | | | | | | | | | | | | | temporary file. This solves hard-to-debug issues where for example the user hand-edited his configs as root and left a root-owned user.xml~ file behind.
* | Merging loads of stuff from mainline.Wilmer van der Gaast2010-04-14-0/+1
|\|
| * fsync() the user configuration file before closing it. (Bug #559)Wilmer van der Gaast2010-04-14-0/+1
| |
* | Restore the storage module.Wilmer van der Gaast2010-04-10-8/+10
|/
* Don't include chat.h from bitlbee.h. make install-dev doesn't installWilmer van der Gaast2009-10-22-0/+1
| | | | | | chat.h and it shouldn't ... but things broke because bitlbee.h includes it. Fixes #534.
* Merging BitlBee 1.2.3 release.Wilmer van der Gaast2008-09-07-15/+4
|\
| * Really removing the gstdio.h include now to fully fix GLib 2.4Wilmer van der Gaast2008-09-07-1/+0
| | | | | | | | | | compatibility.
| * Completely reviewed all uses of irc->password, irc_setpass() andWilmer van der Gaast2008-09-06-15/+4
| | | | | | | | | | | | USTATUS_IDENTIFIED after another account overwriting vulnerability was found by Tero Marttila.
* | Support for saving the chatroom list. Also removed the hack that was usedWilmer van der Gaast2008-08-30-2/+22
| | | | | | | | | | | | to not save non-existent settings now that those simply aren't possible anymore.
* | Added support for loading chatroom data from user .xml files.Wilmer van der Gaast2008-08-30-4/+33
|/
* Now really fixing #429 by including unistd.h (which defines F_OK).Wilmer van der Gaast2008-08-24-1/+4
|