* Further adjustments to ldap setup
authorArt Cancro <ajc@citadel.org>
Thu, 11 Nov 2004 14:56:16 +0000 (14:56 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 11 Nov 2004 14:56:16 +0000 (14:56 +0000)
citadel/ChangeLog
citadel/setup.c

index 3b8ed221c95836867a2f464cced88f7f7aec1c48..e21c6d7a9aeeff2a1f36a0aa32f4c7b52965398e 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index f8c3e2d0b8b660dbc65d258dd4a9f7bc4f9feab0..6f4bbae3cab0f9dc203c9957eea0b9bd03457661 100644 (file)
@@ -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