]> code.citadel.org Git - citadel.git/blobdiff - citadel/control.c
* control.c: when config.c_maxsessions is unset or negative, set it to 0
[citadel.git] / citadel / control.c
index 207291faf45be9bf7a4f91c01c658b04d2a3ea71..e0a6dfd5dd24b31ed8dd83eb80b7ce78f926e102 100644 (file)
@@ -80,7 +80,7 @@ void get_control(void)
                }
        }
        if (control_fp == NULL) {
-               lprintf(1, "ERROR opening citadel.control: %s\n",
+               lprintf(CTDL_ALERT, "ERROR opening citadel.control: %s\n",
                        strerror(errno));
                return;
        }
@@ -199,9 +199,15 @@ void cmd_conf(char *argbuf)
 #ifdef HAVE_LDAP
                cprintf("%s\n", config.c_ldap_host);
                cprintf("%d\n", config.c_ldap_port);
+               cprintf("%s\n", config.c_ldap_base_dn);
+               cprintf("%s\n", config.c_ldap_bind_dn);
+               cprintf("%s\n", config.c_ldap_bind_pw);
 #else
                cprintf("\n");
                cprintf("0\n");
+               cprintf("\n");
+               cprintf("\n");
+               cprintf("\n");
 #endif
                cprintf("000\n");
        }
@@ -273,8 +279,8 @@ void cmd_conf(char *argbuf)
                                break;
                        case 14:
                                config.c_maxsessions = atoi(buf);
-                               if (config.c_maxsessions < 1)
-                                       config.c_maxsessions = 1;
+                               if (config.c_maxsessions < 0)
+                                       config.c_maxsessions = 0;
                                break;
                        case 15:
                                /* placeholder -- field no longer in use */
@@ -350,6 +356,18 @@ void cmd_conf(char *argbuf)
                        case 33:
                                config.c_ldap_port = atoi(buf);
                                break;
+                       case 34:
+                               safestrncpy(config.c_ldap_base_dn, buf,
+                                           sizeof config.c_ldap_base_dn);
+                               break;
+                       case 35:
+                               safestrncpy(config.c_ldap_bind_dn, buf,
+                                           sizeof config.c_ldap_bind_dn);
+                               break;
+                       case 36:
+                               safestrncpy(config.c_ldap_bind_pw, buf,
+                                           sizeof config.c_ldap_bind_pw);
+                               break;
 #endif
                        }
                        ++a;
@@ -373,7 +391,7 @@ void cmd_conf(char *argbuf)
                        if (confptr[strlen(confptr) - 1] != 10)
                                client_write("\n", 1);
                        cprintf("000\n");
-                       phree(confptr);
+                       free(confptr);
                } else {
                        cprintf("%d No such configuration.\n",
                                ERROR + ILLEGAL_VALUE);
@@ -386,7 +404,7 @@ void cmd_conf(char *argbuf)
                confptr = CtdlReadMessageBody("000",
                                config.c_maxmsglen, NULL, 0);
                CtdlPutSysConfig(confname, confptr);
-               phree(confptr);
+               free(confptr);
        }
 
        else {