removed IGnet functions from text client
[citadel.git] / textclient / src / citadel.c
index 9e6fc86c29c4cadac4aa40e45c2562c1301afec4..0385c37509c90eb1cf27374a9afe4f621e8e6591 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Main source module for the client program.
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2018 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.
@@ -1426,15 +1426,6 @@ int main(int argc, char **argv)
        setIPCErrorPrintf(scr_printf);
        setCryptoStatusHook(statusHook);
        
-       /* Permissions sanity check - don't run citadel setuid/setgid */
-       if (getuid() != geteuid()) {
-               scr_printf("Please do not run citadel setuid!\n");
-               logoff(NULL, 3);
-       } else if (getgid() != getegid()) {
-               scr_printf("Please do not run citadel setgid!\n");
-               logoff(NULL, 3);
-       }
-
        stty_ctdl(SB_SAVE);             /* Store the old terminal parameters */
        load_command_set();             /* parse the citadel.rc file */
        stty_ctdl(SB_NO_INTR);          /* Install the new ones */
@@ -1474,41 +1465,11 @@ int main(int argc, char **argv)
 #endif
                }
                if (!strcmp(argv[a], "-p")) {
-                       struct stat st;
-               
-                       if (chdir(CTDLDIR) < 0) {
-                               perror("can't change to " CTDLDIR);
-                               logoff(NULL, 3);
-                       }
-
-                       /*
-                        * Drop privileges if necessary. We stat
-                        * citadel.config to get the uid/gid since it's
-                        * guaranteed to have the uid/gid we want.
-                        */
-                       if (!getuid() || !getgid()) {
-                               if (stat(file_citadel_config, &st) < 0) {
-                                       perror("couldn't stat citadel.config");
-                                       logoff(NULL, 3);
-                               }
-                               if (!getgid() && (setgid(st.st_gid) < 0)) {
-                                       perror("couldn't change gid");
-                                       logoff(NULL, 3);
-                               }
-                               if (!getuid() && (setuid(st.st_uid) < 0)) {
-                                       perror("couldn't change uid");
-                                       logoff(NULL, 3);
-                               }
-                               /*
-                                 scr_printf("Privileges changed to uid %d gid %d\n",
-                                 getuid(), getgid());
-                               */
-                       }
+                       // ignore this argument when called from telnetd
                        argc = shift(argc, argv, a, 1);
                }
        }
        
-
        screen_new();
        /* Get screen dimensions.  First we go to a default of 80x24.
         * Then attempt to read the actual screen size from the terminal.
@@ -1775,7 +1736,7 @@ NEWUSR:   if (IsEmptyStr(rc_password)) {
                if (termn8 == 0)
                        switch (mcmd) {
                        case 1:
-                               formout(ipc, "help");
+                               display_help(ipc, "help");
                                break;
                        case 4:
                                entmsg(ipc, 0, ((userflags & US_EXTEDIT) ? 2 : 0), 0);
@@ -1947,8 +1908,9 @@ NEWUSR:   if (IsEmptyStr(rc_password)) {
                                break;
 
                        case 21:
-                               if (argbuf[0] == 0)
-                                       strcpy(aaa, "?");
+                               if (argbuf[0] == 0) {
+                                       strcpy(argbuf, "?");
+                               }
                                display_help(ipc, argbuf);
                                break;
 
@@ -2000,26 +1962,11 @@ NEWUSR: if (IsEmptyStr(rc_password)) {
                                break;
 
                        case 87:
-                               network_config_management(ipc, "listrecp",
-                                                         "Message-by-message mailing list recipients");
+                               network_config_management(ipc, "listrecp", "Message-by-message mailing list recipients");
                                break;
 
                        case 94:
-                               network_config_management(ipc, "digestrecp",
-                                                         "Digest mailing list recipients");
-                               break;
-
-                       case 89:
-                               network_config_management(ipc, "ignet_push_share",
-                                                         "Nodes with which we share this room");
-                               break;
-
-                       case 88:
-                               do_ignet_configuration(ipc);
-                               break;
-
-                       case 92:
-                               do_filterlist_configuration(ipc);
+                               network_config_management(ipc, "digestrecp", "Digest mailing list recipients");
                                break;
 
                        case 6: