]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / citserver.c
index 088b584e1107a751cc5b935f4e08c8c858ea5f58..d91b976b059bc003bc3a4bd2cc06dde4fc0602b0 100644 (file)
@@ -4,18 +4,12 @@
  * Copyright (c) 1987-2011 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License, version 3.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "sysdep.h"
 #include "euidindex.h"
 #include "context.h"
 #include "svn_revision.h"
-
-#ifndef HAVE_SNPRINTF
-#include "snprintf.h"
-#endif
-
 #include "ctdl_module.h"
 
 char *unique_session_numbers;
@@ -222,7 +211,7 @@ void master_cleanup(int exitcode) {
        struct CleanupFunctionHook *fcn;
        static int already_cleaning_up = 0;
 
-       if (already_cleaning_up) while(1) usleep(1000);
+       if (already_cleaning_up) while(1) usleep(1000000);
        already_cleaning_up = 1;
 
        /* Run any cleanup routines registered by loadable modules */
@@ -290,7 +279,9 @@ void cmd_info(char *cmdbuf) {
        cprintf("0\n"); /* 1 = no, this server is not LDAP-enabled */
 #endif
 
-       if (config.c_auth_mode == AUTHMODE_NATIVE) {
+       if ((config.c_auth_mode == AUTHMODE_NATIVE) &&
+           (config.c_disable_newu == 0))
+       {
                cprintf("%d\n", config.c_disable_newu);
        }
        else {
@@ -431,7 +422,7 @@ int is_public_client(void)
                                        }
                                }
                        }
-               fclose(fp);
+               if (fp != NULL) fclose(fp);
                pc_timestamp = time(NULL);
                end_critical_section(S_PUBLIC_CLIENTS);
        }
@@ -690,14 +681,14 @@ int CtdlAccessCheck(int required_level) {
 
        if (CC->user.axlevel >= AxAideU) return(0);
        if (required_level >= ac_aide) {
-               cprintf("%d This command requires Aide access.\n",
+               cprintf("%d This command requires Admin access.\n",
                        ERROR + HIGHER_ACCESS_REQUIRED);
                return(-1);
        }
 
        if (is_room_aide()) return(0);
        if (required_level >= ac_room_aide) {
-               cprintf("%d This command requires Aide or Room Aide access.\n",
+               cprintf("%d This command requires Admin or Room Admin access.\n",
                        ERROR + HIGHER_ACCESS_REQUIRED);
                return(-1);
        }