X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcitserver.c;h=782f6a99b0c4acf112ef448c0afe25d2400f65d7;hb=39581b591a9b9a23a30d6401a489099079d10734;hp=ca442f9be85098020a9af2026877c252c30d33ee;hpb=52b507d64cf8251934212ac76866235582772642;p=citadel.git diff --git a/citadel/citserver.c b/citadel/citserver.c index ca442f9be..782f6a99b 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -196,6 +196,9 @@ void master_startup(void) { urandom = fopen("/dev/urandom", "r"); if (urandom != NULL) { rv = fread(&seed, sizeof seed, 1, urandom); + if (rv == -1) + syslog(LOG_EMERG, "failed to read random seed: %s\n", + strerror(errno)); fclose(urandom); } else { @@ -343,9 +346,9 @@ void cmd_time(char *argbuf) /* timezone and daylight global variables are not portable. */ #ifdef HAVE_STRUCT_TM_TM_GMTOFF - cprintf("%d %ld|%ld|%d\n", CIT_OK, (long)tv, tmp.tm_gmtoff, tmp.tm_isdst); + cprintf("%d %ld|%ld|%d|%ld\n", CIT_OK, (long)tv, tmp.tm_gmtoff, tmp.tm_isdst, server_startup_time); #else - cprintf("%d %ld|%ld|%d\n", CIT_OK, (long)tv, timezone, tmp.tm_isdst); + cprintf("%d %ld|%ld|%d|%ld\n", CIT_OK, (long)tv, timezone, tmp.tm_isdst, server_startup_time); #endif } @@ -440,7 +443,7 @@ int is_public_client(void) for (i=0; ics_addr, addrbuf)) { - syslog(LOG_DEBUG, "... yes it is.\n"); + syslog(LOG_DEBUG, "... yes its local.\n"); return(1); } } @@ -652,7 +655,7 @@ void GenerateRoomDisplay(char *real_room, if (viewed->room.QRflags & QR_PRIVATE) { CtdlRoomAccess(&viewed->room, &viewer->user, &ra, NULL); if ( (ra & UA_KNOWN) == 0) { - strcpy(real_room, ""); + strcpy(real_room, " "); } } @@ -887,9 +890,6 @@ void cmd_asyn(char *argbuf) */ void begin_session(CitContext *con) { - socklen_t len; - struct sockaddr_in sin; - /* * Initialize some variables specific to our context. */ @@ -914,7 +914,6 @@ void begin_session(CitContext *con) safestrncpy(con->cs_addr, "", sizeof con->cs_addr); con->cs_UDSclientUID = -1; con->cs_host[sizeof con->cs_host - 1] = 0; - len = sizeof sin; if (!CC->is_local_socket) { locate_host(con->cs_host, sizeof con->cs_host, con->cs_addr, sizeof con->cs_addr, @@ -994,6 +993,12 @@ void citproto_begin_session() { } +void citproto_begin_admin_session() { + CC->internal_pgm = 1; + cprintf("%d %s Citadel server ADMIN CONNECTION ready.\n", CIT_OK, config.c_nodename); +} + + void cmd_noop(char *argbuf) { cprintf("%d%cok\n", CIT_OK, CtdlCheckExpress() );