aboutsummaryrefslogtreecommitdiffstats
path: root/unix.c
Commit message (Collapse)AuthorAgeLines
* unix.c: Move log_link() calls before plugin initializationdequis2016-05-01-9/+8
| | | | This ensures that plugin load errors are logged instead of thrown away
* Authentication: scaffolding for multiple authentication backendsDennis Kaarsemaker2016-03-25-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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
* sighandler_crash: Mark irc socket as blocking before writingdequis2015-11-03-0/+1
| | | | | Just to ensure the whole thing gets written, since this can't be async for obvious reasons.
* Avoid propagating shutdown signal to all subprocessesdequis2015-10-30-9/+26
| | | | | | | | | | | | | | | | | | | | This was a sort-of-regression with 7233f68 While this behavior might seem desirable in some cases, multi-user installs like public servers would rather not kill children while upgrading. Turns out that pipes are inherited by forks, and writing in one side means there might be more than one listener that calls bitlbee_shutdown(). If the parent gets it, the children will get it too. If a child gets it, the parent and the other children get it too. This adds a sighandler_shutdown_setup() function that closes any previously existing pipes and disconnects the events from them, to create a new one. This is called again after forking each child process. While I'm sure this fixes the issue, I still don't understand why it *didn't* kill the forked processes in some cases. Worrying.
* More coverity fixes!dequis2015-05-07-4/+16
| | | | | | | | | | CID 18634: 'Logically dead code' in jabber_get_info CID 18638: 'Dereference after null check' in oauth2_access_token_done CID 18691: 'Copy into fixed size buffer' in bee_irc_user_new CID 20274: Leak in bee_irc_chat_invite CID 20297, CID 20283: Leaks in crypt_main Some the base64 leaks there weren't detected, needs modeling.
* Reindent everything to K&R style with tabsIndent2015-02-20-159/+142
| | | | | | | 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.
* random_bytes: Use /dev/urandom only, don't bother trying /dev/randomdequis2015-01-26-2/+0
| | | | | | Also abort() if there's no /dev/urandom See http://www.2uo.de/myths-about-urandom/ for details.
* Fix incorrect Free Software Foundation addressMatej Cepl2015-01-16-2/+2
|
* Improved signal handling to avoid deadlocksdequis2014-11-26-53/+34
| | | | | | | | | | | | - SIGSEGV: broadcast a message manually, avoiding the usual irc_write() functions which are unsafe due to malloc(). - SIGTERM, SIGINT: Write to a pipe which gets handled in the main loop by bitlbee_shutdown(), saving configs and stuff. - SIGCHLD: set to ignore explicitly, which handles zombies correctly. This also drops some log messages with 'info' level, which in practice means they never got logged. - SIGPIPE: set to ignore (nobody cares) - SIGILL, SIGBUS, SIGFPE, SIGQUIT, SIGXCPU: Not handling anymore.
* Fix the NSS init after fork bug, and clean up lies in unix.cdequis2014-07-24-9/+0
| | | | | | | | | | | | | | | | | | | | | | | This might look like a simple diff, but those 'lies' made this not very straightforward. The NSS bug itself is simple: NSS detects a fork happened after the initialization, and refuses to work because shared CSPRNG state is bad. The bug has been around for long time. I've been aware of it for 5 months, which says something about this mess. Trac link: http://bugs.bitlbee.org/bitlbee/ticket/785 This wasn't a big deal because the main users of NSS (redhat) already applied a different patch in their packages that workarounded the issue somewhat accidentally. And this is the ticket for the 'lies' in unix.c: http://bugs.bitlbee.org/bitlbee/ticket/1159 Basically a conflict with libotr that doesn't happen anymore. Read that ticket for details on why ignoring those comments is acceptable. Anyway: yay!
* I'm still bored on a long flight. Wrote a script to automatically updateWilmer van der Gaast2013-02-21-1/+1
| | | | | | | my copyright mentions since some were getting pretty stale. Left files not touched since before 2012 alone so that this change doesn't touch almost EVERY source file.
* Set PACKAGE to BitlBee-LIBPURPLE for the libpurple variant, because in manyWilmer van der Gaast2012-05-02-3/+3
| | | | | ways it's not BitlBee and I'm tired of getting libpurple-related bug reports.
* Use initgroups() as well when dropping privileges. Closes bug #852.Wilmer van der Gaast2011-12-22-0/+6
|
* Stop calling nogaim_init() on every incoming connection (unless we'reWilmer van der Gaast2010-10-16-0/+7
| | | | | | using libpurple). This was leaking memory and indirectly caused the bug fixed by the previous revision.
* Alas, commit 700 becomes a boring "Oops, --otr=0 still doesn't build withoutWilmer van der Gaast2010-10-10-1/+4
| | | | | | | libotr installed". Also, it appears that this code needs libotr 3.2.0 or higher, but I'm not adding a build-dep since that'll cause troubles on the build bot, people can just build with BITLBEE_OTR=0.
* Merging mainline, which includes a huge msnp13 merge.Wilmer van der Gaast2010-10-02-1/+1
|\ | | | | | | | | | | Not 100% sure about the OpenSSL merge, should double check that but I'm currently offline.
| * Fix compiler warnings. Also fixing irc_send_motd(), which so far got awayWilmer van der Gaast2010-09-05-1/+1
| | | | | | | | | | with a horrible practice of reading the MOTD file one by one.
* | Allow building OTR support as a plugin. Fairly simple, let's hope I can getWilmer van der Gaast2010-09-29-0/+4
| | | | | | | | | | away with doing this without libtool (eep).
* | First step in this merge. Mostly a bzr merge and then a cleanup of conflictsWilmer van der Gaast2010-08-24-0/+10
|\ \ | |/ |/| | | | | and parts I want to/have to redo (because of ui-fix).
| * merge in bitlbee 1.2.6Sven Moritz Hallberg2010-06-03-5/+8
| |\
| * \ merge in bitlbee 1.2.5Sven Moritz Hallberg2010-06-03-0/+68
| |\ \
| * | | commit updates by ashish shukla <wahjava@gmail.com>Sven Moritz Hallberg2009-03-12-9/+7
| | | |
| * | | merge in latest trunkSven Moritz Hallberg2008-07-17-19/+16
| |\ \ \
| * | | | explicitly initialize ssl in order to avoid gnutls and libotr fighting over ↵Sven Moritz Hallberg2008-02-17-0/+7
| | | | | | | | | | | | | | | | | | | | the global state of libgcrypt
| * | | | merge in upstream changesSven Moritz Hallberg2008-02-16-2/+5
| |\ \ \ \
| * | | | | OTR support, first checkinSven Moritz Hallberg2008-02-03-0/+2
| | | | | |
* | | | | | OpenSolaris (non-gcc) fixes, patches from Dagobert Michelsen <dam@opencsw.org>Wilmer van der Gaast2010-08-07-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with some changes.
* | | | | | Fixed shutdown sequence (could cause 100% CPU usage on SIGTERM).Wilmer van der Gaast2010-07-27-1/+1
| | | | | |
* | | | | | Reformat nicks whenever fullname/nick/group changes (but at least for nowWilmer van der Gaast2010-07-13-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | still only for offline users).
* | | | | | Merging stuff from mainline (1.2.6).Wilmer van der Gaast2010-04-24-5/+8
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | |
| * | | | | Log to stderr+syslog until daemonized. Current behaviour is too confusingWilmer van der Gaast2010-04-14-5/+8
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | and annoying.
* | | | | Merging in head.Wilmer van der Gaast2010-03-14-3/+68
|\| | | |
| * | | | Document the new -x flag in one useful location and make it a bit better atWilmer van der Gaast2010-03-11-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument checking to avoid ugly (even though harmless) segfaults. Also skip any md5: prefix that may be present when checking hashes.
| * | | | Replaced obsolete (useless for the current .xml files) encode/decode toolsWilmer van der Gaast2010-03-08-3/+66
| | |_|/ | |/| | | | | | | | | | | | | | | | | | with a few command-line options to the BitlBee binary. Type "bitlbee -x" for more info.
* / | | Reshuffled initialization sequence a little bit. Most important change:Wilmer van der Gaast2009-11-28-10/+11
|/ / / | | | | | | | | | | | | | | | nogaim_init() should be done after fork() to make ForkDaemon mode work again. Also, doing help_init() earlie makes "help purple" work.
* | | Merging changes from Jelmer: It's now possible to cross-compile a WindowsWilmer van der Gaast2008-06-30-0/+8
|\ \ \ | | | | | | | | | | | | | | | | version of BitlBee from Linux. No working SSL support yet though!
| * | | Move random_bytes() back to lib/Jelmer Vernooij2008-06-10-65/+0
| | | |
| * | | Merge move of random_bytes().Jelmer Vernooij2008-04-02-0/+67
| |\ \ \
| | * | | Move unix-specific random_bytes() implementation to unix.c.Jelmer Vernooij2008-04-02-0/+67
| | | |/ | | |/|
| * | | Merge trunk.Jelmer Vernooij2008-04-02-20/+33
| |\| |
| * | | [merge] WilmerJelmer Vernooij2006-03-01-1/+41
| |\ \ \
| * \ \ \ Merge WilmerJelmer Vernooij2006-01-10-4/+23
| |\ \ \ \
| * \ \ \ \ Merge WilmerJelmer Vernooij2005-12-15-6/+11
| |\ \ \ \ \
| * \ \ \ \ \ Merge new changes from pluginable and WilmerJelmer Vernooij2005-11-15-23/+0
| |\ \ \ \ \ \
| * | | | | | | Import work on services-based Win32 portJelmer Vernooij2005-11-07-0/+6
| | | | | | | |
* | | | | | | | Now using an environment variable instead of a flag to pass state info whenWilmer van der Gaast2008-06-29-19/+8
| |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | restarting the ForkDaemon. Preparing for a proper fallback when execv() fails. (Bug #425)
* | | | | | | Got rid of some noise at startup: complaining when the default configurationWilmer van der Gaast2008-02-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file couldn't be found while the user specified an alternative location with the -c option, and double complaints about /var/lib/bitlbee/ permissions.
* | | | | | | Added help_free() and cleaned up some very stale help-related stuff IWilmer van der Gaast2008-02-02-1/+4
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | wasn't even aware of. This closes bug #352.
* | | | | | Fixing some Solaris compiler warnings (u_int->uint, adding some typecastsWilmer van der Gaast2008-01-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for pid_t variables).
* | | | | | Imported setuid() patch from Simo Leone <simo@archlinux...> with someWilmer van der Gaast2007-12-02-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modifications. Also adding some missing g_free()s to conf.c.