]> code.citadel.org Git - citadel.git/blobdiff - citadel/control.c
* Close the fd to our control file.
[citadel.git] / citadel / control.c
index 0c9dd11b13b8f815fe2b1932d7168712cd5df526..91731ce5e84a95916966122221550767b3aa35c4 100644 (file)
@@ -60,7 +60,7 @@ void lock_control(void)
        if (flock(fileno(control_fp), (LOCK_EX | LOCK_NB))) {
                lprintf(CTDL_EMERG, "citserver: unable to lock %s.\n", file_citadel_control);
                lprintf(CTDL_EMERG, "Is another citserver already running?\n");
-               exit(1);
+               exit(CTDLEXIT_CONTROL);
        }
 }
 
@@ -118,6 +118,15 @@ void put_control(void)
        }
 }
 
+/**
+ * release_control - close our fd on exit
+ */
+void release_control(void)
+{
+       if (control_fp != NULL)
+               fclose(control_fp);
+       control_fp = NULL;
+}
 
 /*
  * get_new_message_number()  -  Obtain a new, unique ID to be used for a message.
@@ -242,6 +251,11 @@ void cmd_conf(char *argbuf)
                cprintf("%s\n", config.c_default_cal_zone);
                cprintf("%d\n", config.c_pftcpdict_port);
                cprintf("%d\n", config.c_managesieve_port);
+               cprintf("%d\n", config.c_auth_mode);
+               cprintf("%s\n", config.c_funambol_host);
+               cprintf("%d\n", config.c_funambol_port);
+               cprintf("%s\n", config.c_funambol_source);
+               cprintf("%s\n", config.c_funambol_auth);
                cprintf("000\n");
        }
 
@@ -447,6 +461,25 @@ void cmd_conf(char *argbuf)
                        case 51:
                                config.c_managesieve_port = atoi(buf);
                                break;
+                       case 52:
+                               config.c_auth_mode = atoi(buf);
+                       case 53:
+                               safestrncpy(config.c_funambol_host, buf,
+                                       sizeof config.c_funambol_host);
+                               break;
+                       case 54:
+                               config.c_funambol_port = atoi(buf);
+                               break;
+                       case 55:
+                               safestrncpy(config.c_funambol_source,
+                                       buf, 
+                                       sizeof config.c_funambol_source);
+                               break;
+                       case 56:
+                               safestrncpy(config.c_funambol_auth,
+                                       buf,
+                                       sizeof config.c_funambol_auth);
+                               break;
                        }
                        ++a;
                }