Changes in / [1167bf1:8830f79f]
- Files:
-
- 5 added
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r42ad917 r42ad917 1 ACLOCAL_AMFLAGS = -I m4 2 1 3 bin_PROGRAMS = barnowl.bin 2 4 check_PROGRAMS = tester perl_tester … … 5 7 owl.h owl_perl.h config.h \ 6 8 owl.c \ 7 libzcrypt.a \8 9 $(GEN_C) $(GEN_H) 9 10 10 barnowl_bin_LDADD = libfaim/libfaim.a libzcrypt.a11 barnowl_bin_LDADD = libfaim/libfaim.a 11 12 12 13 tester_SOURCES = $(BASE_SRCS) \ 13 14 owl.h owl_perl.h config.h \ 14 libzcrypt.a \15 15 $(GEN_C) $(GEN_H) \ 16 16 tester.c 17 17 18 tester_LDADD = libfaim/libfaim.a libzcrypt.a18 tester_LDADD = libfaim/libfaim.a 19 19 20 20 perl_tester_SOURCES = $(BASE_SRCS) \ … … 28 28 TESTS=runtests.sh 29 29 30 noinst_LIBRARIES = libzcrypt.a31 32 libzcrypt_a_SOURCES = zcrypt.c33 libzcrypt_a_CFLAGS = -w34 35 30 CPPFLAGS = -I$(top_srcdir)/ \ 36 31 -I$(top_srcdir)/libfaim/ … … 40 35 perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ 41 36 regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ 42 keypress.c keymap.c keybinding.c cmd.c context.c \37 keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \ 43 38 aim.c buddy.c buddylist.c style.c errqueue.c \ 44 39 zbuddylist.c popexec.c obarray.c select.c wcwidth.c \ … … 65 60 $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@ 66 61 67 owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS) zcrypt.c62 owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS) 68 63 $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@ 69 64 -
aim.c
r36486be rc79a047 230 230 } 231 231 232 void owl_aim_logged_out( )232 void owl_aim_logged_out(void) 233 233 { 234 234 if (owl_global_is_aimloggedin(&g)) owl_function_adminmsg("", "Logged out of AIM"); … … 408 408 } 409 409 410 int owl_aim_process_events( )410 int owl_aim_process_events(void) 411 411 { 412 412 aim_session_t *aimsess; … … 1995 1995 } 1996 1996 1997 void owl_process_aim( )1997 void owl_process_aim(void) 1998 1998 { 1999 1999 if (owl_global_is_doaimevents(&g)) { -
commands.c
r3e96ff0 r61de085 297 297 "Print a znol-style listing of users logged in"), 298 298 299 OWLCMD_ ARGS("alist", owl_command_alist, OWL_CTX_INTERACTIVE,299 OWLCMD_VOID("alist", owl_command_alist, OWL_CTX_INTERACTIVE, 300 300 "List AIM users logged in", 301 301 "alist", 302 302 "Print a listing of AIM users logged in"), 303 303 304 OWLCMD_ ARGS("blist", owl_command_blist, OWL_CTX_INTERACTIVE,304 OWLCMD_VOID("blist", owl_command_blist, OWL_CTX_INTERACTIVE, 305 305 "List all buddies logged in", 306 306 "blist", 307 307 "Print a listing of buddies logged in, regardless of protocol."), 308 308 309 OWLCMD_ ARGS("toggle-oneline", owl_command_toggleoneline, OWL_CTX_INTERACTIVE,309 OWLCMD_VOID("toggle-oneline", owl_command_toggleoneline, OWL_CTX_INTERACTIVE, 310 310 "Toggle the style between oneline and the default style", 311 311 "toggle-oneline", … … 995 995 }; 996 996 997 void owl_command_info( )997 void owl_command_info(void) 998 998 { 999 999 owl_function_info(); 1000 1000 } 1001 1001 1002 void owl_command_nop( )1002 void owl_command_nop(void) 1003 1003 { 1004 1004 } … … 1017 1017 char *owl_command_zlist(int argc, const char *const *argv, const char *buff) 1018 1018 { 1019 int elapsed=0, timesort=0;1020 1019 const char *file=NULL; 1021 1020 … … 1023 1022 argv++; 1024 1023 while (argc) { 1025 if (!strcmp(argv[0], "-e")) { 1026 elapsed=1; 1027 argc--; 1028 argv++; 1029 } else if (!strcmp(argv[0], "-t")) { 1030 timesort=1; 1031 argc--; 1032 argv++; 1033 } else if (!strcmp(argv[0], "-f")) { 1024 if (!strcmp(argv[0], "-f")) { 1034 1025 if (argc==1) { 1035 1026 owl_function_makemsg("zlist: -f needs an argument"); … … 1048 1039 } 1049 1040 1050 char *owl_command_alist()1041 void owl_command_alist(void) 1051 1042 { 1052 1043 owl_function_buddylist(1, 0, NULL); 1053 return(NULL); 1054 } 1055 1056 char *owl_command_blist() 1044 } 1045 1046 void owl_command_blist(void) 1057 1047 { 1058 1048 owl_function_buddylist(1, 1, NULL); 1059 return(NULL); 1060 } 1061 1062 char *owl_command_toggleoneline() 1049 } 1050 1051 void owl_command_toggleoneline(void) 1063 1052 { 1064 1053 owl_function_toggleoneline(); 1065 return(NULL); 1066 } 1067 1068 void owl_command_about() 1054 } 1055 1056 void owl_command_about(void) 1069 1057 { 1070 1058 owl_function_about(); 1071 1059 } 1072 1060 1073 void owl_command_version( )1061 void owl_command_version(void) 1074 1062 { 1075 1063 owl_function_makemsg("BarnOwl version %s", OWL_VERSION_STRING); … … 1322 1310 } 1323 1311 1324 void owl_command_expunge( )1312 void owl_command_expunge(void) 1325 1313 { 1326 1314 owl_function_expunge(); 1327 1315 } 1328 1316 1329 void owl_command_first( )1317 void owl_command_first(void) 1330 1318 { 1331 1319 owl_global_set_rightshift(&g, 0); … … 1333 1321 } 1334 1322 1335 void owl_command_last( )1323 void owl_command_last(void) 1336 1324 { 1337 1325 owl_function_lastmsg(); 1338 1326 } 1339 1327 1340 void owl_command_resize( )1328 void owl_command_resize(void) 1341 1329 { 1342 1330 owl_function_resize(); 1343 1331 } 1344 1332 1345 void owl_command_redisplay( )1333 void owl_command_redisplay(void) 1346 1334 { 1347 1335 owl_function_full_redisplay(); … … 1349 1337 } 1350 1338 1351 void owl_command_shift_right( )1339 void owl_command_shift_right(void) 1352 1340 { 1353 1341 owl_function_shift_right(); 1354 1342 } 1355 1343 1356 void owl_command_shift_left( )1344 void owl_command_shift_left(void) 1357 1345 { 1358 1346 owl_function_shift_left(); 1359 1347 } 1360 1348 1361 void owl_command_unsuball( )1349 void owl_command_unsuball(void) 1362 1350 { 1363 1351 owl_function_unsuball(); … … 1391 1379 } 1392 1380 1393 void owl_command_suspend( )1381 void owl_command_suspend(void) 1394 1382 { 1395 1383 owl_function_suspend(); … … 1675 1663 } 1676 1664 1677 void owl_command_quit( )1665 void owl_command_quit(void) 1678 1666 { 1679 1667 owl_function_quit(); … … 1987 1975 #else 1988 1976 owl_function_makemsg("This Owl does not support zcrypt"); 1977 return NULL; 1989 1978 #endif 1990 1979 } … … 2313 2302 } 2314 2303 2315 void owl_command_beep( )2304 void owl_command_beep(void) 2316 2305 { 2317 2306 owl_function_beep(); -
configure.ac
rd7cc50b rde8945b 4 4 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 5 5 6 AC_CONFIG_MACRO_DIR([m4]) 6 7 AC_CONFIG_HEADER([config.h]) 7 8 8 9 AC_PROG_CC 9 10 dnl Check for Athena11 AC_MSG_CHECKING(for /usr/athena/include)12 if test -d /usr/athena/include; then13 CFLAGS=${CFLAGS}\ -I/usr/athena/include14 CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include15 AC_MSG_RESULT(yes)16 else17 AC_MSG_RESULT(no)18 fi19 AC_MSG_CHECKING(for /usr/athena/lib)20 if test -d /usr/athena/lib; then21 LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib22 AC_MSG_RESULT(yes)23 else24 AC_MSG_RESULT(no)25 fi26 27 dnl Check for kerberosIV include28 AC_MSG_CHECKING(for kerberosIV)29 if test -d /usr/include/kerberosIV; then30 CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV31 CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV32 AC_MSG_RESULT(yes)33 elif test -d /usr/local/include/kerberosIV; then34 CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV35 CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV36 AC_MSG_RESULT(yes)37 elif test -d /usr/include/openssl; then38 CFLAGS=${CFLAGS}\ -I/usr/include/openssl39 CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl40 AC_MSG_RESULT(OpenSSL DES found instead)41 else42 AC_MSG_RESULT(no)43 fi44 10 45 11 AC_ARG_WITH([stack-protector], … … 50 16 51 17 AS_IF([test "x$with_stack_protector" != xno], 52 [ 53 SAVE_CFLAGS=$CFLAGS 54 CFLAGS="$CFLAGS -fstack-protector" 55 AC_MSG_CHECKING(whether protection cflags work) 56 AC_COMPILE_IFELSE(int i;, 57 [AC_MSG_RESULT(yes)], 58 [AC_MSG_RESULT(no) 59 CFLAGS=$SAVE_CFLAGS 60 if test "x$with_stack_protector" != xcheck; then 61 AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) 62 fi]) 63 AC_CHECK_LIB(ssp, __stack_chk_guard) 64 ]) 18 [AX_C_CHECK_FLAG([-fstack-protector],[],[], 19 [CFLAGS="$CFLAGS -fstack-protector"], 20 [if test "x$with_stack_protector" != xcheck; then 21 AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) 22 fi 23 ])]) 65 24 66 25 AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) 67 AC_CHECK_LIB(com_err, com_err) 68 AC_CHECK_LIB(nsl, gethostbyname) 69 AC_CHECK_LIB(socket, socket) 70 dnl AC_CHECK_LIB(des425, req_act_vno) 71 AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) 72 AC_CHECK_LIB(resolv, res_search) 26 AC_SEARCH_LIBS([gethostbyname], [nsl]) 27 AC_SEARCH_LIBS([socket], [socket]) 28 AC_SEARCH_LIBS([res_search], [resolv]) 73 29 74 30 AC_ARG_WITH([zephyr], … … 79 35 80 36 AS_IF([test "x$with_zephyr" != xno], 81 [AC_CHECK_LIB([zephyr], [ZGetSender], 37 [AC_MSG_CHECKING([for Kerberos IV]) 38 AS_IF([krb5-config krb4 --libs >/dev/null 2>&1], 39 [AC_MSG_RESULT([yes]) 40 AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV]) 41 CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`" 42 LIBS="${LIBS} `krb5-config krb4 --libs`" 43 ], 44 [AC_MSG_RESULT([no]) 45 PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto]) 46 CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}" 47 LIBS="${LIBS} ${LIBCRYPTO_LIBS}" 48 ]) 49 AC_CHECK_LIB([zephyr], [ZGetSender], 82 50 [LIBS="$LIBS -lzephyr" 83 51 AC_DEFINE([HAVE_LIBZEPHYR], [1], … … 86 54 AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], 87 55 [Have ZInitLocationInfo]),) 56 AC_CHECK_LIB([com_err], [com_err]) 57 AC_CHECK_HEADERS([com_err.h]) 88 58 ], 89 59 [if test "x$with_zephyr" != xcheck; then … … 93 63 ])]) 94 64 95 AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) 96 AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) 97 98 AC_MSG_CHECKING(for des_ecb_encrypt prototype) 99 AC_TRY_COMPILE([#include <des.h> 100 int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], 101 [int foo = des_ecb_encrypt(0,0,0,0);], 102 ac_cv_des_ecb_encrypt_proto=no, 103 ac_cv_des_ecb_encrypt_proto=yes) 104 AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) 105 if test "$ac_cv_des_ecb_encrypt_proto" = yes; then 106 AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) 107 fi 65 AC_CHECK_FUNCS([use_default_colors resizeterm]) 66 AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt]) 67 AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched]) 108 68 109 69 dnl Checks for header files. 110 70 AC_HEADER_STDC 111 71 AC_HEADER_SYS_WAIT 112 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)72 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h) 113 73 114 74 dnl Add CFLAGS for embeded perl 115 FOO=`perl -MExtUtils::Embed -e ccopts`116 AC_MSG_NOTICE([Adding perl CFLAGS ${ FOO}])117 CFLAGS= ${CFLAGS}\ ${FOO}75 PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts` 76 AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}]) 77 CFLAGS="${CFLAGS} ${PERL_CFLAGS}" 118 78 119 79 dnl Find the location of perl XSUBPP … … 154 114 dnl Checks for typedefs, structures, and compiler characteristics. 155 115 116 AX_CFLAGS_WARN_ALL 117 AX_CFLAGS_STRICT_PROTOTYPES 118 119 AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[], 120 [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"]) 121 122 AC_SUBST([LIBFAIM_CFLAGS]) 123 156 124 AC_SUBST(XSUBPPDIR) 157 125 AC_SUBST(XSUBPPFLAGS) -
editwin.c
r8459609 r2184001 466 466 int index; 467 467 int count = 0; 468 int point;469 468 int n, i; 470 469 int last; … … 475 474 e->lock = 0; /* we can (must) tread on the locktext */ 476 475 477 point = e->index;478 476 last = -1; 479 477 while (count < goal) { … … 1073 1071 owl_editwin_exchange_point_and_mark(e); 1074 1072 1075 owl_editwin_replace (e, oe_copy_region(e), "");1073 owl_editwin_replace_internal(e, oe_copy_region(e), ""); 1076 1074 } 1077 1075 -
fmtext.c
r89b2daf rf119757 272 272 if (owl_global_get_hascolors(&g)) { 273 273 wcolor_set(w,pair,NULL); 274 wbkgdset(w, COLOR_PAIR(pair)); 274 275 } 275 276 } … … 344 345 fg = f->default_fgcolor; 345 346 bg = f->default_bgcolor; 346 while ( p &&owl_fmtext_is_format_char(g_utf8_get_char(p))) {347 while (owl_fmtext_is_format_char(g_utf8_get_char(p))) { 347 348 _owl_fmtext_update_attributes(g_utf8_get_char(p), &attr, &fg, &bg); 348 349 p = g_utf8_next_char(p); … … 365 366 waddstr(w, s); 366 367 } 368 wbkgdset(w, 0); 367 369 } 368 370 … … 418 420 /* Truncate the message so that each line begins at column 'acol' and 419 421 * ends at 'bcol' or sooner. The first column is number 0. The new 420 * message is placed in 'out'. The message is * expected to end in a 421 * new line for now. NOTE: This needs to be modified to deal with 422 * backing up if we find a SPACING COMBINING MARK at the end of a 423 * line. If that happens, we should back up to the last non-mark 424 * character and stop there. 422 * message is placed in 'out'. The message is expected to end in a 423 * new line for now. 424 * 425 * NOTE: This needs to be modified to deal with backing up if we find 426 * a SPACING COMBINING MARK at the end of a line. If that happens, we 427 * should back up to the last non-mark character and stop there. 428 * 429 * NOTE: If a line ends at bcol, we omit the newline. This is so printing 430 * to ncurses works. 425 431 */ 426 432 void owl_fmtext_truncate_cols(const owl_fmtext *in, int acol, int bcol, owl_fmtext *out) … … 826 832 827 833 /* Reset used list */ 828 void owl_fmtext_reset_colorpairs( )834 void owl_fmtext_reset_colorpairs(void) 829 835 { 830 836 if (owl_global_get_hascolors(&g)) { -
functions.c
r27964fe r340c3e7 44 44 } 45 45 46 void owl_function_show_commands( )46 void owl_function_show_commands(void) 47 47 { 48 48 owl_list l; … … 78 78 } 79 79 80 void owl_function_show_styles( ) {80 void owl_function_show_styles(void) { 81 81 owl_list l; 82 82 owl_fmtext fm; … … 120 120 } 121 121 122 void owl_function_show_license( )122 void owl_function_show_license(void) 123 123 { 124 124 const char *text; … … 166 166 } 167 167 168 void owl_function_show_quickstart( )168 void owl_function_show_quickstart(void) 169 169 { 170 170 const char *message = … … 357 357 } 358 358 359 void owl_function_loopwrite_setup( )359 void owl_function_loopwrite_setup(void) 360 360 { 361 361 owl_editwin *e; … … 472 472 owl_zwrite_set_message(&z, cryptmsg); 473 473 owl_zwrite_set_opcode(&z, "crypt"); 474 mymsg=cryptmsg;475 474 476 475 owl_zwrite_send_message(&z); … … 646 645 void owl_function_prevmsg_full(const char *filter, int skip_deleted, int first_if_none) 647 646 { 648 int curmsg, i, viewsize,found;647 int curmsg, i, found; 649 648 const owl_view *v; 650 649 const owl_filter *f = NULL; … … 662 661 663 662 curmsg=owl_global_get_curmsg(&g); 664 viewsize=owl_view_get_size(v);665 663 found=0; 666 664 … … 693 691 } 694 692 695 void owl_function_nextmsg( )693 void owl_function_nextmsg(void) 696 694 { 697 695 owl_function_nextmsg_full(NULL, 0, 1); 698 696 } 699 697 700 void owl_function_prevmsg( )698 void owl_function_prevmsg(void) 701 699 { 702 700 owl_function_prevmsg_full(NULL, 0, 1); 703 701 } 704 702 705 void owl_function_nextmsg_notdeleted( )703 void owl_function_nextmsg_notdeleted(void) 706 704 { 707 705 owl_function_nextmsg_full(NULL, 1, 1); 708 706 } 709 707 710 void owl_function_prevmsg_notdeleted( )708 void owl_function_prevmsg_notdeleted(void) 711 709 { 712 710 owl_function_prevmsg_full(NULL, 1, 1); … … 772 770 } 773 771 774 void owl_function_expunge( )772 void owl_function_expunge(void) 775 773 { 776 774 int curmsg; … … 808 806 } 809 807 810 void owl_function_firstmsg( )808 void owl_function_firstmsg(void) 811 809 { 812 810 owl_global_set_curmsg(&g, 0); … … 816 814 } 817 815 818 void owl_function_lastmsg_noredisplay( )816 void owl_function_lastmsg_noredisplay(void) 819 817 { 820 818 int oldcurmsg, curmsg; … … 838 836 } 839 837 840 void owl_function_lastmsg( )838 void owl_function_lastmsg(void) 841 839 { 842 840 owl_function_lastmsg_noredisplay(); … … 844 842 } 845 843 846 void owl_function_shift_right( )844 void owl_function_shift_right(void) 847 845 { 848 846 owl_global_set_rightshift(&g, owl_global_get_rightshift(&g)+10); … … 851 849 } 852 850 853 void owl_function_shift_left( )851 void owl_function_shift_left(void) 854 852 { 855 853 int shift; … … 866 864 } 867 865 868 void owl_function_unsuball( )866 void owl_function_unsuball(void) 869 867 { 870 868 unsuball(); … … 946 944 } 947 945 948 void owl_function_suspend( )946 void owl_function_suspend(void) 949 947 { 950 948 endwin(); … … 956 954 } 957 955 958 void owl_function_zaway_toggle( )956 void owl_function_zaway_toggle(void) 959 957 { 960 958 if (!owl_global_is_zaway(&g)) { … … 966 964 } 967 965 968 void owl_function_zaway_on( )966 void owl_function_zaway_on(void) 969 967 { 970 968 owl_global_set_zaway_on(&g); … … 972 970 } 973 971 974 void owl_function_zaway_off( )972 void owl_function_zaway_off(void) 975 973 { 976 974 owl_global_set_zaway_off(&g); … … 978 976 } 979 977 980 void owl_function_aaway_toggle( )978 void owl_function_aaway_toggle(void) 981 979 { 982 980 if (!owl_global_is_aaway(&g)) { … … 988 986 } 989 987 990 void owl_function_aaway_on( )988 void owl_function_aaway_on(void) 991 989 { 992 990 owl_global_set_aaway_on(&g); … … 995 993 } 996 994 997 void owl_function_aaway_off( )995 void owl_function_aaway_off(void) 998 996 { 999 997 owl_global_set_aaway_off(&g); … … 1002 1000 } 1003 1001 1004 void owl_function_quit( )1002 void owl_function_quit(void) 1005 1003 { 1006 1004 char *ret; … … 1227 1225 } 1228 1226 1229 void owl_function_resize( )1227 void owl_function_resize(void) 1230 1228 { 1231 1229 owl_global_set_resize_pending(&g); 1232 1230 } 1233 1231 1234 void owl_function_run_buffercommand( )1232 void owl_function_run_buffercommand(void) 1235 1233 { 1236 1234 owl_editwin_do_callback(owl_global_get_typwin(&g)); … … 1264 1262 } 1265 1263 1266 void owl_function_beep( )1264 void owl_function_beep(void) 1267 1265 { 1268 1266 if (owl_global_is_bell(&g)) { … … 1302 1300 } 1303 1301 1304 void owl_function_full_redisplay( )1302 void owl_function_full_redisplay(void) 1305 1303 { 1306 1304 redrawwin(owl_global_get_curs_recwin(&g)); … … 1384 1382 } 1385 1383 1386 void owl_function_about( )1384 void owl_function_about(void) 1387 1385 { 1388 1386 owl_function_popless_text( … … 1410 1408 } 1411 1409 1412 void owl_function_info( )1410 void owl_function_info(void) 1413 1411 { 1414 1412 const owl_message *m; … … 1545 1543 * style the user may be using 1546 1544 */ 1547 void owl_function_curmsg_to_popwin( )1545 void owl_function_curmsg_to_popwin(void) 1548 1546 { 1549 1547 const owl_view *v; … … 1628 1626 } 1629 1627 1630 void owl_function_mainwin_pagedown( )1628 void owl_function_mainwin_pagedown(void) 1631 1629 { 1632 1630 int i; … … 1643 1641 } 1644 1642 1645 void owl_function_mainwin_pageup( )1643 void owl_function_mainwin_pageup(void) 1646 1644 { 1647 1645 owl_global_set_curmsg(&g, owl_global_get_topmsg(&g)); … … 1649 1647 } 1650 1648 1651 void owl_function_getsubs( )1649 void owl_function_getsubs(void) 1652 1650 { 1653 1651 char *buff; … … 1664 1662 } 1665 1663 1666 void owl_function_printallvars( )1664 void owl_function_printallvars(void) 1667 1665 { 1668 1666 const char *name; … … 1691 1689 } 1692 1690 1693 void owl_function_show_variables( )1691 void owl_function_show_variables(void) 1694 1692 { 1695 1693 owl_list varnames; … … 1745 1743 } 1746 1744 1747 void owl_function_delete_automsgs( )1745 void owl_function_delete_automsgs(void) 1748 1746 { 1749 1747 /* mark for deletion all messages in the current view that match the … … 1778 1776 } 1779 1777 1780 void owl_function_status( )1778 void owl_function_status(void) 1781 1779 { 1782 1780 char buff[MAXPATHLEN+1]; … … 1858 1856 } 1859 1857 1860 void owl_function_show_term( )1858 void owl_function_show_term(void) 1861 1859 { 1862 1860 owl_fmtext fm; … … 2271 2269 } 2272 2270 2273 void owl_function_show_filters( )2271 void owl_function_show_filters(void) 2274 2272 { 2275 2273 const owl_list *l; … … 2316 2314 } 2317 2315 2318 void owl_function_show_zpunts( )2316 void owl_function_show_zpunts(void) 2319 2317 { 2320 2318 const owl_filter *f; … … 2749 2747 } 2750 2748 2751 void owl_function_show_colors( )2749 void owl_function_show_colors(void) 2752 2750 { 2753 2751 owl_fmtext fm; … … 2899 2897 } 2900 2898 2901 void owl_function_show_keymaps( )2899 void owl_function_show_keymaps(void) 2902 2900 { 2903 2901 owl_list l; … … 3193 3191 void owl_function_dump(const char *filename) 3194 3192 { 3195 int i, j , count;3193 int i, j; 3196 3194 owl_message *m; 3197 3195 const owl_view *v; … … 3216 3214 } 3217 3215 3218 count=0;3219 3216 j=owl_view_get_size(v); 3220 3217 for (i=0; i<j; i++) { … … 3379 3376 } 3380 3377 3381 void owl_function_toggleoneline( )3378 void owl_function_toggleoneline(void) 3382 3379 { 3383 3380 owl_view *v; … … 3400 3397 void owl_function_error(const char *fmt, ...) 3401 3398 { 3399 static int in_error = 0; 3402 3400 va_list ap; 3403 3401 char *buff; 3404 3402 const char *nl; 3405 3403 3404 if (++in_error > 2) { 3405 /* More than two nested errors, bail immediately. */ 3406 in_error--; 3407 return; 3408 } 3409 3406 3410 va_start(ap, fmt); 3407 3408 3411 buff = g_strdup_vprintf(fmt, ap); 3412 va_end(ap); 3413 3409 3414 owl_function_debugmsg("ERROR: %s", buff); 3415 owl_function_log_err(buff); 3416 3410 3417 nl = strchr(buff, '\n'); 3411 if(nl && *(nl + 1)) { 3418 3419 /* 3420 Showing admin messages triggers a lot of code. If we have a 3421 recursive error call, that's the most likely candidate, so 3422 suppress the call in that case, to try to avoid infinite looping. 3423 */ 3424 3425 if(nl && *(nl + 1) && in_error == 1) { 3412 3426 /* Multiline error */ 3413 3427 owl_function_adminmsg("ERROR", buff); … … 3415 3429 owl_function_makemsg("[Error] %s", buff); 3416 3430 } 3417 owl_function_log_err(buff); 3418 va_end(ap); 3431 3419 3432 owl_free(buff); 3433 3434 in_error--; 3420 3435 } 3421 3436 … … 3438 3453 } 3439 3454 3440 void owl_function_showerrs( )3455 void owl_function_showerrs(void) 3441 3456 { 3442 3457 owl_fmtext fm; … … 3552 3567 } 3553 3568 3554 int owl_function_get_color_count( )3569 int owl_function_get_color_count(void) 3555 3570 { 3556 3571 return COLORS; … … 3579 3594 } 3580 3595 3581 void owl_function_mark_message( )3596 void owl_function_mark_message(void) 3582 3597 { 3583 3598 const owl_message *m; … … 3598 3613 } 3599 3614 3600 void owl_function_swap_cur_marked( )3615 void owl_function_swap_cur_marked(void) 3601 3616 { 3602 3617 int marked_id; -
global.c
r27f6487 r40bda84 115 115 g->timerlist = NULL; 116 116 g->interrupted = FALSE; 117 g->got_sigtstp = FALSE; 117 118 } 118 119 … … 482 483 sepbar(NULL); 483 484 owl_editwin_redisplay(g->tw, 0); 484 owl_function_full_redisplay( &g);485 owl_function_full_redisplay(); 485 486 486 487 /* TODO: this should handle other forms of popwins */ … … 968 969 g->interrupted = 0; 969 970 } 971 972 int owl_global_is_sigstp(const owl_global *g) { 973 return g->got_sigtstp; 974 } 975 976 void owl_global_set_got_sigstp(owl_global *g) { 977 g->got_sigtstp = 1; 978 } 979 980 void owl_global_unset_got_sigstp(owl_global *g) { 981 g->got_sigtstp = 0; 982 } -
help.c
re19eb97 rc79a047 2 2 #include <string.h> 3 3 4 void owl_help( )4 void owl_help(void) 5 5 { 6 6 owl_fmtext fm; -
keys.c
r65a9870 rdbe172d 349 349 350 350 if (pw && owl_popwin_is_active(pw) && v) { 351 owl_popwin_refresh(pw); 351 352 owl_viewwin_redisplay(v, 1); 352 353 } -
libfaim/Makefile.am
red62482 r215c119 10 10 aim_cbtypes.h aim.h aim_internal.h faimconfig.h md5.h 11 11 12 libfaim_a_CFLAGS = $(LIBFAIM_CFLAGS) 12 13 libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \ 13 14 -I${top_srcdir}/libfaim -
logging.c
re2ebf39 rc79a047 179 179 180 180 /* create a present message so we can pass it to 181 * owl_log_shouldlog_message( )181 * owl_log_shouldlog_message(void) 182 182 */ 183 183 m = owl_malloc(sizeof(owl_message)); -
mainwin.c
r9e5c9f3 r9bda818 32 32 33 33 recwinlines=owl_global_get_recwin_lines(&g); 34 topmsg=owl_global_get_topmsg(&g);35 34 viewsize=owl_view_get_size(v); 36 35 -
message.c
r24ccc01 rc79a047 14 14 static owl_fmtext_cache * fmtext_cache_next = fmtext_cache; 15 15 16 void owl_message_init_fmtext_cache ()16 void owl_message_init_fmtext_cache(void) 17 17 { 18 18 int i; … … 23 23 } 24 24 25 owl_fmtext_cache * owl_message_next_fmtext() /*noproto*/25 owl_fmtext_cache *owl_message_next_fmtext(void) /*noproto*/ 26 26 { 27 27 owl_fmtext_cache * f = fmtext_cache_next; -
owl.c
r4e4847c r40bda84 46 46 } owl_options; 47 47 48 void usage( )48 void usage(void) 49 49 { 50 50 fprintf(stderr, "Barnowl version %s\n", OWL_VERSION_STRING); … … 378 378 } 379 379 380 void sigtstp_handler(int sig, siginfo_t *si, void *data) 381 { 382 owl_global_set_got_sigstp(&g); 383 } 384 380 385 void owl_register_signal_handlers(void) { 381 386 struct sigaction sigact; … … 395 400 sigaction(SIGINT, &sigact, NULL); 396 401 402 sigact.sa_sigaction=sigtstp_handler; 403 sigaction(SIGTSTP, &sigact, NULL); 397 404 } 398 405 -
owl.h
r24ccc01 r40bda84 588 588 int load_initial_subs; 589 589 int interrupted; 590 int got_sigtstp; 590 591 } owl_global; 591 592 -
perl/lib/BarnOwl.pm
r7589f0a rde3f641 427 427 } 428 428 429 =head3 default_zephyr_signature 430 431 Compute the default zephyr signature. 432 433 =cut 434 435 sub default_zephyr_signature 436 { 437 if (my $zsig = getvar('zsig')) { 438 return $zsig; 439 } 440 if (my $zsigproc = getvar('zsigproc')) { 441 return `$zsigproc`; 442 } 443 my $zwrite_signature = get_zephyr_variable('zwrite-signature'); 444 if (defined($zwrite_signature)) { 445 return $zwrite_signature; 446 } 447 my $name = ((getpwuid($<))[6]); 448 $name =~ s/,.*//; 449 return $name; 450 } 451 429 452 # Stub for owl::startup / BarnOwl::startup, so it isn't bound to the 430 453 # startup command. This may be redefined in a user's configfile. -
perl/lib/BarnOwl/Complete/Zephyr.pm
rfdc0c47 r9300fe5 45 45 my $m = shift; 46 46 return unless $m->type eq 'zephyr'; 47 $classes{ $m->class} = 1;48 $realms{ $m->realm} = 1;49 $users{ BarnOwl::Message::Zephyr::strip_realm($m->sender)} = 1;47 $classes{lc $m->class} = 1; 48 $realms{lc $m->realm} = 1; 49 $users{lc BarnOwl::Message::Zephyr::strip_realm($m->sender)} = 1; 50 50 } 51 51 -
perl/lib/BarnOwl/Hooks.pm
r03e25c5 re2f7963 196 196 my $package = "BarnOwl"; 197 197 198 199 if(!contains(\@BarnOwl::all_commands, $command)) { 200 push @BarnOwl::all_commands, $command; 201 } 202 198 203 if($symbol =~ m{^edit:(.+)$}) { 199 204 $symbol = $1; … … 222 227 } 223 228 } 224 225 if(!contains(\@BarnOwl::all_commands, $command)) {226 push @BarnOwl::all_commands, $command;227 }228 229 } 229 230 -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Completion.pm
r216b1d0 r955a36e 6 6 use BarnOwl::Completion::Util qw(complete_flags); 7 7 8 my %networks = (); 9 my %dests = (); 10 my %servers = (); 8 our %users = (); 9 our %servers = (); 11 10 12 sub complete_networks { keys % networks }13 sub complete_dests { keys % dests}14 sub complete_channels { grep /^#/, keys %dests }15 sub complete_nicks { grep /^[^#]/, keys %dests }11 sub complete_networks { keys %BarnOwl::Module::IRC::ircnets } 12 sub complete_dests { keys %users, complete_channels() } 13 sub complete_channels { keys %BarnOwl::Module::IRC::channels } 14 sub complete_nicks { keys %users } 16 15 sub complete_servers { keys %servers } 17 16 … … 75 74 my $m = shift; 76 75 return unless $m->type eq 'IRC'; 77 $networks{$m->network} = 1; 78 $dests{$m->recipient} = 1; 79 $dests{$m->sender} = 1; 76 if ($m->recipient && $m->recipient !~ m{^#}) { 77 $users{$m->recipient} = 1; 78 } 79 if ($m->sender && $m->sender !~ m{^#}) { 80 $users{$m->sender} = 1; 81 } 80 82 $servers{$m->server} = 1; 81 83 } -
perlconfig.c
reea72a1 r1373d35 26 26 { 27 27 SV *ret = newSVpv(str, 0); 28 if(is_utf8_string( str, strlen(str))) {28 if(is_utf8_string((U8*)str, strlen(str))) { 29 29 SvUTF8_on(ret); 30 30 } else { … … 523 523 if(cb == NULL) { 524 524 owl_function_error("Perl callback is NULL!"); 525 return; 525 526 } 526 527 text = owl_new_sv(owl_editwin_get_text(e)); … … 546 547 } 547 548 548 void owl_perlconfig_mainloop( )549 void owl_perlconfig_mainloop(owl_timer *t, void *data) 549 550 { 550 551 dSP; -
perlglue.xs
r9e5b5fd r9e5b5fd 29 29 MODULE = BarnOwl PACKAGE = BarnOwl 30 30 31 c har *31 const char * 32 32 command(cmd, ...) 33 33 const char *cmd … … 100 100 i = owl_zwrite_create_and_send_from_line(cmd, msg); 101 101 102 c har *102 const char * 103 103 ztext_stylestrip(ztext) 104 104 const char *ztext … … 113 113 if (rv) owl_free(rv); 114 114 115 c har *115 const char * 116 116 zephyr_smartstrip_user(in) 117 117 const char *in … … 128 128 owl_free(rv); 129 129 130 c har *130 const char * 131 131 zephyr_getsubs() 132 132 PREINIT: … … 174 174 owl_function_start_question(line); 175 175 176 SvREFCNT_inc(callback); 177 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback); 176 owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback)); 178 177 owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback); 179 178 } … … 190 189 owl_function_start_password(line); 191 190 192 SvREFCNT_inc(callback); 193 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback); 191 owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback)); 194 192 owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback); 195 193 } … … 216 214 owl_global_set_typwin_active(&g); 217 215 218 SvREFCNT_inc(callback); 219 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback); 216 owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback)); 220 217 owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback); 221 218 } … … 312 309 } 313 310 314 c har *311 const char * 315 312 wordwrap(in, cols) 316 313 const char *in … … 331 328 SV * cb 332 329 CODE: 333 SvREFCNT_inc(cb); 334 owl_select_add_perl_dispatch(fd, cb); 330 owl_select_add_perl_dispatch(fd, SvREFCNT_inc(cb)); 335 331 336 332 void … … 421 417 422 418 const char * 419 get_zephyr_variable(name) 420 const char *name; 421 CODE: 422 RETVAL = owl_zephyr_get_variable(name); 423 OUTPUT: 424 RETVAL 425 426 const char * 423 427 skiptokens(str, n) 424 428 const char *str; … … 448 452 croak("Command function must be a coderef!"); 449 453 } 450 SvREFCNT_inc(func);451 454 cmd.name = name; 452 cmd.cmd_perl = func;455 cmd.cmd_perl = SvREFCNT_inc(func); 453 456 cmd.summary = summary; 454 457 cmd.usage = usage; … … 561 564 RETVAL 562 565 563 c har *566 const char * 564 567 get_region() 565 568 PREINIT: -
popwin.c
r9c01a5e r8240bce 62 62 owl_global_set_needrefresh(&g); 63 63 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 64 owl_function_full_redisplay( &g);64 owl_function_full_redisplay(); 65 65 return(0); 66 66 } -
scripts/do-release
rb9df757 r168f8a9 7 7 8 8 force= 9 no_tag= 9 10 10 if [ "$1" = "-f" ]; then 11 force=1 12 fi 11 for arg; do 12 case $arg in 13 -f) force=1 ;; 14 --no-tag) no_tag=1 ;; 15 esac 16 done 13 17 14 18 VERS=$(perl -ne 'print $1 if m{^AC_INIT\(\[[^\]]+\],\s*\[([^\]]+)\]}' configure.ac) \ … … 21 25 fi 22 26 23 if git cat-file -t "$TAG" > /dev/null 2>&1; then 24 die "Error: Object $TAG already exists." 27 if ! [ "$no_tag" ]; then 28 if git cat-file -t "$TAG" > /dev/null 2>&1; then 29 die "Error: Object $TAG already exists." 30 fi 31 32 git tag -s -m "BarnOwl $VERS" "$TAG" 33 else 34 TAG=HEAD 25 35 fi 26 36 … … 28 38 for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done 29 39 trap 'exittrap' EXIT 30 31 git tag -s -m "BarnOwl $VERS" "$TAG"32 40 33 41 TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX) -
select.c
r27f6487 r40bda84 152 152 } 153 153 154 int owl_select_dispatch_count( )154 int owl_select_dispatch_count(void) 155 155 { 156 156 return owl_list_get_size(owl_global_get_dispatchlist(&g)); … … 205 205 FD_ZERO(e); 206 206 max_fd = 0; 207 len = owl_select_dispatch_count( g);207 len = owl_select_dispatch_count(); 208 208 for(i = 0; i < len; i++) { 209 209 d = owl_list_get_element(dl, i); … … 215 215 } 216 216 217 void owl_select_gc( )217 void owl_select_gc(void) 218 218 { 219 219 int i; … … 325 325 } 326 326 327 void owl_select_handle_intr() 327 void owl_select_mask_signals(sigset_t *oldmask) { 328 sigset_t set; 329 330 sigemptyset(&set); 331 sigaddset(&set, SIGINT); 332 sigaddset(&set, SIGTSTP); 333 sigprocmask(SIG_BLOCK, &set, oldmask); 334 } 335 336 void owl_select_handle_intr(sigset_t *restore) 328 337 { 329 338 owl_input in; 330 339 331 340 owl_global_unset_interrupted(&g); 332 owl_function_unmask_sigint(NULL); 341 342 sigprocmask(SIG_SETMASK, restore, NULL); 333 343 334 344 in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR]; … … 336 346 } 337 347 338 void owl_select() 348 void owl_select_check_tstp() { 349 if(owl_global_is_sigstp(&g)) { 350 owl_function_makemsg("Use :suspend to suspend."); 351 owl_global_unset_got_sigstp(&g); 352 } 353 } 354 355 void owl_select(void) 339 356 { 340 357 int i, max_fd, aim_max_fd, aim_done, ret; … … 347 364 owl_select_process_timers(&timeout); 348 365 349 owl_function_mask_sigint(&mask); 366 owl_select_mask_signals(&mask); 367 368 owl_select_check_tstp(); 350 369 if(owl_global_is_interrupted(&g)) { 351 owl_select_handle_intr( );370 owl_select_handle_intr(&mask); 352 371 return; 353 372 } … … 381 400 /* END AIM HACK */ 382 401 383 384 402 ret = pselect(max_fd+1, &r, &aim_wfds, &e, &timeout, &mask); 385 403 386 404 if(ret < 0 && errno == EINTR) { 405 owl_select_check_tstp(); 387 406 if(owl_global_is_interrupted(&g)) { 388 owl_select_handle_intr(); 389 } 407 owl_select_handle_intr(NULL); 408 } 409 sigprocmask(SIG_SETMASK, &mask, NULL); 390 410 return; 391 411 } 392 412 393 owl_function_unmask_sigint(NULL);413 sigprocmask(SIG_SETMASK, &mask, NULL); 394 414 395 415 if(ret > 0) { -
text.c
re19eb97 rebbeb39 316 316 toquote_len=strlen(toquote); 317 317 quotestr_len=strlen(quotestr); 318 out=owl_malloc((in_len*quotestr_len)+30);319 318 place=0; 320 319 escape = 0; -
util.c
reea72a1 rf119757 454 454 455 455 /* Get the default tty name. Caller must free the return */ 456 char *owl_util_get_default_tty( )456 char *owl_util_get_default_tty(void) 457 457 { 458 458 const char *tmp; … … 475 475 476 476 /* Animation hack */ 477 void owl_hack_animate( )477 void owl_hack_animate(void) 478 478 { 479 479 const owl_messagelist *ml; … … 557 557 * inefficient impelementation which reads the entire file into 558 558 * memory. 559 * 560 * Returns the number of lines removed 559 561 */ 560 voidowl_util_file_deleteline(const char *filename, const char *line, int backup)562 int owl_util_file_deleteline(const char *filename, const char *line, int backup) 561 563 { 562 564 char buff[LINE], *text; … … 564 566 FILE *file, *backupfile=NULL; 565 567 int size, newline; 568 int numremoved = 0; 566 569 567 570 /* open the file for reading */ … … 569 572 if (!file) { 570 573 owl_function_error("Error opening file %s", filename); 571 return ;574 return 0; 572 575 } 573 576 … … 580 583 owl_free(backupfilename); 581 584 fclose(file); 582 return ;585 return 0; 583 586 } 584 587 } … … 604 607 strcat(text, buff); 605 608 if (newline) strcat(text, "\n"); 609 } else { 610 numremoved++; 606 611 } 607 612 … … 628 633 owl_free(backupfilename); 629 634 owl_free(text); 635 636 return numremoved; 630 637 } 631 638 … … 664 671 } 665 672 666 const char * owl_get_datadir( )673 const char * owl_get_datadir(void) 667 674 { 668 675 const char * datadir = getenv("BARNOWL_DATA_DIR"); … … 689 696 strncat(r, s, p-s); 690 697 p = g_utf8_next_char(p); 691 while ( p &&owl_fmtext_is_format_char(g_utf8_get_char(p))) {698 while (owl_fmtext_is_format_char(g_utf8_get_char(p))) { 692 699 p = g_utf8_next_char(p); 693 700 } -
variable.c
r8bce750 rde3f641 208 208 "principal. Note that customizing the sender name will\n" 209 209 "cause your zephyrs to be sent unauthenticated."), 210 211 OWLVAR_STRING( "zsigfunc" /* %OwlVarStub */, "BarnOwl::default_zephyr_signature()", 212 "zsig perl function", 213 "Called every time you start a zephyrgram without an\n" 214 "explicit zsig. The default setting implements the policy\n" 215 "descripted in the documentation for the 'zsig' variable.\n"), 210 216 211 217 OWLVAR_STRING( "zsig" /* %OwlVarStub */, "", -
viewwin.c
r4083c49 rdd6af02 35 35 void owl_viewwin_init_fmtext(owl_viewwin *v, WINDOW *win, int winlines, int wincols, const owl_fmtext *fmtext) 36 36 { 37 char *text; 38 37 39 owl_fmtext_copy(&(v->fmtext), fmtext); 40 text = owl_fmtext_print_plain(fmtext); 41 if (text[0] != '\0' && text[strlen(text) - 1] != '\n') { 42 owl_fmtext_append_normal(&(v->fmtext), "\n"); 43 } 38 44 v->textlines=owl_fmtext_num_lines(&(v->fmtext)); 39 45 v->topline=0; -
zcrypt.c
r36486be ra6ac9fe 23 23 #include <unistd.h> 24 24 #include <sys/types.h> 25 #include <des.h> 25 26 #ifdef HAVE_KERBEROS_IV 27 #include <kerberosIV/des.h> 28 #else 29 #include <openssl/des.h> 30 #endif 26 31 27 32 #define MAX_KEY 128 … … 51 56 char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance); 52 57 53 #ifndef HAVE_DES_ECB_ENCRYPT_PROTO54 int des_ecb_encrypt(char [], char [], des_key_schedule, int);55 #endif56 57 58 #define M_NONE 0 58 59 #define M_ZEPHYR_ENCRYPT 1 … … 61 62 #define M_RANDOMIZE 4 62 63 #define M_SETKEY 5 64 65 static void owl_zcrypt_string_to_schedule(char *keystring, des_key_schedule schedule) { 66 #ifdef HAVE_KERBEROS_IV 67 des_cblock key; 68 #else 69 des_cblock _key, *key = &_key; 70 #endif 71 72 des_string_to_key(keystring, key); 73 des_key_sched(key, schedule); 74 } 63 75 64 76 /* The 'owl_zcrypt_decrypt' function was written by kretch for Owl. … … 73 85 char *fname, keystring[MAX_KEY]; 74 86 FILE *fkey; 75 des_cblock key;76 87 des_key_schedule schedule; 77 char input[8], output[9];88 unsigned char input[8], output[8]; 78 89 int i, c1, c2; 79 90 … … 82 93 fkey=fopen(fname, "r"); 83 94 if (!fkey) return(-1); 84 fgets(keystring, MAX_KEY-1, fkey); 95 if (!fgets(keystring, MAX_KEY-1, fkey)) { 96 fclose(fkey); 97 return -1; 98 } 85 99 fclose(fkey); 86 100 … … 88 102 89 103 output[0] = '\0'; /* In case no message at all */ 90 output[8] = '\0'; /* NULL at end will limit string length to 8 */ 91 92 des_string_to_key(keystring, key); 93 des_key_sched(key, schedule); 104 105 owl_zcrypt_string_to_schedule(keystring, schedule); 94 106 95 107 inptr=in; … … 102 114 inptr+=2; 103 115 } 104 des_ecb_encrypt(input, output, schedule, FALSE); 105 strcat(out, output); 106 } 107 108 if (output[0]) { 109 if (output[strlen(output)-1] != '\n') { 110 strcat(out, "\n"); 111 } 112 } else { 116 des_ecb_encrypt(&input, &output, schedule, FALSE); 117 strncat(out, (const char *)output, 8); 118 } 119 120 if (out[0] && out[strlen(out) - 1] != '\n') 113 121 strcat(out, "\n"); 114 }115 122 return(0); 116 123 } … … 119 126 char *fname, keystring[MAX_KEY]; 120 127 FILE *fkey; 121 des_cblock key;122 128 des_key_schedule schedule; 123 char input[8], output[8];129 unsigned char input[8], output[8]; 124 130 int size, length, i; 125 131 const char *inbuff = NULL, *inptr; 126 int use_buffer = FALSE;127 132 int num_blocks=0, last_block_size=0; 128 133 … … 131 136 fkey=fopen(fname, "r"); 132 137 if (!fkey) return(-1); 133 fgets(keystring, MAX_KEY-1, fkey); 138 if (!fgets(keystring, MAX_KEY-1, fkey)) { 139 fclose(fkey); 140 return -1; 141 } 134 142 fclose(fkey); 135 143 136 des_string_to_key(keystring, key); 137 des_key_sched(key, schedule); 144 owl_zcrypt_string_to_schedule(keystring, schedule); 138 145 139 146 inbuff=in; … … 141 148 num_blocks=(length+7)/8; 142 149 last_block_size=((length+7)%8)+1; 143 use_buffer=TRUE;144 150 145 151 strcpy(out, ""); … … 167 173 168 174 /* Encrypt and output the block */ 169 des_ecb_encrypt( input,output, schedule, TRUE);175 des_ecb_encrypt(&input, &output, schedule, TRUE); 170 176 171 177 for (i = 0; i < 8; i++) { … … 216 222 /* Scan file for a match */ 217 223 while (!feof(fsearch)) { 218 fgets(buffer, MAX_BUFF - 3, fsearch);224 if (!fgets(buffer, MAX_BUFF - 3, fsearch)) break; 219 225 for (i = 0; i < numsearch; i++) { 220 226 if (strncasecmp(varname[i], buffer, length[i]) == 0) { … … 262 268 } 263 269 264 static pid_t zephyrpipe_pid = 0; 265 266 #endif 270 #endif -
zephyr.c
re440602 rc79a047 15 15 } owl_sub_list; 16 16 17 Code_t ZResetAuthentication( );17 Code_t ZResetAuthentication(void); 18 18 #endif 19 19 … … 21 21 22 22 #ifdef HAVE_LIBZEPHYR 23 void owl_zephyr_initialize( )23 void owl_zephyr_initialize(void) 24 24 { 25 25 int ret; … … 127 127 } 128 128 129 void owl_zephyr_load_initial_subs( ) {129 void owl_zephyr_load_initial_subs(void) { 130 130 int ret_sd, ret_bd, ret_u; 131 131 … … 154 154 } 155 155 #else 156 void owl_zephyr_initialize( )157 { 158 } 159 #endif 160 161 162 int owl_zephyr_shutdown( )156 void owl_zephyr_initialize(void) 157 { 158 } 159 #endif 160 161 162 int owl_zephyr_shutdown(void) 163 163 { 164 164 #ifdef HAVE_LIBZEPHYR … … 171 171 } 172 172 173 int owl_zephyr_zpending( )173 int owl_zephyr_zpending(void) 174 174 { 175 175 #ifdef HAVE_LIBZEPHYR … … 183 183 } 184 184 185 const char *owl_zephyr_get_realm( )185 const char *owl_zephyr_get_realm(void) 186 186 { 187 187 #ifdef HAVE_LIBZEPHYR … … 192 192 } 193 193 194 const char *owl_zephyr_get_sender( )194 const char *owl_zephyr_get_sender(void) 195 195 { 196 196 #ifdef HAVE_LIBZEPHYR … … 316 316 * Return -2 if there is a failure from zephyr to load the subscriptions. 317 317 */ 318 int owl_zephyr_loadbarnowldefaultsubs( )318 int owl_zephyr_loadbarnowldefaultsubs(void) 319 319 { 320 320 #ifdef HAVE_LIBZEPHYR … … 340 340 } 341 341 342 int owl_zephyr_loaddefaultsubs( )342 int owl_zephyr_loaddefaultsubs(void) 343 343 { 344 344 #ifdef HAVE_LIBZEPHYR … … 415 415 } 416 416 417 void unsuball( )417 void unsuball(void) 418 418 { 419 419 #if HAVE_LIBZEPHYR … … 993 993 #ifdef HAVE_LIBZEPHYR 994 994 char *line, *subsfile; 995 int linesdeleted; 995 996 996 997 line=owl_zephyr_makesubline(class, inst, recip); … … 1003 1004 } 1004 1005 1005 owl_util_file_deleteline(subsfile, line, 1); 1006 linesdeleted = owl_util_file_deleteline(subsfile, line, 1); 1007 if (linesdeleted > 0) { 1008 owl_function_makemsg("Subscription removed"); 1009 } else { 1010 owl_function_error("No subscription present in %s", subsfile); 1011 } 1006 1012 owl_free(subsfile); 1007 1013 owl_free(line); 1008 owl_function_makemsg("Subscription removed");1009 1014 #endif 1010 1015 } … … 1119 1124 * free the return. 1120 1125 */ 1121 char *owl_zephyr_getsubs( )1126 char *owl_zephyr_getsubs(void) 1122 1127 { 1123 1128 #ifdef HAVE_LIBZEPHYR -
zwrite.c
r24ccc01 rde3f641 154 154 void owl_zwrite_populate_zsig(owl_zwrite *z) 155 155 { 156 const char *zsigproc, *zsigowlvar, *zsigzvar;157 char *ptr;158 struct passwd *pw;159 160 156 /* get a zsig, if not given */ 161 if (z->zsig==NULL) { 162 zsigproc = owl_global_get_zsigproc(&g); 163 zsigowlvar = owl_global_get_zsig(&g); 164 zsigzvar = owl_zephyr_get_variable("zwrite-signature"); 165 166 if (zsigowlvar && *zsigowlvar) { 167 z->zsig=owl_validate_utf8(zsigowlvar); 168 } else if (zsigproc && *zsigproc) { 169 FILE *file; 170 char buff[LINE], *openline; 171 172 /* simple hack for now to nuke stderr */ 173 #if OWL_STDERR_REDIR 174 openline = owl_strdup(zsigproc); 175 #else 176 openline = owl_sprintf("%s 2> /dev/null", zsigproc); 177 #endif 178 file=popen(openline, "r"); 179 owl_free(openline); 180 if (!file) { 181 if (zsigzvar && *zsigzvar) { 182 z->zsig=owl_validate_utf8(zsigzvar); 183 } 184 } else { 185 z->zsig=owl_malloc(LINE*5); 186 strcpy(z->zsig, ""); 187 while (fgets(buff, LINE, file)) { /* wrong sizing */ 188 strcat(z->zsig, buff); 189 } 190 pclose(file); 191 if (z->zsig[0] != '\0' && z->zsig[strlen(z->zsig) - 1] == '\n') { 192 z->zsig[strlen(z->zsig)-1]='\0'; 193 } 194 } 195 } else if (zsigzvar) { 196 z->zsig=owl_validate_utf8(zsigzvar); 197 } else if (((pw=getpwuid(getuid()))!=NULL) && (pw->pw_gecos)) { 198 z->zsig=owl_validate_utf8(pw->pw_gecos); 199 ptr=strchr(z->zsig, ','); 200 if (ptr) { 201 ptr[0]='\0'; 202 } 203 } 204 } 157 if (z->zsig != NULL) 158 return; 159 160 z->zsig = owl_perlconfig_execute(owl_global_get_zsigfunc(&g)); 205 161 } 206 162
Note: See TracChangeset
for help on using the changeset viewer.