- fixes for building without OpenSSL
authorNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 11 Mar 2002 03:55:25 +0000 (03:55 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 11 Mar 2002 03:55:25 +0000 (03:55 +0000)
 - setenv doesn't exist on all systems, use putenv instead
 - support Solaris' curses implementation

citadel/ChangeLog
citadel/acconfig.h
citadel/citadel.c
citadel/commands.c
citadel/configure.ac
citadel/messages.c
citadel/rooms.c
citadel/routines2.c
citadel/screen.c

index 7572043d4c618c411f34745cb116f79e3b1ec33c..bb92fdac65b814677a725feb1b80bd61930a57ed 100644 (file)
@@ -1,4 +1,9 @@
  $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().
@@ -3415,4 +3420,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index a3d6e0d856153a1916ca10c4d97805dfe8159ff4..958d43d11f0d6f23d526cf4888e51941025cb7e1 100644 (file)
@@ -24,6 +24,3 @@
 
 /* Define if you have OpenSSL. */
 #undef HAVE_OPENSSL
-
-/* Define if curses implementation has vw_printw */
-#undef VW_PRINTW_IN_CURSES
index 5d0d90b693dae7abac9bbf7d655383668100bf53..fc93f3e0729ec7220713906479bd92fd754c76d8 100644 (file)
@@ -952,7 +952,9 @@ int main(int argc, char **argv)
        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
@@ -967,12 +969,19 @@ int main(int argc, char **argv)
                        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
index 089f7b176bc002b3fffef4121d94aa192bbc50ba..5b8a097651ddf0a0ede7f8ea6927397b8f602d17 100644 (file)
@@ -698,7 +698,9 @@ void load_command_set(void)
        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
@@ -730,12 +732,22 @@ void load_command_set(void)
                        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
index e633c23a9eb13d160e9b4b06fffe2626e8c548a0..720ffd4875034550a55addd4ee82d6103538ce15 100644 (file)
@@ -222,10 +222,9 @@ save_LIBS=$LIBS
 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.)
index 8f64a1e9f0aa3bd3a001f7999ff7fb2a5430c95a..39c286d8661c3aee0bde5572c19ff226d4c686b4 100644 (file)
@@ -775,10 +775,13 @@ ME1:      switch (mode) {
                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);
                }
index 66395de4cdc93853c1103ad1521acce2d1c1a1f2..21aa5e41a91aff98ea2b5220cdeacb8ef457969d 100644 (file)
@@ -1057,7 +1057,10 @@ void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
        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);
index bb53c4c68aa28875a375a606b9216b4745f696dd..c6ab3ae2703b5140f52fa48151dd72634c88d894 100644 (file)
@@ -1018,7 +1018,7 @@ void network_config_management(char *entrytype, char *comment) {
                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);
        }
index 0de6d1fb704bbcebf4bb42049b3ad1d6b87fe1bd..7e1d1e770da10317306082e931515f596c134f71 100644 (file)
@@ -13,7 +13,7 @@
 #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? */
@@ -336,7 +336,9 @@ int scr_color(int colornum)
 {
 #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 {