From: Art Cancro Date: Thu, 11 Nov 2004 14:56:16 +0000 (+0000) Subject: * Further adjustments to ldap setup X-Git-Tag: v7.86~5202 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a50921ac8844783994df3756f89a19710fc2297c;p=citadel.git * Further adjustments to ldap setup --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 3b8ed221c..e21c6d7a9 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 627.5 2004/11/11 14:56:16 ajc + * Further adjustments to ldap setup + Revision 627.4 2004/11/11 04:38:36 ajc * setup.c: fix bug that kept creating new inittab entries for slapd @@ -6204,4 +6207,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/setup.c b/citadel/setup.c index f8c3e2d0b..6f4bbae3c 100644 --- a/citadel/setup.c +++ b/citadel/setup.c @@ -1238,18 +1238,34 @@ void contemplate_ldap(void) { char slapd_init_entry[SIZ]; FILE *fp; - /* If conditions are not ideal, give up on this idea. */ + /* If conditions are not ideal, give up on this idea... */ if (using_web_installer == 0) return; if (getenv("LDAP_CONFIG") == NULL) return; if (getenv("SUPPORT") == NULL) return; if (getenv("SLAPD_BINARY") == NULL) return; if (getenv("CITADEL") == NULL) return; - /* Otherwise, prompt the user to create an entry. */ + /* And if inittab is already starting slapd, bail out... */ + locate_init_entry(slapd_init_entry, getenv("SLAPD_BINARY")); + if (strlen(slapd_init_entry) > 0) { + important_message("Citadel Setup", + "You appear to already have a standalone LDAP " + "service\nconfigured for use with Citadel. No " + "changes will be made.\n"); + /* set_init_entry(slapd_init_entry, "off"); */ + return; + } + + /* Generate a unique entry name for slapd if we don't have one. */ + else { + generate_entry_name(slapd_init_entry); + } + + /* Ask the user if it's ok to set up slapd automatically. */ snprintf(question, sizeof question, "\n" "Do you want this computer configured to start a standalone\n" - "LDAP service automatically? (If you answer yes, a custom\n" + "LDAP service automatically? (If you answer yes, a new\n" "slapd.conf will be written, and an /etc/inittab entry\n" "pointing to %s will be added.)\n" "\n", @@ -1312,17 +1328,6 @@ void contemplate_ldap(void) { /* This is where our OpenLDAP server will keep its data. */ mkdir("openldap-data", 0700); - /* If inittab is already starting slapd, disable the old entry. */ - locate_init_entry(slapd_init_entry, getenv("SLAPD_BINARY")); - if (strlen(slapd_init_entry) > 0) { - set_init_entry(slapd_init_entry, "off"); - } - - /* Otherwise, generate a unique entry name for slapd */ - else { - generate_entry_name(slapd_init_entry); - } - /* Now write it out to /etc/inittab. * FIXME make it run as some non-root user. * The "-d 0" seems superfluous, but it's actually a way to make