From c1a85e88e78f9275e8504f744f16d1af1656e3fc Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 7 Nov 1998 01:38:25 +0000 Subject: [PATCH] * citadel.h (and related files): removed defunct parameters, c_defent and c_msgbase (erase your test bbs) * Began implementing CONF server command for site-global configs --- citadel/ChangeLog | 5 ++++ citadel/citadel.h | 3 +- citadel/citserver.c | 5 ++++ citadel/control.c | 58 +++++++++++++++++++++++++++++++++++++ citadel/control.h | 1 + citadel/import.c | 2 -- citadel/serv_upgrade.c | 3 -- citadel/techdoc/session.txt | 34 ++++++++++++++++++++++ 8 files changed, 105 insertions(+), 6 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 9890c4fa4..9da9eff5d 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 6 20:22:20 EST 1998 Art Cancro + * citadel.h (and related files): removed defunct parameters, + c_defent and c_msgbase (erase your test bbs) + * Began implementing CONF server command for site-global configs + 1998-11-05 Nathan Bryant * snprintf.c: warning fix propagated over from gcit diff --git a/citadel/citadel.h b/citadel/citadel.h index 1a5aa805b..8f519dcd9 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -59,7 +59,6 @@ struct config { char c_regiscall; /* call number to register on */ char c_twitdetect; /* twit detect flag */ char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */ - int c_defent; /* command generated by key */ char c_moreprompt[80]; /* paginator prompt */ char c_restrict; /* restrict Internet mail flag */ long c_msgbase; /* size of message base */ @@ -72,6 +71,7 @@ struct config { int c_port_number; /* TCP port to run the server on */ int c_ipgm_secret; /* Internal program authentication */ struct ExpirePolicy c_ep; /* System default msg expire policy */ + int c_userpurge; /* System default user purge (days) */ }; #define NODENAME config.c_nodename @@ -105,6 +105,7 @@ struct usersupp { /* User record */ char USzip[10]; /* ZIP code */ char USphone[11]; /* Voice telephone number */ char USemail[32]; /* E-mail address (elsewhere) */ + int USuserpurge; /* Purge time (in days) for user */ }; diff --git a/citadel/citserver.c b/citadel/citserver.c index fc58d166b..ca34147a7 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -28,6 +28,7 @@ #include "file_ops.h" #include "dynloader.h" #include "policy.h" +#include "control.h" struct CitContext *ContextList = NULL; int ScheduledShutdown = 0; @@ -1067,6 +1068,10 @@ void *context_loop(struct CitContext *con) cmd_spex(&cmdbuf[5]); } + else if (!strncasecmp(cmdbuf, "CONF", 4)) { + cmd_conf(&cmdbuf[5]); + } + else if (!DLoader_Exec_Cmd(cmdbuf)) { cprintf("%d Unrecognized or unsupported command.\n", diff --git a/citadel/control.c b/citadel/control.c index 540863412..44d8cdb4a 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -22,8 +22,10 @@ #include "server.h" #include "control.h" #include "sysdep_decls.h" +#include "support.h" struct CitControl CitControl; +struct config config; /* * get_control - read the control record into memory. @@ -81,3 +83,59 @@ long get_new_user_number(void) { end_critical_section(S_CONTROL); return(CitControl.MMnextuser); } + + + +/* + * Get or set global configuration options + */ +void cmd_conf(char *argbuf) { + char cmd[256]; + char buf[256]; + int a; + + if (!(CC->logged_in)) { + cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN); + return; + } + + if (CC->usersupp.axlevel < 6) { + cprintf("%d Higher access required.\n", + ERROR+HIGHER_ACCESS_REQUIRED); + return; + } + + extract(cmd, argbuf, 0); + if (!strcasecmp(cmd, "GET")) { + cprintf("%d Configuration...\n", LISTING_FOLLOWS); + cprintf("%s\n", config.c_nodename); + cprintf("%s\n", config.c_fqdn); + cprintf("%s\n", config.c_humannode); + cprintf("%s\n", config.c_phonenum); + cprintf("%d\n", config.c_creataide); + cprintf("%d\n", config.c_sleeping); + cprintf("%d\n", config.c_initax); + cprintf("%d\n", config.c_regiscall); + cprintf("%d\n", config.c_twitdetect); + cprintf("%s\n", config.c_twitroom); + cprintf("%s\n", config.c_moreprompt); + cprintf("%d\n", config.c_restrict); + cprintf("%s\n", config.c_bbs_city); + cprintf("%s\n", config.c_sysadm); + cprintf("%d\n", config.c_maxsessions); + cprintf("%s\n", config.c_net_password); + cprintf("%d\n", config.c_userpurge); + cprintf("000\n"); + } + + /* + else if (!strcasecmp(cmd, "SET")) { + cprintf("%d Send configuration...\n"); + } + */ + + else { + cprintf("%d The only valid options are GET and SET.\n", + ERROR+ILLEGAL_VALUE); + } + } diff --git a/citadel/control.h b/citadel/control.h index 17967bc47..04f73036f 100644 --- a/citadel/control.h +++ b/citadel/control.h @@ -3,3 +3,4 @@ void get_control (void); void put_control (void); long int get_new_message_number (void); long int get_new_user_number (void); +void cmd_conf(char *argbuf); diff --git a/citadel/import.c b/citadel/import.c index 812d8eccc..9a72f4cb2 100644 --- a/citadel/import.c +++ b/citadel/import.c @@ -115,8 +115,6 @@ void imp_config() { config.c_twitdetect = atoi(value); if (!strcasecmp(key, "c_twitroom")) strcpy(config.c_twitroom, value); - if (!strcasecmp(key, "c_defent")) - config.c_defent = atoi(value); if (!strcasecmp(key, "c_moreprompt")) strcpy(config.c_moreprompt, value); if (!strcasecmp(key, "c_restrict")) diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 8f39b2b8f..35c6e8677 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -368,8 +368,6 @@ void imp_config(void) { config.c_twitdetect = atoi(value); if (!strcasecmp(key, "c_twitroom")) strcpy(config.c_twitroom, value); - if (!strcasecmp(key, "c_defent")) - config.c_defent = atoi(value); if (!strcasecmp(key, "c_moreprompt")) strcpy(config.c_moreprompt, value); if (!strcasecmp(key, "c_restrict")) @@ -648,7 +646,6 @@ void do_export(char *argbuf) { fprintf(exfp, "c_regiscall%c%d%c", 0, config.c_regiscall, 0); fprintf(exfp, "c_twitdetect%c%d%c", 0, config.c_twitdetect, 0); fprintf(exfp, "c_twitroom%c%s%c", 0, config.c_twitroom, 0); - fprintf(exfp, "c_defent%c%d%c", 0, config.c_defent, 0); fprintf(exfp, "c_moreprompt%c%s%c", 0, config.c_moreprompt, 0); fprintf(exfp, "c_restrict%c%d%c", 0, config.c_restrict, 0); fprintf(exfp, "c_bbs_city%c%s%c", 0, config.c_bbs_city, 0); diff --git a/citadel/techdoc/session.txt b/citadel/techdoc/session.txt index 2bd0f652e..6c2d14f78 100644 --- a/citadel/techdoc/session.txt +++ b/citadel/techdoc/session.txt @@ -1642,3 +1642,37 @@ the list of available policies. The value of must be one of: "room" "floor" "site" If successful, GPEX returns OK; otherwise, an ERROR code is returned. + + + + CONF (get or set global CONFiguration options) + + Retrieves or sets various system-wide configuration and policy options. This +command is only available to Aides. The sole parameter accepted is a command, +which should be either GET or SET. If the GET command succeeds, CONF will +return LISTING_FOLLOWS followed by the fields described below, one line at a +time. If the SET command succeeds, CONF will return SEND_LISTING and expect +the fields described below, one line at a time (don't worry about other fields +being added in the future; if a 'short' configuration list is sent, the missing +values at the end will be left unchanged on the system). If either command +fails for any reason, ERROR is returned. + + The configuration lines are as follows: + + 1. Node name + 2. Fully qualified domain name + 3. Human-readable node name + 4. Landline telephone number of this system + 5. Flag (0 or 1) - creator of private room automatically becomes room aide + 6. Server connection idle timeout (in seconds) + 7. Initial access level for new users + 8. Flag (0 or 1) - require registration for new users + 9. Flag (0 or 1) - automatically move Problem User messages to twit room + 10. Name of twit room + 11. Text of prompt + 12. Flag (0 or 1) - restrict access to Internet mail + 13. Geographic location of this system + 14. Name of the system administrator + 15. Number of maximum concurrent sessions allowed on the server + 16. Password for server-to-server networking + 17. Default purge time (in days) for users -- 2.30.2