From e06dccec8d9eed5a62d7a53a3391c683e555db2c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 24 Jun 2004 20:33:37 +0000 Subject: [PATCH] * Bumped internal version number to 6.23 * Added "Server IP address" to config (server, client, docs) --- citadel/ChangeLog | 5 ++++- citadel/citadel.h | 6 +++--- citadel/control.c | 4 ++++ citadel/routines2.c | 3 ++- citadel/serv_extensions.c | 3 ++- citadel/serv_upgrade.c | 4 ++++ citadel/setup.c | 12 +++++++++++- citadel/techdoc/session.txt | 5 +++-- 8 files changed, 33 insertions(+), 9 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 61c503f92..8c50c9eab 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 622.3 2004/06/24 20:33:37 ajc + * Bumped internal version number to 6.23 + * Added "Server IP address" to config (server, client, docs) + Revision 622.2 2004/06/24 15:26:33 ajc * Updated the ig_tcp_server() function to allow binding to a single IP address. This is not yet used by anything. @@ -5879,4 +5883,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.h b/citadel/citadel.h index 686c61389..036caaa06 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -32,7 +32,7 @@ extern "C" { /* * Text description of this software */ -#define CITADEL "Citadel/UX 6.22" +#define CITADEL "Citadel/UX 6.23" /* * REV_LEVEL is the current version number (multiplied by 100 to avoid having @@ -44,7 +44,7 @@ extern "C" { * usually more strict because you're not really supposed to dump/load and * upgrade at the same time. */ -#define REV_LEVEL 622 /* This version */ +#define REV_LEVEL 623 /* This version */ #define REV_MIN 591 /* Oldest compatible database */ #define EXPORT_REV_MIN 615 /* Oldest compatible export files */ @@ -107,7 +107,7 @@ struct config { char c_niu_2[15]; /* (not in use) */ int c_setup_level; /* what rev level we've setup to */ int c_maxsessions; /* maximum concurrent sessions */ - char c_niu_3[20]; /* (not in use) */ + char c_ip_addr[20]; /* IP address to listen on */ int c_port_number; /* Cit listener port (usually 504) */ int c_ipgm_secret; /* Internal program authentication */ struct ExpirePolicy c_ep; /* System default msg expire policy */ diff --git a/citadel/control.c b/citadel/control.c index 6b05750aa..c145a5a93 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -209,6 +209,7 @@ void cmd_conf(char *argbuf) cprintf("\n"); cprintf("\n"); #endif + cprintf("%s\n", config.c_ip_addr); cprintf("000\n"); } @@ -367,6 +368,9 @@ void cmd_conf(char *argbuf) sizeof config.c_ldap_bind_pw); break; #endif + case 37: + safestrncpy(config.c_ip_addr, buf, + sizeof config.c_ip_addr); } ++a; } diff --git a/citadel/routines2.c b/citadel/routines2.c index 7d627ae2e..8a76f8bd0 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc) void do_system_configuration(CtdlIPC *ipc) { -#define NUM_CONFIGS 37 +#define NUM_CONFIGS 38 char buf[SIZ]; char sc[NUM_CONFIGS][SIZ]; @@ -734,6 +734,7 @@ void do_system_configuration(CtdlIPC *ipc) strprompt("Minimum number of worker threads", &sc[21][0], 3); strprompt("Maximum number of worker threads", &sc[22][0], 3); + strprompt("Server IP address (0.0.0.0 for 'any')", &sc[37][0], 15); strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5); strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5); strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5); diff --git a/citadel/serv_extensions.c b/citadel/serv_extensions.c index e62655e1e..d69a85dea 100644 --- a/citadel/serv_extensions.c +++ b/citadel/serv_extensions.c @@ -452,7 +452,8 @@ void CtdlRegisterServiceHook(int tcp_port, return; } else { - newfcn->msock = ig_tcp_server(NULL, tcp_port, + newfcn->msock = ig_tcp_server(config.c_ip_addr, + tcp_port, config.c_maxsessions); snprintf(message, sizeof message, "TCP port %d: ", tcp_port); } diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 88d6be709..79b0d9c13 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -168,6 +168,10 @@ void update_config(void) { config.c_ldap_port = 389; } + if (CitControl.version < 623) { + strcpy(config.c_ip_addr, "0.0.0.0"); + } + put_config(); } diff --git a/citadel/setup.c b/citadel/setup.c index 88b9d3522..02f59123f 100644 --- a/citadel/setup.c +++ b/citadel/setup.c @@ -32,7 +32,7 @@ #endif -#define MAXSETUP 3 /* How many setup questions to ask */ +#define MAXSETUP 4 /* How many setup questions to ask */ #define UI_TEXT 0 /* Default setup type -- text only */ #define UI_SILENT 3 /* Silent running, for use in scripts */ @@ -51,6 +51,7 @@ char *setup_titles[] = "Citadel Home Directory", "System Administrator", "Citadel User ID", + "Server IP address", "Server port number", }; @@ -72,6 +73,11 @@ char *setup_text[] = "user ID. Please specify that user ID here. You may specify either a\n" "user name or a numeric UID.\n", +"Specify the IP address on which your server will run. If you leave this\n" +"blank, or if you specify 0.0.0.0, Citadel will listen on all addresses.\n" +"You can usually skip this unless you're running multiple instances of\n" +"Citadel on the same computer.\n", + "Specify the TCP port number on which your server will run. Normally, this\n" "will be port 504, which is the official port assigned by the IANA for\n" "Citadel servers. You'll only need to specify a different port number if\n" @@ -711,6 +717,10 @@ void edit_value(int curr) break; case 3: + set_str_val(curr, &config.c_ip_addr); + break; + + case 4: set_int_val(curr, &config.c_port_number); break; diff --git a/citadel/techdoc/session.txt b/citadel/techdoc/session.txt index d589b6e44..3875d3326 100644 --- a/citadel/techdoc/session.txt +++ b/citadel/techdoc/session.txt @@ -34,8 +34,8 @@ what you did, so that your new commands can be added to this document. document, but we will briefly cover the methodology employed by Citadel/UX. Citadel/UX offers Citadel BBS service using TCP/IP. It does so via a -multithreaded server listening on a TCP port. Older (4.xx) versions employed -an inetd-based server. +multithreaded server listening on a TCP port. Local connections may also +be made using the same protocol using Unix domain sockets. The port number officially assigned to Citadel by the IANA is 504/tcp. Since our session layer assumes a clean, reliable, sequenced connection, the use @@ -1795,6 +1795,7 @@ fails for any reason, ERROR is returned. 35. LDAP Base DN 36. LDAP Bind DN 37. Password for LDAP Bind DN + 38. Server IP address to listen on (or "0.0.0.0" for all addresses) CONF also accepts two additional commands: GETSYS and PUTSYS followed by an arbitrary MIME type (such as application/x-citadel-internet-config) which -- 2.30.2