Do not allow "directory" domains to be configured in the text client.
authorArt Cancro <ajc@citadel.org>
Mon, 5 Jun 2017 17:20:12 +0000 (13:20 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 5 Jun 2017 17:20:12 +0000 (13:20 -0400)
libcitadel/lib/libcitadel.h
textclient/src/citadel_ipc.c
textclient/src/tuiconfig.c
webcit/inetconf.c

index a360adf27ca41755531e491eca5a73bb735b87d5..4757d092591f8499f8e615d5eb495c5927f33689 100644 (file)
@@ -697,7 +697,6 @@ extern "C" {
 #define FILTERLIST     "application/x-citadel-filter-list"
 #define SIEVECONFIG    "application/x-citadel-sieve-config"
 #define XMPPMORTUARY   "application/x-citadel-xmpp-mortuary"
-#define INTERNETCFG     "application/x-citadel-internet-config"
 
 #define FILE_MAILALIAS       "__MAIL_ALIAS__"
 
index f1722f71b0bcb245bf110815b608f627e18e26a8..4014418327c53095ade16b96114f5c050f21a971 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 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.
@@ -3322,8 +3322,7 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
                }
        }
 
-       if ((!strcmp(cithost, "localhost"))
-          || (!strcmp(cithost, "127.0.0.1"))) {
+       if ((!strcmp(cithost, "localhost")) || (!strcmp(cithost, "127.0.0.1"))) {
                ipc->isLocal = 1;
        }
 
index e1fccd2a2cab44a9befb762b8114669c0c5f358e..85649c76b733ea1d13b38285ae657232f6abc2b8 100644 (file)
@@ -383,11 +383,10 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) {
        keyopt(" <1> localhost      (Alias for this computer)\n");
        keyopt(" <2> smart host     (Forward all outbound mail to this host)\n");
        keyopt(" <3> fallback host  (Send mail to this host only if direct delivery fails)\n");
-       keyopt(" <4> directory      (Consult the Global Address Book)\n");
-       keyopt(" <5> SpamAssassin   (Address of SpamAssassin server)\n");
-       keyopt(" <6> RBL            (domain suffix of spam hunting RBL)\n");
-       keyopt(" <7> masq domains   (Domains as which users are allowed to masquerade)\n");
-       keyopt(" <8> ClamAV         (Address of ClamAV clamd server)\n");
+       keyopt(" <4> SpamAssassin   (Address of SpamAssassin server)\n");
+       keyopt(" <5> RBL            (domain suffix of spam hunting RBL)\n");
+       keyopt(" <6> masq domains   (Domains as which users are allowed to masquerade)\n");
+       keyopt(" <7> ClamAV         (Address of ClamAV clamd server)\n");
        sel = intprompt("Which one", 1, 1, 8);
        switch(sel) {
                case 1: strcpy(buf, "localhost");
@@ -396,15 +395,13 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) {
                        return;
                case 3: strcpy(buf, "fallbackhost");
                        return;
-               case 4: strcpy(buf, "directory");
+               case 4: strcpy(buf, "spamassassin");
                        return;
-               case 5: strcpy(buf, "spamassassin");
+               case 5: strcpy(buf, "rbl");
                        return;
-               case 6: strcpy(buf, "rbl");
+               case 6: strcpy(buf, "masqdomain");
                        return;
-               case 7: strcpy(buf, "masqdomain");
-                       return;
-               case 8: strcpy(buf, "clamav");
+               case 7: strcpy(buf, "clamav");
                        return;
        }
 }
@@ -460,29 +457,29 @@ void do_internet_configuration(CtdlIPC *ipc)
                ch = keymenu("", "<A>dd|<D>elete|<S>ave|<Q>uit");
                switch(ch) {
                        case 'a':
-                               newprompt("Enter host name: ",
-                                       buf, 50);
+                               newprompt("Enter host name: ", buf, 50);
                                striplt(buf);
                                if (!IsEmptyStr(buf)) {
                                        ++num_recs;
-                                       if (num_recs == 1)
+                                       if (num_recs == 1) {
                                                recs = malloc(sizeof(char *));
-                                       else recs = realloc(recs,
-                                               (sizeof(char *)) * num_recs);
+                                       }
+                                       else {
+                                               recs = realloc(recs, (sizeof(char *)) * num_recs);
+                                       }
                                        strcat(buf, "|");
-                                       get_inet_rec_type(ipc,
-                                                       &buf[strlen(buf)]);
+                                       get_inet_rec_type(ipc, &buf[strlen(buf)]);
                                        recs[num_recs-1] = strdup(buf);
                                }
                                modified = 1;
                                break;
                        case 'd':
-                               i = intprompt("Delete which one",
-                                       1, 1, num_recs) - 1;
+                               i = intprompt("Delete which one", 1, 1, num_recs) - 1;
                                free(recs[i]);
                                --num_recs;
-                               for (j=i; j<num_recs; ++j)
+                               for (j=i; j<num_recs; ++j) {
                                        recs[j] = recs[j+1];
+                               }
                                modified = 1;
                                break;
                        case 's':
index 07a7526a6d0a1d06becdf96ee5cab5936782925f..554a74c6474e041736980cf8cfeafd815a595246 100644 (file)
@@ -251,5 +251,4 @@ InitModule_INETCONF
        RegisterIterator("SERVCFG:INET", 1, NULL, GetInetConfHash, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
        RegisterNamespace("SERVCFG:FLUSHINETCFG",0, 0, DeleteInetConfHash, NULL, CTX_NONE);
        RegisterIterator("ITERATE:VALID:DOMAINNAMES", 1, NULL, GetValidDomainNames, NULL, DeleteHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
-
 }