]> code.citadel.org Git - citadel.git/blobdiff - citadel/config.c
* Merge LDAP code; bindings are not yet complete
[citadel.git] / citadel / config.c
index 30989674216419f9199770a92828db18bfacf3a8..b33e04142d9e6f5d40e58c9c0b53c206dcfc87e2 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * $Id$
  *
- * This function reads the citadel.config file.  It should be called at
- * the beginning of EVERY Citadel program.
+ * Read and write the citadel.config file
  *
  */
 
@@ -79,6 +78,14 @@ void get_config(void) {
                exit(CTDLEXIT_LIBCITADEL);
        }
 
+       /* Only allow LDAP auth mode if we actually have LDAP support */
+#ifndef HAVE_LDAP
+       if (config.c_auth_mode == AUTHMODE_LDAP) {
+               fprintf(stderr, "Your system is configured for LDAP authentication,\n"
+                               "but you are running a server built without OpenLDAP support.\n");
+               exit(CTDL_EXIT_UNSUP_AUTH);
+       }
+#endif
 
        /* Check to see whether 'setup' must first be run to update data file formats */
        if (config.c_setup_level < REV_MIN) {