X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Fsetup.c;h=67768fa40467d5fada7d9f16bac10d9004a18677;hb=377231394f0f18628af378d85c4bbf4b518b9485;hp=2508712a2ae0108121ec9c81ee8592109785379d;hpb=4f16550e3fe10c62b691b3976ff8b4fccc9dd830;p=citadel.git diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index 2508712a2..67768fa40 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -1,7 +1,7 @@ /* * Citadel setup utility * - * Copyright (c) 1987-2017 by the citadel.org team + * Copyright (c) 1987-2019 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. @@ -36,9 +36,6 @@ #include "axdefs.h" #include "sysdep.h" #include "citadel_dirs.h" -#if HAVE_BACKTRACE -#include -#endif #ifdef ENABLE_NLS #ifdef HAVE_XLOCALE_H @@ -632,104 +629,15 @@ void check_xinetd_entry(void) } -/* - * Offer to disable other MTA's - */ -void disable_other_mta(const char *mta) { - char buf[SIZ]; - FILE *fp; - int lines = 0; - int rv; - - snprintf(buf, sizeof buf, - "/bin/ls -l /etc/rc*.d/S*%s 2>/dev/null; " - "/bin/ls -l /etc/rc.d/rc*.d/S*%s 2>/dev/null", - mta, mta - ); - fp = popen(buf, "r"); - if (fp == NULL) return; - - while (fgets(buf, sizeof buf, fp) != NULL) { - ++lines; - } - fclose(fp); - if (lines == 0) return; /* Nothing to do. */ - - /* Offer to replace other MTA with the vastly superior Citadel :) */ - - snprintf(buf, sizeof buf, - "%s \"%s\" %s%s%s%s%s%s%s", - _("You appear to have the "), - mta, - _(" email program\n" - "running on your system. If you want Citadel mail\n" - "connected with "), - mta, - _(" you will have to manually integrate\n" - "them. It is preferable to disable "), - mta, - _(", and use Citadel's\n" - "SMTP, POP3, and IMAP services.\n\n" - "May we disable "), - mta, - _("so that Citadel has access to ports\n" - "25, 110, and 143?\n") - ); - if (yesno(buf, 1) == 0) { - return; - } - - - snprintf(buf, sizeof buf, "for x in /etc/rc*.d/S*%s; do mv $x `echo $x |sed s/S/K/g`; done >/dev/null 2>&1", mta); - rv = system(buf); - if (rv != 0) - display_error("%s %s.\n", _("failed to disable other mta"), mta); - - snprintf(buf, sizeof buf, "/etc/init.d/%s stop >/dev/null 2>&1", mta); - rv = system(buf); - if (rv != 0) - display_error(" %s.\n", _("failed to disable other mta"), mta); -} - -const char *other_mtas[] = { - "courier-authdaemon", - "courier-imap", - "courier-imap-ssl", - "courier-pop", - "courier-pop3", - "courier-pop3d", - "cyrmaster", - "cyrus", - "dovecot", - "exim", - "exim4", - "imapd", - "mta", - "pop3d", - "popd", - "postfix", - "qmail", - "saslauthd", - "sendmail", - "vmailmgrd", - "" -}; - void disable_other_mtas(void) { - int i = 0; - if ((getenv("ACT_AS_MTA") == NULL) || - (getenv("ACT_AS_MTA") && - strcasecmp(getenv("ACT_AS_MTA"), "yes") == 0)) { + if ((getenv("ACT_AS_MTA") == NULL) || (getenv("ACT_AS_MTA") && strcasecmp(getenv("ACT_AS_MTA"), "yes") == 0)) { /* Offer to disable other MTA's on the system. */ - while (!IsEmptyStr(other_mtas[i])) - { - disable_other_mta(other_mtas[i]); - i++; - } + /* FIXME this has to be rewritten to work in the new systemd-based world. */ } } + void strprompt(const char *prompt_title, const char *prompt_text, char *Target, char *DefValue) { char buf[SIZ] = ""; @@ -852,9 +760,6 @@ void edit_value(int curr) } else { -#ifdef __CYGWIN__ - ctdluid = 0; /* work-around for Windows */ -#else pw = getpwuid(ctdluid); if (pw == NULL) { set_int_val(curr, &ctdluid, default_value); @@ -870,7 +775,6 @@ void edit_value(int curr) ctdluid = atoi(ctdluidname); } } -#endif } setconf_int("c_ctdluid", ctdluid); break; @@ -1054,21 +958,19 @@ void fixnss(void) { * We keep them here so we don't lose the translations if we need them later. */ #if 0 - important_message(_("Setup finished"), - _("Setup of the Citadel server is complete.\n" - "If you will be using WebCit, please run its\n" - "setup program now; otherwise, run './citadel'\n" - "to log in.\n")); - important_message(_("Setup failed"), - _("Setup is finished, but the Citadel server failed to start.\n" - "Go back and check your configuration.\n") - important_message(_("Setup finished"), - _("Setup is finished. You may now start the server.")); +important_message(_("Setup finished"), +_("Setup of the Citadel server is complete.\n" +"If you will be using WebCit, please run its\n" +"setup program now; otherwise, run './citadel'\n" +"to log in.\n")); +important_message(_("Setup failed"), +_("Setup is finished, but the Citadel server failed to start.\n" +"Go back and check your configuration.\n"); +important_message(_("Setup finished"), +_("Setup is finished. You may now start the server.")); #endif - - int main(int argc, char *argv[]) { int a, i;