Changeset 0c0734d


Ignore:
Timestamp:
Dec 26, 2013, 7:11:16 PM (8 years ago)
Author:
Jason Gross <jasongross9@gmail.com>
Parents:
d779a1a (diff), 1598444 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 1598444b8b9498933ed8c1759ba80a7a1265581f into d779a1aa58104b69d351237882b1b55aac8cf315
Files:
1 added
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    r48c09d4 r1598444  
    1717# In lp:~barnowl/barnowl/packaging, we use apt-get.  Here, we use cpanm.
    1818#  - sudo apt-get install libanyevent-perl libclass-accessor-perl libextutils-depends-perl libglib-perl libmodule-install-perl libnet-twitter-lite-perl libpar-perl libperl-dev
    19   - cpanm AnyEvent Class::Accessor ExtUtils::Depends Glib Module::Install Net::Twitter::Lite PAR
     19  - cpanm AnyEvent Class::Accessor ExtUtils::Depends Module::Install Net::Twitter::Lite PAR
     20  - cpanm Glib || cpanm Glib@1.302 # Glib@1.303 is broken, and is currently the latest
    2021script: "./autogen.sh && ./configure && make distcheck"
  • .gitignore

    rca1fb26a r7834bb5  
     1# Generated by autoreconf
     2Makefile.in
     3/aclocal.m4
     4/autom4te.cache/
     5/compile
     6/config.h.in
     7/config.h.in~
     8/configure
     9/depcomp
     10/install-sh
     11/missing
     12/test-driver
     13
     14# Generated by configure
     15Makefile
     16.deps/
     17/config.cache
     18/config.h
     19/config.log
     20/config.status
     21/stamp-h1
     22
     23# Generated by make
     24*.o
    125*.a
    2 *.o
    3 *.par
    4 .deps
     26/BUILD_VERSION.mk
     27/barnowl
    528/bin/
    6 BUILD_VERSION.mk
    7 META.yml
    8 MYMETA.yml
    9 Makefile
    10 Makefile.in
    11 Makefile.old
     29/gmarshal_funcs.c
     30/gmarshal_funcs.h
     31/owl_prototypes.h
     32/owl_prototypes.h.new
     33/perlglue.c
     34/varstubs.c
     35/version.c
     36/version.c.new
     37/zcrypt
     38
     39# Generated by make check
     40/runtests.sh.log
     41/runtests.sh.trs
     42/test-suite.log
     43/tester
     44
     45# Generated by make tags et al.
     46ID
    1247TAGS
    13 aclocal.m4
    14 autom4te.cache
    15 barnowl
    16 blib
    17 config.cache
    18 config.h
    19 config.h.in
    20 config.h.in~
    21 config.log
    22 config.status
    23 configure
    24 core
    25 depcomp
    26 gmarshal_funcs.c
    27 gmarshal_funcs.h
    28 inc/
    29 install-sh
    30 jabber.log
    31 missing
    32 owl_prototypes.h
    33 owl_prototypes.h.new
    34 perlglue.c
    35 pm_to_blib
    36 runtests.sh.log
    37 runtests.sh.trs
    38 stamp-h1
    39 test-driver
    40 test-suite.log
    41 tester
    42 varstubs.c
    43 version.c
    44 version.c.new
    45 zcrypt
     48tags
     49/GPATH
     50/GRTAGS
     51/GSYMS
     52/GTAGS
     53/cscope.files
     54/cscope.in.out
     55/cscope.out
     56/cscope.po.out
  • ChangeLog

    r441fd42 r6f87658  
    111.9
     2 * Update Jabber module for Net::DNS changes -james2vegas@aim.com
     3 * Update and make configurable the Zephyr default format -adehnert@mit.edu
     4 * Fix a crash when zcrypt fails -andersk@mit.edu
     5 * Fix building with OpenSSL before 0.9.8 -andersk@mit.edu
     6 * Make :loadsubs reload instanced personals too -davidben@mit.edu
     7 * Make Perl zephyr_zwrite call die() when it fails -jgross@mit.edu
     8 * Tell gpg calls from zcrypt to ignore ~/.gnupg -andersk@mit.edu
     9 * Replace outgoing zephyr default format with a small URL -geofft@mit.edu
    210 * Add getnumlines() to perl interface -asedeno@mit.edu
    311 * Include names of invalid filters on filter errors -adehnert@mit.edu
  • perl/lib/BarnOwl/Style/Default.pm

    r732d5c0 rebc6f77  
    129129    my $self = shift;
    130130    my $m = shift;
    131     my $sender = $m->long_sender;
    132     $sender =~ s/\n.*$//s;
     131    my $sender = $self->humanize($m->long_sender, 1);
    133132    if (BarnOwl::getvar('colorztext') eq 'on') {
    134133      return "  (" . $sender . '@color[default]' . ")";
  • tester.c

    r6a8b519 r21dc927  
    2525int owl_history_regtest(void);
    2626int call_filter_regtest(void);
     27int owl_smartstrip_regtest(void);
    2728
    2829extern void owl_perl_xs_init(pTHX);
     
    116117  numfailures += owl_history_regtest();
    117118  numfailures += call_filter_regtest();
     119  numfailures += owl_smartstrip_regtest();
    118120  if (numfailures) {
    119121      fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures);
     
    10181020  return numfailed;
    10191021}
     1022
     1023int owl_smartstrip_regtest(void)
     1024{
     1025  int numfailed = 0;
     1026
     1027  printf("# BEGIN testing owl_zephyr_smartstripped_user\n");
     1028
     1029#define CHECK_SMARTSTRIP(in, expected)                  \
     1030  do {                                                  \
     1031    char *__value = owl_zephyr_smartstripped_user(in);  \
     1032    FAIL_UNLESS("owl_zephyr_smartstripped_user " in,    \
     1033                strcmp((expected), __value) == 0);      \
     1034    g_free(__value);                                    \
     1035  } while (0)
     1036
     1037  CHECK_SMARTSTRIP("foo", "foo");
     1038  CHECK_SMARTSTRIP("foo.bar", "foo");
     1039  CHECK_SMARTSTRIP("foo/bar", "foo");
     1040  CHECK_SMARTSTRIP("host/bar", "host/bar");
     1041  CHECK_SMARTSTRIP("rcmd.bar", "rcmd.bar");
     1042  CHECK_SMARTSTRIP("daemon/bar", "daemon/bar");
     1043  CHECK_SMARTSTRIP("daemon.bar", "daemon.bar");
     1044
     1045  CHECK_SMARTSTRIP("foo@ATHENA.MIT.EDU", "foo@ATHENA.MIT.EDU");
     1046  CHECK_SMARTSTRIP("foo.bar@ATHENA.MIT.EDU", "foo@ATHENA.MIT.EDU");
     1047  CHECK_SMARTSTRIP("foo/bar@ATHENA.MIT.EDU", "foo@ATHENA.MIT.EDU");
     1048  CHECK_SMARTSTRIP("host/bar@ATHENA.MIT.EDU", "host/bar@ATHENA.MIT.EDU");
     1049  CHECK_SMARTSTRIP("rcmd.bar@ATHENA.MIT.EDU", "rcmd.bar@ATHENA.MIT.EDU");
     1050  CHECK_SMARTSTRIP("daemon/bar@ATHENA.MIT.EDU", "daemon/bar@ATHENA.MIT.EDU");
     1051  CHECK_SMARTSTRIP("daemon.bar@ATHENA.MIT.EDU", "daemon.bar@ATHENA.MIT.EDU");
     1052
     1053  printf("# END testing owl_zephyr_smartstripped_user\n");
     1054
     1055  return numfailed;
     1056}
  • zephyr.c

    rc55930e rebcdf4d  
    13191319CALLER_OWN char *owl_zephyr_smartstripped_user(const char *in)
    13201320{
    1321   char *slash, *dot, *realm, *out;
    1322 
    1323   out = g_strdup(in);
    1324 
    1325   /* bail immeaditly if we don't have to do any work */
    1326   slash = strchr(out, '/');
    1327   dot = strchr(out, '.');
    1328   if (!slash && !dot) {
    1329     return(out);
    1330   }
    1331 
    1332   if (!strncasecmp(out, OWL_ZEPHYR_NOSTRIP_HOST, strlen(OWL_ZEPHYR_NOSTRIP_HOST)) ||
    1333       !strncasecmp(out, OWL_ZEPHYR_NOSTRIP_RCMD, strlen(OWL_ZEPHYR_NOSTRIP_RCMD)) ||
    1334       !strncasecmp(out, OWL_ZEPHYR_NOSTRIP_DAEMON5, strlen(OWL_ZEPHYR_NOSTRIP_DAEMON5)) ||
    1335       !strncasecmp(out, OWL_ZEPHYR_NOSTRIP_DAEMON4, strlen(OWL_ZEPHYR_NOSTRIP_DAEMON4))) {
    1336     return(out);
    1337   }
    1338 
    1339   realm = strchr(out, '@');
    1340   if (!slash && dot && realm && (dot > realm)) {
    1341     /* There's no '/', and the first '.' is in the realm */
    1342     return(out);
    1343   }
    1344 
    1345   /* remove the realm from out, but hold on to it */
    1346   if (realm) realm[0]='\0';
    1347 
    1348   /* strip */
    1349   if (slash) slash[0] = '\0';  /* krb5 style user/instance */
    1350   else if (dot) dot[0] = '\0'; /* krb4 style user.instance */
    1351 
    1352   /* reattach the realm if we had one */
    1353   if (realm) {
    1354     strcat(out, "@");
    1355     strcat(out, realm+1);
    1356   }
    1357 
    1358   return(out);
     1321  int n = strcspn(in, "./");
     1322  char *realm = strchrnul(in, '@');
     1323
     1324  if (in + n >= realm ||
     1325      g_str_has_prefix(in, OWL_ZEPHYR_NOSTRIP_HOST) ||
     1326      g_str_has_prefix(in, OWL_ZEPHYR_NOSTRIP_RCMD) ||
     1327      g_str_has_prefix(in, OWL_ZEPHYR_NOSTRIP_DAEMON5) ||
     1328      g_str_has_prefix(in, OWL_ZEPHYR_NOSTRIP_DAEMON4))
     1329    return g_strdup(in);
     1330  else
     1331    return g_strdup_printf("%.*s%s", n, in, realm);
    13591332}
    13601333
Note: See TracChangeset for help on using the changeset viewer.