/*
- * $Id$
- *
* Citadel setup utility
- *
*/
#define SHOW_ME_VAPPEND_PRINTF
-
#include "ctdl_module.h"
-
-
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
setup_titles[eLDAP_Bind_PW] = _("LDAP bind password:");//
}
-/**
- * \brief print the actual stack frame.
+/*
+ * print the actual stack frame.
*/
void cit_backtrace(void)
{
size_t size, i;
char **strings;
-
size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
strings = backtrace_symbols(stack_frames, size);
for (i = 0; i < size; i++) {
struct config config;
- /* calculate all our path on a central place */
- /* where to keep our config */
+/* calculate all our path on a central place */
+/* where to keep our config */
char *setup_text[] = {
"user ID here. You may specify either a user name or a numeric\n"
"UID.\n",
-"Specify the IP address on which your server will run. If you\n"
-"leave this blank, or if you specify 0.0.0.0, Citadel will listen\n"
-"on all addresses. You can usually skip this unless you are\n"
+"Specify the IP address on which your server will run.\n"
+"You can name a specific IPv4 or IPv6 address, or you can specify\n"
+"'*' for 'any address', '::' for 'any IPv6 address', or '0.0.0.0'\n"
+"for 'any IPv4 address'. If you leave this blank, Citadel will\n"
+"listen on all addresses. You can usually skip this unless you are\n"
"running multiple instances of Citadel on the same computer.\n",
"Specify the TCP port number on which your server will run.\n"
"of Citadel on the same computer and there is something else\n"
"already using port 504.\n",
-
-
"Specify which authentication mode you wish to use.\n"
"\n"
" 0. Self contained authentication\n"
case UI_TEXT:
if (curr == 0) {
printf("%s\n", text);
- printf("..........................");
- printf("..........................");
+ printf("....................................................");
printf("..........................\r");
fflush(stdout);
dots_printed = 0;
/*
* delete_inittab_entry() -- Remove obsolete /etc/inittab entry for Citadel
- *
*/
void delete_inittab_entry(void)
{
/*
* install_init_scripts() -- Try to configure to start Citadel at boot
- *
*/
void install_init_scripts(void)
{
-
-
-
/*
* On systems which use xinetd, see if we can offer to install Citadel as
* the default telnet target.
void set_str_val(int msgpos, char *Target, char *DefValue)
{
- if (DefValue != NULL)
- {
- strprompt(setup_titles[msgpos],
- setup_text[msgpos],
- Target,
- DefValue);
- }
+ strprompt(setup_titles[msgpos],
+ setup_text[msgpos],
+ Target,
+ DefValue);
}
void set_int_val(int msgpos, int *ip, char *DefValue)
{
Value = getenv(EnvNames[curr]);
}
+ if (Value == NULL)
+ Value = "";
switch (curr) {
}
}
-/***** begin version update section ***** */
- /* take care of any updating that is necessary */
+ /***** begin version update section *****/
old_setup_level = config.c_setup_level;
}
if (old_setup_level < 555) {
- important_message("Citadel Setup",
- "This Citadel installation is too old "
- "to be upgraded.");
+ important_message(
+ "Citadel Setup",
+ "This Citadel installation is too old to be upgraded."
+ );
cleanup(1);
}
write_config_to_disk();
old_setup_level = config.c_setup_level;
- /* end of version update section */
+ /***** end of version update section *****/
NEW_INST:
config.c_setup_level = REV_LEVEL;
-/******************************************/
if ((pw = getpwuid(config.c_ctdluid)) == NULL) {
gid = getgid();
} else {
migrate_old_installs(); /* Delete files and directories used by older Citadel versions */
- if (((setup_type == UI_SILENT) && (getenv("ALTER_ETC_SERVICES")!=NULL)) ||
- (setup_type != UI_SILENT))
+ if ( ((setup_type == UI_SILENT)
+ && (getenv("ALTER_ETC_SERVICES")!=NULL))
+ || (setup_type != UI_SILENT)
+ ) {
check_services_entry(); /* Check /etc/services */
+ }
+
#ifndef __CYGWIN__
delete_inittab_entry(); /* Remove obsolete /etc/inittab entry */
check_xinetd_entry(); /* Check /etc/xinetd.d/telnet */
disable_other_mtas(); /* Offer to disable other MTAs */
-
+ fixnss(); /* Check for the 'db' nss and offer to disable it */
#endif
- fixnss(); /* Check for the 'db' nss and offer to disable it */
progress("Setting file permissions", 1, 3);
rv = chown(file_citadel_config, config.c_ctdluid, gid);
rv = chmod(file_citadel_config, S_IRUSR | S_IWUSR);
progress("Setting file permissions", 3, 3);
- check_init_script (relhome);
+ check_init_script(relhome);
cleanup(0);
return 0;
}