]> code.citadel.org Git - citadel.git/commitdiff
* migratenet.c: removed. Adjusted Makefile.in accordingly.
authorArt Cancro <ajc@citadel.org>
Mon, 28 Jul 2003 04:17:24 +0000 (04:17 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 28 Jul 2003 04:17:24 +0000 (04:17 +0000)
citadel/ChangeLog
citadel/Makefile.in
citadel/migratenet.c [deleted file]

index d69f52bd5b562fd7ce3390ee6a7cb0315705dd36..4d61e8183be24dfab8ed30193370bbee7fd5c346 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 608.11  2003/07/28 04:17:24  ajc
+ * migratenet.c: removed.  Adjusted Makefile.in accordingly.
+
  Revision 608.10  2003/07/27 21:15:23  ajc
  * Implemented all IMAP date-based search criteria.  Note that Citadel does
    not record an "internal date" of a message, so the "sent date" and "internal
@@ -4911,4 +4914,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 9fc07608fc99e9ecf4d6818a77830d88d1c3165b..008d3c9432c61b3ed72a346b35e649a397d51c99 100644 (file)
@@ -46,7 +46,7 @@ SERV_MODULES=serv_chat.o \
 
 UTIL_TARGETS=aidepost msgform \
        citmail userlist sendcommand \
-       base64 migratenet$(EXEEXT)
+       base64
 
 prefix=@prefix@
 srcdir=@srcdir@
@@ -82,7 +82,7 @@ SOURCES=aidepost.c auth.c base64.c chkpwd.c citadel.c citadel_ipc.c \
        domain.c serv_extensions.c file_ops.c genstamp.c getutline.c \
        housekeeping.c html.c imap_fetch.c imap_misc.c imap_search.c \
        imap_store.c imap_tools.c internet_addressing.c ipc_c_tcp.c \
-       locate_host.c md5.c messages.c migratenet.c \
+       locate_host.c md5.c messages.c  \
        mime_parser.c msgbase.c msgform.c parsedate.c policy.c \
        room_ops.c rooms.c routines.c routines2.c \
        screen.c sendcommand.c serv_bio.c serv_calendar.c serv_chat.c \
@@ -151,9 +151,6 @@ chkpwd: chkpwd.o auth.o config.o
 whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
        $(CC) whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o  $(LIBOBJS) $(LDFLAGS) -o whobbs $(LIBS)
 
-migratenet$(EXEEXT): migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o $(LIBOBJS)
-       $(CC) migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o $(LIBOBJS) $(LDFLAGS) -o migratenet $(LIBS)
-
 sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o $(LIBOBJS)
        $(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o \
         $(LIBOBJS) $(LDFLAGS) -o sendcommand $(LIBS)
diff --git a/citadel/migratenet.c b/citadel/migratenet.c
deleted file mode 100644 (file)
index 9dc0ba7..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * $Id$
- * 
- * 5.80 to 5.90 migration utility for network files
- *
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <errno.h>
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#include "citadel.h"
-#include "citadel_ipc.h"
-#include "tools.h"
-#include "config.h"
-
-struct mn_roomlist {
-       struct mn_roomlist *next;
-       char roomname[SIZ];
-};
-
-void logoff(int code)
-{
-       exit(code);
-}
-
-int main(int argc, char **argv)
-{
-       char buf[SIZ];
-       char hostbuf[SIZ];
-       char portbuf[SIZ];
-       DIR *dp;
-       struct dirent *d;
-       long highest = 0L;
-       char node[SIZ];
-       char room[SIZ];
-       long thighest;
-       FILE *fp;
-       FILE *roomfp;
-       char roomfilename[SIZ];
-       FILE *nodefp;
-       char nodefilename[SIZ];
-       char *listing = NULL;
-       struct mn_roomlist *mn = NULL;
-       struct mn_roomlist *mnptr = NULL;
-       CtdlIPC *ipc = NULL;
-       int r;
-
-       printf("\n\n\n\n\n"
-"This utility migrates your network settings (room sharing with other\n"
-"Citadel systems) from 5.80 to 5.90.  You should only do this ONCE.  It\n"
-"will ERASE your 5.80 configuration files when it is finished, and it will\n"
-"ERASE any 5.90 configuration files that you have already set up.\n\n"
-"Are you sure you want to do this? ");
-
-       fgets(buf, sizeof buf, stdin);
-       if (tolower(buf[0]) != 'y') exit(0);
-
-       get_config();
-
-       ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
-       CtdlIPC_getline(ipc, buf);
-       printf("%s\n", &buf[4]);
-       if ( (buf[0]!='2') && (strncmp(buf,"551",3)) ) {
-               fprintf(stderr, "%s: %s\n", argv[0], &buf[4]);
-               logoff(atoi(buf));
-       }
-
-       r = CtdlIPCInternalProgram(ipc, config.c_ipgm_secret, buf);
-       fprintf(stderr, "%s\n", buf);
-       if (r / 100 != 2) {
-               exit(2);
-       }
-
-       if (chdir("network/systems") != 0) {
-               perror("cannot chdir network/systems");
-               exit(errno);
-       }
-
-       strcpy(roomfilename, tmpnam(NULL));
-       roomfp = fopen(roomfilename, "w");
-       if (roomfp == NULL) {
-               perror("cannot open temp file");
-               exit(errno);
-       }
-
-       strcpy(nodefilename, tmpnam(NULL));
-       nodefp = fopen(nodefilename, "w");
-       if (roomfp == NULL) {
-               perror("cannot open temp file");
-               exit(errno);
-       }
-
-       dp = opendir(".");
-       if (dp == NULL) {
-               perror("cannot open directory");
-               exit(errno);
-       }
-
-       while (d = readdir(dp), d != NULL) {
-               fp = NULL;
-               if ( (d->d_name[0] != '.') && strcasecmp(d->d_name, "CVS")) {
-                       fp = fopen(d->d_name, "r");
-               }
-               if (fp != NULL) {
-                       printf("\n*** Processing '%s'\n", d->d_name);
-
-                       fprintf(nodefp, "%s|", d->d_name);
-                       printf("Enter shared secret: ");
-                       myfgets(buf, sizeof buf, stdin);
-                       if (buf[0] == 0) strcpy(buf, config.c_net_password);
-                       fprintf(nodefp, "%s|", buf);
-                       printf("Enter host name/IP : ");
-                       myfgets(buf, sizeof buf, stdin);
-                       if (buf[0] == 0) snprintf(buf, sizeof buf, "%s.citadel.org",
-                               d->d_name);
-                       fprintf(nodefp, "%s|", buf);
-                       printf("Enter port number  : ");
-                       fgets(buf, sizeof buf, stdin);
-                       if (buf[0] == 0) strcpy(buf, "504");
-                       fprintf(nodefp, "%s\n", buf);
-
-                       fgets(buf, sizeof buf, fp);
-                       printf("skipping: %s", buf);
-                       while (fgets(room, sizeof room, fp),
-                             (fgets(buf, sizeof buf, fp) != NULL) ) {
-                               thighest = atol(buf),
-                               room[strlen(room) - 1] = 0;
-                               fprintf(roomfp, "%s|%s\n",
-                                       d->d_name, room);
-                               if (thighest > highest) {
-                                       highest = thighest;
-                               }
-                       }
-                       fclose(fp);
-               }
-       }
-
-       closedir(dp);
-       fclose(roomfp);
-       fclose(nodefp);
-
-       /* Point of no return */
-       nodefp = fopen(nodefilename, "r");
-       if (nodefp != NULL) {
-               fseek(nodefp, 0L, SEEK_END);
-               listing = malloc(ftell(nodefp) + 1);
-               *listing = 0;
-               while (fgets(buf, sizeof buf, nodefp) != NULL) {
-                       strcat(listing, buf);
-               }
-               fclose(nodefp);
-       }
-
-       /* Set up the node table */
-       printf("Creating neighbor node table\n");
-       r = CtdlIPCSetSystemConfigByType(ipc, IGNETCFG, listing, buf);
-       free(listing);
-       listing = NULL;
-       if (r / 100 != 4) {
-               printf("%s\n", buf);
-       }
-
-       /* Now go through the table looking for node names to enter */
-       snprintf(buf, sizeof buf, "cat %s |awk -F \"|\" '{ print $2 }' |sort -f |uniq -i",
-               roomfilename);
-       roomfp = popen(buf, "r");
-       if (roomfp == NULL) {
-               perror("cannot open pipe");
-               unlink(roomfilename);
-       }
-
-       while (fgets(room, sizeof room, roomfp) != NULL) {
-               room[strlen(room)-1] = 0;
-               if (strlen(room) > 0) {
-                       mnptr = (struct mn_roomlist *)
-                               malloc(sizeof (struct mn_roomlist));
-                       strcpy(mnptr->roomname, room);
-                       mnptr->next = mn;
-                       mn = mnptr;
-               }
-       }
-
-       pclose(roomfp);
-
-       /* Enter configurations for each room... */
-       while (mn != NULL) {
-               struct ctdlipcroom *current_room = NULL;
-       
-               printf("Room <%s>\n", mn->roomname);
-
-               r = CtdlIPCGotoRoom(ipc, mn->roomname, NULL,
-                               &current_room, buf);
-               printf("%s\n", buf);
-               if (r / 100 != 2) goto roomerror;
-
-               /* Hey IG, what the hell is SNET? */
-               CtdlIPC_putline(ipc, "SNET");
-               CtdlIPC_getline(ipc, buf);
-               if (buf[0] != '4') goto roomerror;
-
-               snprintf(buf, sizeof buf, "lastsent|%ld", highest);
-               CtdlIPC_putline(ipc, buf);
-
-               roomfp = fopen(roomfilename, "r");
-               if (roomfp != NULL) {
-                       while (fgets(buf, sizeof buf, roomfp) != NULL) {
-                               buf[strlen(buf)-1] = 0;
-                               extract(node, buf, 0);
-                               extract(room, buf, 1);
-                               if (!strcasecmp(room, mn->roomname)) {
-                                       snprintf(buf, sizeof buf,
-                                               "ignet_push_share|%s", node);
-                                       CtdlIPC_putline(ipc, buf);
-                               }
-                       }
-                       fclose(roomfp);
-               }
-
-               CtdlIPC_putline(ipc, "000");
-
-roomerror:     /* free this record */
-               mnptr = mn->next;
-               free(mn);
-               mn = mnptr;
-       }
-
-       unlink(roomfilename);
-       unlink(nodefilename);
-
-       printf("\n\n"
-               "If this conversion was successful, you do not need your\n"
-               "old network configuration files.  Delete them now? "
-       );
-
-       fgets(buf, sizeof buf, stdin);
-       if (tolower(buf[0]) != 'y') exit(0);
-
-       get_config();
-       system("rm -fr ./network/systems");
-       system("rm -f ./network/mail.sysinfo");
-       system("rm -f ./network/internetmail.config");
-
-       exit(0);
-}