Commits on Dec 23, 2017
  1. Define _DEFAULT_SOURCE in addition to _BSD_SOURCE

    andersk committed Dec 23, 2017
    Fixes many copies of this warning with glibc 2.20.  (See _BSD_SOURCE
    in feature_test_macros(7).)
    In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
                     from /usr/include/stdint.h:26,
                     from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9,
                     from /usr/include/ncursesw/curses.h:63,
                     from owl.h:20,
                     from message.c:1:
    /usr/include/features.h:183:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
     # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
    Signed-off-by: Anders Kaseorg <>
Commits on Oct 13, 2017
  1. tester --builtin: Fix exit status

    andersk committed Oct 13, 2017
    The exit status of tester --builtin previously came from the return
    value of owl_regtest(), but commit
    95414bf accidentally overwrote it
    with 0.
    Signed-off-by: Anders Kaseorg <>
  2. Remove AIM support

    andersk committed Oct 7, 2017
    This code has received almost no security attention, and anyway, AIM
    is shutting down on December 15, 2017.
    Signed-off-by: Anders Kaseorg <>
Commits on Oct 8, 2017
  1. Avoid thread-unsafe functions ctime, localtime, strtok

    andersk committed Oct 7, 2017
    BarnOwl seems to be growing threads at an alarming rate, so let’s be
    sure these don’t turn into race conditions.
    Signed-off-by: Anders Kaseorg <>
Commits on Oct 7, 2017
  1. owl_perlconfig_hashref2message: Don’t pass uninitialized tm_isdst to …

    andersk committed Oct 7, 2017
    strptime doesn’t initialize tm_isdst, so mktime was offsetting the
    time by ±1 hour depending on uninitialized memory.  Initializing
    tm_isdst to a negative value causes it to guess.  It will still guess
    incorrectly during one hour of every year, but at least now the
    behavior is defined.
    (Discovered by valgrind.)
    Signed-off-by: Anders Kaseorg <>
  2. Rename owl_log_entry_free to owl_log_entry_delete

    andersk committed Oct 7, 2017
    We use “_cleanup” for functions that free everything referenced by the
    object and “_delete” for functions that also free the object itself,
    avoiding the ambiguous “_free”.
    Also remove the NULL check since the pointer can never be NULL.
    Signed-off-by: Anders Kaseorg <>
  3. Fix test harness for Perl 5.26 ('.' is no longer in @INC)

    andersk committed Oct 7, 2017
    Signed-off-by: Anders Kaseorg <>
  4. owl_log_makemsg_main_thread: Fix format string injection bug

    andersk committed Oct 7, 2017
    Signed-off-by: Anders Kaseorg <>
  5. zephyr_zwrite: Use owl_function_zwrite

    andersk committed Mar 17, 2016
    This adds outgoing personals to the message list, and supports zcrypt,
    all for the low low price of −4 LoC.  (I’m not sure why anyone would
    use this interface, though, given the existence of
    BarnOwl::zwrite('andersk', '-m', 'message').)
    Signed-off-by: Anders Kaseorg <>
  6. Fix M-LEFT binding, and also bind C-LEFT, C-RIGHT

    andersk committed Aug 27, 2016
    Signed-off-by: Anders Kaseorg <>
Commits on Aug 16, 2017
  1. Add a bit more documentation

    JasonGross committed Aug 6, 2017
    The function was potentially a bit confusing under code review.
  2. Improve some documentation of logging variables

    JasonGross committed Aug 6, 2017
    As per PR #54 review comments.
  3. Replace initial . with _

    JasonGross committed Aug 6, 2017
    This is so that, e.g., we won't write to .git, .gitconfig, etc.
  4. Note conflict of loggingdirection and classlogging

    JasonGross committed Jan 5, 2014
    The description of loggingdirection specifies that it applies to all
    messages, and thus overrides classlogging.
    This implements option (2) of trac #242.
  5. Log loopbacks to loopback file in ~/zlog

    JasonGross committed Jan 5, 2014
    Not to ~/zlog/loop{sender,recip}.  If compatibility logging is on,
    loopbacks get logged to ~/zlog/people/loopback, which is what happened
    before this branch.
  6. Add log-to-subdirectories, a compatibility frob

    JasonGross committed Jan 5, 2014
    If disabled (the default), then logging of jabber and AIM messages
    behaves how it used to.  If enabled, then each protocol gets its own
  7. Use g_utf8_casefold and g_utf8_normalize

    JasonGross committed Jan 2, 2014
    We define a convenience function compat_casefold in util.c for reuse in
  8. Update IRC logging to be more idiomatic

    JasonGross committed Jul 27, 2013
    Based on a message from kini on #oplss at 2013-07-27 12:40:
       freenode / #oplss / kini  2013-07-27 12:40  (kini!kini@unaffiliated/kini)
           jgross: the standard format is "[timestamp] <username> message", one line per message
       freenode / #oplss / kini  2013-07-27 12:41  (kini!kini@unaffiliated/kini)
           non-message events are usually notated as "* event description", e.g. "* kini (unaffiliated/kini) joined
           #oplss", or whatever
  9. Log to subfolders of a base path

    JasonGross committed Feb 17, 2013
    A different subfolder for each protocol.
  10. Add IRC logging filename generation

    JasonGross committed Feb 17, 2013
    Based on asedeno's comment
    "For IRC I'd probably want a combination of network and (channel or
  11. Ignore kerberos instances in the sender and recipient when logging

    JasonGross committed Jul 21, 2011
    This fixes trac-#151 (Handle logging of personal zephyrs from different
    instances of Kerberos principals sanely).  Stripping the instance is
    only done for the filename, not for the actual log contents.
  12. Moved the last of the logging-related variables to perl

    JasonGross committed Jul 12, 2011
    We seem to have picked logpath as the string variable we test in
    tester.c.  Since this is no longer in C, I've replaced it with
    personalbell (no particular reason for that choice).
  13. Moved logging-specific variables to perl

    JasonGross committed Jul 12, 2011
    But only the ones that could be moved losslessly, i.e., no special
    validsettings and not enums.
  14. Scrapped the last bits of C code dealing with jabber.

    JasonGross committed Jan 27, 2012
    We still have an OWL_PROTOCOL_JABBER in owl.h, but it does no harm being
    there, and we don't use any of the other ones except for AIM.  I figure
    there's no harm in waiting and ripping all of them out at the same time
    in perl/AIM
  15. Moved log file name generation to perl

    JasonGross committed Jul 12, 2011
    I don't think that the class/personal distinction is the best for
    general protocols, but I don't know what should replace it.  I've made
    class-logging default to only zephyr (a slight change from previous
    behavior, where jabber MUC's would be logged to $classlogpath, as well
    as all non-private non-login messages from other protocols), but made
    logging path generation overridable.
    TODO: Decide whether or not to filter out more 'bad' characters.
    Perhaps we should remove '!' because it indicates history in some shells
    and makes things obnoxious, or '~' becase it indicates homedirs in many
    * '/' is for separating directories, and we don't want to accidentally
      make subdirectories
    We first NFKC for zephyrs, and then apply lc.  The zephyr servers
    apply case-folded NFKC (so says  We should
    probably use Unicode::CaseFold instead of lc.  I'm also not sure what
    the order case-adjustment and normalization should be.
    We first NFKC, then apply lc, to jabbers, as per
    (though I can't actually find anything that specifies the case-folding
    algorithm, nor the ordering).
    We now use lc instead of g_utf8_strdown to normalize AIM screennames.
  16. Made owl_util_makepath available from perl

    JasonGross committed Jul 12, 2011
    There's probably a better way to do this.  Maybe
    sub makepath {
            my $filename = shift;
            $filename =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1))[7]
            : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7] ) }ex;
            return $filename;
    ( or something.
    Additionally, I'm not sure why
       char *rv = NULL;
       rv = foo();
       RETVAL = rv;
    is the paradigm for functions returning strings, when foo returns `char
    *` and not `const char *`.  I've removed the `= NULL` part of the
    initlization, which I assume is left over from when we had to NULL-check
    things before freeing them, but I've copied the rest of the code.