$Log$
+ Revision 590.135 2002/03/11 03:55:24 nbryant
+ - fixes for building without OpenSSL
+ - setenv doesn't exist on all systems, use putenv instead
+ - support Solaris' curses implementation
+
Revision 590.134 2002/03/09 22:52:04 ajc
* Applied a patch submitted by <xperc@hotmail.com> to fix a potential buffer
overflow problem in lprintf(). I also did the same fix to cprintf().
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
/* Define if you have OpenSSL. */
#undef HAVE_OPENSSL
-
-/* Define if curses implementation has vw_printw */
-#undef VW_PRINTW_IN_CURSES
signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_DEFAULT;
+#endif
#ifdef HAVE_CURSES_H
arg_screen = RC_DEFAULT;
#endif
argc = shift(argc, argv, a, 2);
}
if (!strcmp(argv[a], "-x")) {
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_NO;
+#endif
argc = shift(argc, argv, a, 1);
}
if (!strcmp(argv[a], "-X")) {
+#ifdef HAVE_OPENSSL
arg_encrypt = RC_YES;
- argc = shift(argc, argv, a, 1);
+ argc = shift(argc, argv, a, 1);
+#else
+ fprintf(stderr, "Not compiled with encryption support");
+ return 1;
+#endif
}
if (!strcmp(argv[a], "-s")) {
#ifdef HAVE_CURSES_H
rc_force_mail_prompts = 0;
rc_ansi_color = 0;
strcpy(rc_url_cmd, "");
+#ifdef HAVE_OPENSSL
rc_encrypt = RC_DEFAULT;
+#endif
#ifdef HAVE_CURSES_H
rc_screen = RC_DEFAULT;
#endif
buf[strlen(buf) - 1] = 0;
if (!strncasecmp(buf, "encrypt=", 8)) {
- if (!strcasecmp(&buf[8], "yes"))
+ if (!strcasecmp(&buf[8], "yes")) {
+#ifdef HAVE_OPENSSL
rc_encrypt = RC_YES;
- else if (!strcasecmp(&buf[8], "no"))
+#else
+ fprintf(stderr, "citadel.rc requires encryption support but citadel is not compiled with OpenSSL");
+ logoff(1);
+#endif
+ }
+#ifdef HAVE_OPENSSL
+ else if (!strcasecmp(&buf[8], "no")) {
rc_encrypt = RC_NO;
- else if (!strcasecmp(&buf[8], "default"))
+ }
+ else if (!strcasecmp(&buf[8], "default")) {
rc_encrypt = RC_DEFAULT;
+ }
+#endif
}
#ifdef HAVE_CURSES_H
LIBS=$CURSES
AC_SEARCH_LIBS(tgetent, [curses termcap])
AC_SEARCH_LIBS(initscr, [curses ncurses])
+AC_CHECK_FUNCS(vw_printw wcolor_set)
CURSES=$LIBS
LIBS=$save_LIBS
-SCURS=`echo $CURSES | sed -e s/-l//`
-AC_CHECK_LIB($SCURS, vw_printw, AC_DEFINE(VW_PRINTW_IN_CURSES))
dnl Check for libpthread(s) if we're not using Digital UNIX or FreeBSD. (On
dnl which the -pthread flag takes care of this.)
editor_pid = fork();
cksum = file_checksum(filename);
if (editor_pid == 0) {
+ char tmp[SIZ];
+
chmod(filename, 0600);
screen_reset();
sttybbs(SB_RESTORE);
- setenv("WINDOW_TITLE", header, 1);
+ snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", header);
+ putenv(tmp);
execlp(editor_path, editor_path, filename, NULL);
exit(1);
}
cksum = file_checksum(temp);
if (strlen(editor_path) > 0) {
- setenv("WINDOW_TITLE", desc, 1);
+ char tmp[SIZ];
+
+ snprintf(tmp, sizeof tmp, "WINDOW_TITLE=%s", desc);
+ putenv(tmp);
editor_pid = fork();
if (editor_pid == 0) {
chmod(temp, 0600);
chmod(filename, 0600);
screen_reset();
sttybbs(SB_RESTORE);
- setenv("WINDOW_TITLE", "Network configuration", 1);
+ putenv("WINDOW_TITLE=Network configuration");
execlp(editor_path, editor_path, filename, NULL);
exit(1);
}
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
-#ifdef VW_PRINTW_IN_CURSES
+#ifdef HAVE_VW_PRINTW
#define _vwprintw vw_printw
#else
/* Ancient curses implementations, this needs testing. Anybody got XENIX? */
{
#ifdef HAVE_CURSES_H
if (mainwindow) {
+#ifdef HAVE_WCOLOR_SET
wcolor_set(mainwindow, 1 + (colornum & 7), NULL);
+#endif
if (colornum & 8) {
wattron(mainwindow, A_BOLD);
} else {