Merge branch 'master' of git+ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Fri, 20 Jan 2012 20:23:40 +0000 (21:23 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Fri, 20 Jan 2012 20:23:40 +0000 (21:23 +0100)
citadel/Makefile.in
citadel/citadel.h
citadel/configure.ac
citadel/utils/sendcommand.c
citadel/utils/setup.c
citadel/utils/userlist.c [deleted file]
citadel/utils/whobbs.c [deleted file]
libcitadel/configure.in
libcitadel/lib/libcitadel.h
webcit/configure.ac
webcit/webcit.h

index a1abae852bd017e9b2a515ce6d6290abd9bc5eb2..3e377d4f207b78adfafc4a451dd1ea8743992115 100644 (file)
@@ -30,7 +30,7 @@ all: buildinfo $(TARGETS)
 
 EXEEXT=@EXEEXT@
 
-CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT) 
+CLIENT_TARGETS=citadel$(EXEEXT)
 NOINST_TARGETS=stress$(EXEEXT)
 SERVER_TARGETS=citserver$(EXEEXT)
 SERV_MODULES= md5.o \
@@ -41,7 +41,7 @@ include Make_modules
 UTIL_TARGETS=citmail$(EXEEXT) sendcommand$(EXEEXT)
 
 UTILBIN_TARGETS= base64$(EXEEXT) setup$(EXEEXT) \
-       chkpw$(EXEEXT) chkpwd$(EXEEXT) userlist$(EXEEXT) \
+       chkpw$(EXEEXT) chkpwd$(EXEEXT) \
        aidepost$(EXEEXT) msgform$(EXEEXT) \
        ctdlmigrate$(EXEEXT)
 
@@ -74,9 +74,9 @@ LOCALEDIR=@LOCALEDIR@
 .SILENT:
 
 
-SOURCES=utils/aidepost.c utils/stress.c utils/whobbs.c utils/citmail.c \
+SOURCES=utils/aidepost.c utils/stress.c utils/citmail.c \
        utils/setup.c utils/msgform.c utils/chkpw.c \
-       utils/sendcommand.c utils/userlist.c \
+       utils/sendcommand.c \
        utils/ctdlmigrate.c utils/base64.c utils/chkpwd.c \
        utillib/citadel_ipc.c utillib/citadel_dirs.c utillib/ipc_c_tcp.c \
        textclient/client_chat.c textclient/client_passwords.c \
@@ -192,31 +192,19 @@ chkpw$(EXEEXT): utils/chkpw.o auth.o utillib/citadel_dirs.o
        $(CC) utils/chkpw.o auth.o utillib/citadel_dirs.o \
                $(LDFLAGS) -o chkpw$(EXEEXT) $(chkpwd_LIBS)
 
-whobbs$(EXEEXT): utils/whobbs.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
-               utillib/citadel_dirs.o $(LIBOBJS)
-       $(CC) utils/whobbs.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
-               utillib/citadel_dirs.o $(LIBOBJS) \
-               $(LDFLAGS) -o whobbs$(EXEEXT) $(LIBS)
-
 stress$(EXEEXT): utils/stress.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
                utillib/citadel_dirs.o $(LIBOBJS)
        $(CC) utils/stress.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
                utillib/citadel_dirs.o $(LIBOBJS) \
                $(LDFLAGS) -o stress$(EXEEXT) $(LIBS)
 
-sendcommand$(EXEEXT): utils/sendcommand.o $(LIBOBJS)
-       $(CC) utils/sendcommand.o \
+sendcommand$(EXEEXT): utils/sendcommand.o utillib/citadel_dirs.o $(LIBOBJS)
+       $(CC) utils/sendcommand.o utillib/citadel_dirs.o \
                $(LIBOBJS) $(LDFLAGS) -o sendcommand$(EXEEXT) $(LIBS)
 
 base64$(EXEEXT): utils/base64.o
        $(CC) utils/base64.o $(LDFLAGS) -o base64$(EXEEXT)
 
-userlist$(EXEEXT): utils/userlist.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
-               utillib/citadel_dirs.o $(LIBOBJS)
-       $(CC) utils/userlist.o utillib/ipc_c_tcp.o utillib/citadel_ipc.o \
-               utillib/citadel_dirs.o \
-               $(LIBOBJS) $(LDFLAGS) -o userlist$(EXEEXT) $(LIBS)
-
 msgform$(EXEEXT): utils/msgform.o
        $(CC) utils/msgform.o $(LDFLAGS) -o msgform$(EXEEXT)
 
index dbef91b2909ef40a171c710aad25d94746274d21..8c58ff58dad1cdfc9b55ea5ecec9c4055996bffe 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * Main Citadel header file
  *
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2012 by the citadel.org team
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /* system customizations are in sysconfig.h */
@@ -51,10 +45,10 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      803             /* This version */
+#define REV_LEVEL      810             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
 #define EXPORT_REV_MIN 760             /* Oldest compatible export files */
-#define LIBCITADEL_MIN 802             /* Minimum required version of libcitadel */
+#define LIBCITADEL_MIN 810             /* Minimum required version of libcitadel */
 
 #define SERVER_TYPE 0                  /* zero for stock Citadel; other developers please
                                           obtain SERVER_TYPE codes for your implementations */
@@ -83,11 +77,6 @@ extern "C" {
  */
 typedef struct ExpirePolicy ExpirePolicy;
 struct ExpirePolicy {
-/*
-#include "datadefinitions.h"
-#include "dtds/expirepolicy-defs.h"
-#include "undef_data.h"
-*/
        int expire_mode;
        int expire_value;
 };
@@ -105,11 +94,6 @@ struct ExpirePolicy {
  */
 typedef struct march march;
 struct march {
-/*
-#include "datadefinitions.h"
-#include "dtds/march-defs.h"
-#include "undef_data.h"
-*/
        struct march *next;
        char march_name[ROOMNAMELEN];
        unsigned int march_flags;
@@ -135,11 +119,6 @@ struct march {
  */
 typedef struct ctdluser ctdluser;
 struct ctdluser {                      /* User record                      */
-/*
-#include "datadefinitions.h"
-#include "dtds/user-defs.h"
-#include "undef_data.h"
-*/
        int version;                    /* Cit vers. which created this rec  */
        uid_t uid;                      /* Associate with a unix account?    */
        char password[32];              /* password                          */
@@ -165,11 +144,6 @@ struct ctdluser {                  /* User record                      */
  */
 typedef struct ctdlroom ctdlroom;
 struct ctdlroom {
-/*
-#include "datadefinitions.h"
-#include "dtds/room-defs.h"
-#include "undef_data.h"
-*/
        char QRname[ROOMNAMELEN];       /* Name of room                     */
        char QRpasswd[10];              /* Only valid if it's a private rm  */
        long QRroomaide;                /* User number of room aide         */
@@ -212,11 +186,6 @@ struct ctdlroom {
  */
 typedef struct floor floor;
 struct floor {
-/*
-#include "datadefinitions.h"
-#include "dtds/floor-defs.h"
-#include "undef_data.h"
-*/
        unsigned short f_flags;         /* flags */
        char f_name[256];               /* name of floor */
        int f_ref_count;                /* reference count */
@@ -246,11 +215,6 @@ struct floor {
 #define        NEXT_KEY        15
 #define STOP_KEY       3
 
-/* server exit codes */
-#define EXIT_NORMAL    0               /* server terminated normally */
-                                       /* 1 through 63 reserved for signals */
-#define EXIT_NULL      64              /* EOF on server command input */
-
 /* citadel.rc stuff */
 #define RC_NO          0               /* always no */
 #define RC_YES         1               /* always yes */
index a4140b822558275a7f1e07891ad9f689a60771ac..eb09f1aa9bc89d460c87d20cb18abfc0aec8d911 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [8.03], [http://www.citadel.org/])
+AC_INIT([Citadel], [8.10], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_CONFIG_HEADER(sysdep.h)
index e9e5fbcd639a56dbece398927634d6418f4f0514..bef37c7be7dccc6e51b422e9828e808c11d3fdac 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include "citadel.h"
+#include "include/citadel_dirs.h"
 
 
 
@@ -141,15 +142,24 @@ int main(int argc, char **argv)
 {
        int a;
        int watchdog = 60;
-       char *ctdl_home_directory = CTDLDIR;
        char buf[SIZ];
        int xfermode = 0;
+       int relh=0;
+       int home=0;
+       char relhome[PATH_MAX]="";
+       char ctdldir[PATH_MAX]=CTDLDIR;
 
        /* Parse command line */
        while ((a = getopt(argc, argv, "h:w:")) != EOF) {
                switch (a) {
                case 'h':
-                       ctdl_home_directory = strdup(optarg);
+                       relh=optarg[0]!='/';
+                       if (!relh) {
+                               strncpy(ctdl_home_directory, optarg, sizeof ctdl_home_directory);
+                       } else {
+                               strncpy(relhome, optarg, sizeof relhome);
+                       }
+                       home = 1;
                        break;
                case 'w':
                        watchdog = atoi(optarg);
@@ -159,15 +169,16 @@ int main(int argc, char **argv)
                }
        }
 
-       fprintf(stderr, "sendcommand: started (pid=%d) connecting to Citadel server in %s\n",
+       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
+
+       fprintf(stderr, "sendcommand: started (pid=%d) connecting to Citadel server at %s\n",
                (int) getpid(),
-               ctdl_home_directory
+               file_citadel_admin_socket
        );
        fflush(stderr);
 
        alarm(watchdog);
-       snprintf(buf, sizeof buf, "%s/citadel-admin.socket", ctdl_home_directory);
-       serv_sock = uds_connectsock(buf);
+       serv_sock = uds_connectsock(file_citadel_admin_socket);
 
        serv_gets(buf);
        fprintf(stderr, "%s\n", buf);
index 311f1b28f52fff4b592c96414f0f91a5b018fc61..326564bcd3e5d516f93fc23ab7ee03b77ea7ea10 100644 (file)
@@ -1,5 +1,15 @@
 /*
  * Citadel setup utility
+ *
+ * Copyright (c) 1987-2012 by the citadel.org team
+ *
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  */
 
 #define SHOW_ME_VAPPEND_PRINTF
@@ -95,10 +105,6 @@ char admin_cmd[SIZ];
 const char *setup_titles[eMaxQuestions];
 const char *setup_text[eMaxQuestions];
 
-/* calculate all our path on a central place */
-/* where to keep our config */
-       
-
 
 void SetTitles(void)
 {
@@ -151,7 +157,7 @@ void SetTitles(void)
        setup_text[eUID] = _(
 "Citadel needs to run under its own user ID.  This would\n"
 "typically be called \"citadel\", but if you are running Citadel\n"
-"as a public BBS, you might also call it \"bbs\" or \"guest\".\n"
+"as a public site, you might also call it \"bbs\" or \"guest\".\n"
 "The server will run under this user ID.  Please specify that\n"
 "user ID here.  You may specify either a user name or a numeric\n"
 "UID.\n");
@@ -239,7 +245,7 @@ void SetTitles(void)
 }
 
 /*
- * print the actual stack frame.
+ * Print the stack frame for a backtrace
  */
 void cit_backtrace(void)
 {
@@ -261,7 +267,6 @@ void cit_backtrace(void)
 }
 
 struct config config;
-
 int direction;
 
 
@@ -372,9 +377,7 @@ void display_error(char *error_message_format, ...)
 
        Msg = NewStrBuf();
        va_start(arg_ptr, error_message_format);
-       StrBufVAppendPrintf(Msg, 
-                           error_message_format, 
-                           arg_ptr);
+       StrBufVAppendPrintf(Msg, error_message_format, arg_ptr);
        va_end(arg_ptr);
 
        important_message(_("Error"), ChrPtr(Msg));
@@ -489,11 +492,7 @@ void delete_inittab_entry(void)
        int rv;
 
        /* Determine the fully qualified path name of citserver */
-       snprintf(looking_for, 
-                sizeof looking_for,
-                "%s/citserver", 
-                ctdl_sbin_dir
-               );
+       snprintf(looking_for, sizeof looking_for, "%s/citserver", ctdl_sbin_dir);
 
        /* Now tweak /etc/inittab */
        infp = fopen("/etc/inittab", "r");
@@ -536,9 +535,7 @@ void delete_inittab_entry(void)
                rv = fwrite(buf, strlen(buf), 1, outfp);
                if (rv == -1)
                {
-                       display_error("%s %s\n",
-                                     _("failed to modify inittab"), 
-                                     strerror(errno));
+                       display_error("%s %s\n", _("failed to modify inittab"), strerror(errno));
                }
        }
 
@@ -567,14 +564,17 @@ void install_init_scripts(void)
        char command[SIZ];
        int rv;
 
-       if ((stat("/etc/init.d/", &etcinitd) == -1) && 
-           (errno == ENOENT))
-       {
-               if ((stat("/etc/rc.d/init.d/", &etcinitd) == -1) &&
-                   (errno == ENOENT))
+       if (    (stat("/etc/init.d/", &etcinitd) == -1)
+               && (errno == ENOENT)
+       ) {
+               if (    (stat("/etc/rc.d/init.d/", &etcinitd) == -1)
+                       && (errno == ENOENT)
+               ) {
                        initfile = CTDLDIR"/citadel.init";
-               else
+               }
+               else {
                        initfile = "/etc/rc.d/init.d/citadel";
+               }
        }
 
        fp = fopen(initfile, "r");
@@ -655,18 +655,21 @@ void install_init_scripts(void)
 
        /* Set up the run levels. */
        rv = system("/bin/rm -f /etc/rc?.d/[SK]??citadel 2>/dev/null");
-       if (rv != 0)
-               display_error(_("failed to remove system V init links \n"));
+       if (rv != 0) {
+               display_error(_("failed to remove system V init links\n"));
+       }
 
        snprintf(command, sizeof(command), "for x in 2 3 4 5 ; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/S79citadel ; done 2>/dev/null", initfile);
        rv = system(command);
-       if (rv != 0)
-               display_error(_("failed to set system V init links \n"));
+       if (rv != 0) {
+               display_error(_("failed to set system V init links\n"));
+       }
 
        snprintf(command, sizeof(command),"for x in 0 6 S; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/K30citadel ; done 2>/dev/null", initfile);
        rv = system(command);
-       if (rv != 0)
-               display_error(_("failed to set system V init links \n"));
+       if (rv != 0) {
+               display_error(_("failed to set system V init links\n"));
+       }
 }
 
 
@@ -702,7 +705,8 @@ void check_xinetd_entry(void) {
                         _("Setup can configure the \"xinetd\" service to automatically\n"
                           "connect incoming telnet sessions to Citadel, bypassing the\n"
                           "host system login: prompt.  Would you like to do this?\n"
-                                ));
+                        )
+               );
                if (yesno(buf, 1) == 0) {
                        return;
                }
@@ -844,17 +848,21 @@ int test_server(char *relhomestr, int relhome) {
         * to the server and try to get it back.  The cookie does not
         * have to be secret ... just unique.
         */
-       sprintf(cookie, "--test--%d--", getpid());
+       generate_uuid(cookie);
 
-       if (relhome)
+       if (relhome) {
                sprintf(cmd, "%s/sendcommand -h%s ECHO %s 2>&1",
                        ctdl_sbin_dir,
                        relhomestr,
-                       cookie);
-       else
+                       cookie
+               );
+       }
+       else {
                sprintf(cmd, "%s/sendcommand ECHO %s 2>&1",
                        ctdl_sbin_dir,
-                       cookie);
+                       cookie
+               );
+       }
 
        fp = popen(cmd, "r");
        if (fp == NULL) return(errno);
@@ -904,8 +912,9 @@ void strprompt(const char *prompt_title, const char *prompt_text, char *Target,
                        Target,
                        dialog_result);
                rv = system(buf);
-               if (rv != 0)
-                       fprintf(stderr, "failed to run Dialog.\n");
+               if (rv != 0) {
+                       fprintf(stderr, "failed to run whiptail or dialog\n");
+               }
                
                fp = fopen(dialog_result, "r");
                if (fp != NULL) {
@@ -936,7 +945,8 @@ void set_str_val(int msgpos, char *Target, char *DefValue)
        strprompt(setup_titles[msgpos], 
                  setup_text[msgpos], 
                  Target, 
-                 DefValue);
+                 DefValue
+       );
 }
 
 void set_int_val(int msgpos, int *ip, char *DefValue)
@@ -977,9 +987,9 @@ void edit_value(int curr)
        {
                Value = getenv(EnvNames[curr]);
        }
-       if (Value == NULL)
+       if (Value == NULL) {
                Value = "";
-
+       }
 
        switch (curr) {
 
@@ -1001,7 +1011,7 @@ void edit_value(int curr)
                else
                {
 #ifdef __CYGWIN__
-                       config.c_ctdluid = 0;   /* XXX Windows hack, prob. insecure */
+                       config.c_ctdluid = 0;   /* work-around for Windows */
 #else
                        i = config.c_ctdluid;
                        pw = getpwuid(i);
@@ -1121,7 +1131,7 @@ void write_config_to_disk(void)
 int discover_ui(void)
 {
 
-       /* Use "dialog" if we have it */
+       /* Use "whiptail" or "dialog" if we have it */
        if (getenv("CTDL_DIALOG") != NULL) {
                return UI_DIALOG;
        }
@@ -1131,17 +1141,6 @@ int discover_ui(void)
 
 
 
-void migrate_old_installs(void)
-{
-       int rv;
-       rv = system("exec /bin/rm -fr ./rooms ./chatpipes ./expressmsgs ./sessions 2>/dev/null");
-       if (rv != 0)
-               fprintf(stderr, _("failed to remove old style directories.\n"));
-       unlink("citadel.log");
-       unlink("weekly");
-}
-
-
 /*
  * Strip "db" entries out of /etc/nsswitch.conf
  */
@@ -1565,8 +1564,7 @@ int main(int argc, char *argv[])
 
        }
 
-       get_config ();
-
+       get_config();
        set_default_values();
 
        /* Go through a series of dialogs prompting for config info */
@@ -1611,8 +1609,6 @@ NEW_INST:
 
        write_config_to_disk();
 
-        migrate_old_installs();        /* Delete files and directories used by older Citadel versions */
-
        if (    ((setup_type == UI_SILENT)
                && (getenv("ALTER_ETC_SERVICES")!=NULL))
                || (setup_type != UI_SILENT)
@@ -1637,5 +1633,3 @@ NEW_INST:
        cleanup(0);
        return 0;
 }
-
-
diff --git a/citadel/utils/userlist.c b/citadel/utils/userlist.c
deleted file mode 100644 (file)
index 1bf7597..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Command-line user list utility.
- *
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <libcitadel.h>
-#include "citadel.h"
-#include <unistd.h>
-#include "citadel_ipc.h"
-#include "citadel_dirs.h"
-
-void logoff(int code)
-{
-       exit(code);
-}
-
-void userlist(CtdlIPC *ipc) { 
-       char buf[SIZ];
-       char fl[SIZ];
-       struct tm tmbuf;
-       time_t lc;
-       char *listing = NULL;
-       int r;
-
-       r = CtdlIPCUserListing(ipc, "", &listing, buf);
-       if (r / 100 != 1) {
-               printf("%s\n", buf);
-               return;
-       }
-       printf("       User Name           Num  L Last Visit Logins Messages\n");
-       printf("------------------------- ----- - ---------- ------ --------\n");
-       while (strlen(listing) > 0) {
-               extract_token(buf, listing, 0, '\n', sizeof buf);
-               remove_token(listing, 0, '\n');
-               extract_token(fl, buf, 0, '|', sizeof fl);
-               printf("%-25s ",fl);
-               printf("%5ld %d ", extract_long(buf,2),
-                       extract_int(buf,1));
-               lc = extract_long(buf,3);
-               localtime_r(&lc, &tmbuf);
-               printf("%02d/%02d/%04d ",
-                       (tmbuf.tm_mon+1),
-                       tmbuf.tm_mday,
-                       (tmbuf.tm_year + 1900));
-               printf("%6ld %8ld\n",
-                       extract_long(buf,4),extract_long(buf,5));
-       }
-       printf("\n");
-}
-
-
-int main(int argc, char **argv)
-{
-       char buf[SIZ];
-       char hostbuf[SIZ], portbuf[SIZ];
-       CtdlIPC *ipc = NULL;
-       int relh=0;
-       int home=0;
-       char relhome[PATH_MAX]="";
-       char ctdldir[PATH_MAX]=CTDLDIR;
-
-       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
-
-       ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
-       CtdlIPC_chat_recv(ipc, buf);
-       if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
-               fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
-               logoff(atoi(buf));
-       }
-
-       userlist(ipc);
-
-       CtdlIPCQuit(ipc);
-       exit(0);
-}
-
-
-#ifndef HAVE_STRERROR
-/*
- * replacement strerror() for systems that don't have it
- */
-char *strerror(int e)
-{
-       static char buf[32];
-
-       snprintf(buf, sizeof buf, "errno = %d",e);
-       return(buf);
-}
-#endif
-
-
-/*
- * Stub function
- */
-void stty_ctdl(int cmd) {
-}
-
diff --git a/citadel/utils/whobbs.c b/citadel/utils/whobbs.c
deleted file mode 100644 (file)
index 7d4901a..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Command-line "who is online?" utility
- *
- */
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <libcitadel.h>
-#include "citadel.h"
-#include "citadel_ipc.h"
-#include "citadel_dirs.h"
-
-void logoff(int code)
-{
-       exit(code);
-       }
-
-static void escapize(char *buf, size_t n) {
-       char hold[512];
-       int i, len;
-       size_t tmp;
-
-       strcpy(hold, buf);
-       strcpy(buf, "");
-       tmp = 0;
-       len = strlen(hold);
-       for (i=0; i<len; ++i) {
-               if (hold[i]=='<') {
-                       snprintf(&buf[tmp], n - tmp, "&lt;");
-                       tmp += 4;
-               }
-               else if (hold[i]=='>'){
-                       snprintf(&buf[tmp], n - tmp, "&gt;");
-                       tmp += 4;
-               }
-               else if (hold[i]==34){
-                       snprintf(&buf[tmp], n - tmp, "&quot;");
-                       tmp += 6;
-               }
-               else{
-                       snprintf(&buf[tmp], n - tmp, "%c", hold[i]);
-                       tmp ++;
-               }
-       }
-}
-
-
-
-
-int main(int argc, char **argv)
-{
-       char buf[512];
-       char nodetitle[SIZ];
-       int www = 0;
-       int s_pid = 0;
-       int my_pid = 0;
-       char hostbuf[SIZ];
-       char portbuf[SIZ];
-       char s_user[SIZ];
-       char s_room[SIZ];
-       char s_host[SIZ];
-       char s_client[SIZ];
-       int r;                  /* IPC response code */
-       time_t timenow;
-       char *listing = NULL;
-       CtdlIPC *ipc = NULL;
-       int relh=0;
-       int home=0;
-       char relhome[PATH_MAX]="";
-       char ctdldir[PATH_MAX]=CTDLDIR;
-
-       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
-
-       /* If this environment variable is set, we assume that the program
-        * is being called as a cgi-bin from a webserver and will output
-        * everything as HTML.
-        */     
-       if (getenv("REQUEST_METHOD") != NULL) www = 1;
-
-       ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
-       if (!ipc) {
-               fprintf(stderr, "Server not available: %s\n", strerror(errno));
-               logoff(errno);
-       }
-       CtdlIPC_chat_recv(ipc, buf);
-       if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
-               fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
-               logoff(atoi(buf));
-               }
-       strcpy(nodetitle, "this Citadel site");
-       r = CtdlIPCServerInfo(ipc, buf);
-       if (r / 100 == 1) {
-               my_pid = ipc->ServInfo.pid;
-               strcpy(nodetitle, ipc->ServInfo.humannode);
-       }
-       
-       if (www) {
-               printf( "Content-type: text/html\n"
-                       "\n"
-                       "<HTML><HEAD>"
-                       "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">\n"
-                       "<TITLE>");
-               printf("%s: who is online", nodetitle);
-               printf( "</TITLE></HEAD><BODY><H1>");
-       } else {
-               printf("            ");
-       }
-
-       if (www) {
-               printf("<CENTER><H1>");
-       }
-
-       printf("Users currently logged on to %s\n", nodetitle);
-
-       if (www) {
-               printf("</H1>\n");
-       }
-
-       r = CtdlIPCOnlineUsers(ipc, &listing, &timenow, buf);
-       if (r / 100 != 1) {
-               fprintf(stderr,"%s: %s\n",argv[0], buf);
-               logoff(atoi(buf));
-       }
-
-       if (www) {
-               printf( "<TABLE BORDER=1 WIDTH=100%%>"
-                       "<TR><TH>Session</TH><TH>User name</TH>"
-                       "<TH>Room</TH><TH>From host</TH>"
-                       "<TH>Client software</TH></TR>\n");
-       } else {
-
-               printf( "Session         User name               "
-                       "Room                  From host\n");
-               printf( "------- ------------------------- "
-                       "------------------- ------------------------\n");
-       }
-
-
-       while (!IsEmptyStr(listing)) {
-               extract_token(buf, listing, 0, '\n', sizeof buf);
-               remove_token(listing, 0, '\n');
-
-               /* Escape some stuff if we're using www mode */
-               if (www) escapize(buf, sizeof buf);
-
-               s_pid = extract_int(buf,0);
-               extract_token(s_user, buf, 1, '|', sizeof s_user);
-               extract_token(s_room, buf, 2, '|', sizeof s_room);
-               extract_token(s_host, buf, 3, '|', sizeof s_host);
-               extract_token(s_client, buf, 4, '|', sizeof s_client);
-               if (s_pid != my_pid) {
-
-                       if (www) printf("<TR><TD>");
-                       printf("%-7d", s_pid);
-                       printf("%c", 
-                               ((s_pid == my_pid) ? '*' : ' '));
-                       if (www) printf("</TD><TD>");
-                       printf("%-26s", s_user);
-                       if (www) printf("</TD><TD>");
-                       printf("%-19s ", s_room);
-                       if (www) printf("</TD><TD>");
-                       printf("%-24s\n", s_host);
-                       if (www) printf("</TD><TD>%s</TD></TR>\n", s_client);
-                       }
-               }
-       free(listing);
-
-       if (www) printf("</TABLE></CENTER>\n"
-                       "<FONT SIZE=-1>"
-                       "(This display will automatically refresh "
-                       "once per minute)</FONT>\n"
-                       "</BODY></HTML>\n");
-
-       r = CtdlIPCQuit(ipc);
-       return (r / 100 == 2) ? 0 : r;
-}
-
-
-/*
- * Stub function
- */
-void stty_ctdl(int cmd) {
-}
-
-
-#ifndef HAVE_STRERROR
-/*
- * replacement strerror() for systems that don't have it
- */
-char *strerror(int e)
-{
-       static char buf[32];
-
-       snprintf(buf, sizeof buf, "errno = %d",e);
-       return(buf);
-       }
-#endif
index 71328a0df9027814691e9107c0be81b5fac6f85c..3a6e803b295e51c262cfe356c793c43afa22624a 100755 (executable)
@@ -5,7 +5,7 @@ dnl
 dnl Ensure that libcitadel is configured with autoconf 2.52 or newer
 AC_PREREQ(2.52)
 
-AC_INIT(libcitadel, 8.02, http://uncensored.citadel.org)
+AC_INIT(libcitadel, 8.10, http://uncensored.citadel.org)
 
 AC_CONFIG_SRCDIR(Makefile.in)
 AC_CONFIG_AUX_DIR(conftools)
@@ -23,8 +23,8 @@ dnl If the API changes incompatibly set LIBAGE back to 0
 dnl
 
 LIBCURRENT=2
-LIBREVISION=1
-LIBAGE=0
+LIBREVISION=2
+LIBAGE=1
 
 sinclude(conftools/libtool.m4)
 sinclude(conftools/ac_c_bigendian_cross.m4)
index d0b2690bca9d4ffc750c210c280c0b6c70c76ccf..d28e7662140d0bc2a975eafc5e6e7487a4862ca5 100644 (file)
@@ -1,5 +1,15 @@
 /*
  * Header file for libcitadel
+ *
+ * Copyright (c) 1987-2012 by the citadel.org team
+ *
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  */
 
 
@@ -18,7 +28,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#define LIBCITADEL_VERSION_NUMBER      802
+#define LIBCITADEL_VERSION_NUMBER      810
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
index ba0d46d31d1a404be8e95ab624f9dd70f2677a97..6f3a7bc775ebfd4a6901e17da0984ff2a96a86c4 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_INIT([WebCit], [8.03], [http://www.citadel.org/])
+AC_INIT([WebCit], [8.10], [http://www.citadel.org/])
 
 
 AC_SUBST(PROG_SUBDIRS)
index 5f6cd89b5e7e0cbf8412eca989e56fae5911d8eb..6611a927517cd3a22615c5c3af0af99297d3dce1 100644 (file)
@@ -128,12 +128,12 @@ extern char *ssl_cipher_list;
 #define PORT_NUM               2000            /* port number to listen on */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         802             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    802             /* min required Citadel ver */
-#define        LIBCITADEL_MIN          802             /* min required libcitadel ver */
+#define CLIENT_VERSION         810             /* This version of WebCit */
+#define MINIMUM_CIT_VERSION    810             /* Minimum required version of Citadel server */
+#define        LIBCITADEL_MIN          810             /* Minimum required version of libcitadel */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
-#define TARGET                 "webcit01"      /* Target for inline URL's */
+#define TARGET                 "webcit01"      /* Window target for inline URL's */
 #define HOUSEKEEPING           15              /* Housekeeping frequency */
 #define MAX_WORKER_THREADS     250
 #define LISTEN_QUEUE_LENGTH    100             /* listen() backlog queue */
@@ -265,11 +265,12 @@ extern char *ssl_cipher_list;
 #define EXPIRE_MANUAL           1       /* Don't expire messages at all */
 #define EXPIRE_NUMMSGS          2       /* Keep only latest n messages  */
 #define EXPIRE_AGE              3       /* Expire messages after n days */
+
 typedef struct __ExpirePolicy {
        int loaded; /* has this been loaded from the server? */
         int expire_mode;
         int expire_value;
-}ExpirePolicy;
+} ExpirePolicy;
 void LoadExpirePolicy(GPEXWhichPolicy which);
 void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which);
 
@@ -566,7 +567,7 @@ struct wcsession {
        StrBuf *ConvertBuf1;
        StrBuf *ConvertBuf2;
 
-/* cache stuff for templates. TODO: find a smartrer way */
+/* cache stuff for templates. TODO: find a smarter way */
        HashList *ServCfg;                      /* cache our server config for editing */
        HashList *InetCfg;                      /* Our inet server config for editing */
        ExpirePolicy Policy[maxpolicy];
@@ -738,13 +739,10 @@ void output_html(const char *, int, int, StrBuf *, StrBuf *);
 ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(wc_mime_attachment *Mime);
 
-void generate_uuid(char *);
-
 void address_book_popup(void);
 void begin_ajax_response(void);
 void end_ajax_response(void);
 
-
 extern char *months[];
 extern char *days[];
 long locate_user_vcard_in_this_room(message_summary **VCMsg,
@@ -759,7 +757,6 @@ void tabbed_dialog(int num_tabs, char *tabnames[]);
 void begin_tab(int tabnum, int num_tabs);
 void end_tab(int tabnum, int num_tabs);
 
-
 int get_time_format_cached (void);
 void display_wiki_pagelist(void);
 HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP);