check_ref_counts();
lprintf(CTDL_INFO, "Creating base rooms (if necessary)\n");
- create_room(BASEROOM, 0, "", 0, 1, 0);
- create_room(AIDEROOM, 3, "", 0, 1, 0);
- create_room(SYSCONFIGROOM, 3, "", 0, 1, 0);
- create_room(config.c_twitroom, 0, "", 0, 1, 0);
+ create_room(BASEROOM, 0, "", 0, 1, 0, VIEW_BBS);
+ create_room(AIDEROOM, 3, "", 0, 1, 0, VIEW_BBS);
+ create_room(SYSCONFIGROOM, 3, "", 0, 1, 0, VIEW_BBS);
+ create_room(config.c_twitroom, 0, "", 0, 1, 0, VIEW_BBS);
/* The "Local System Configuration" room doesn't need to be visible */
if (lgetroom(&qrbuf, SYSCONFIGROOM) == 0) {
void cmd_time(void)
{
time_t tv;
- struct tm *tmp;
+ struct tm tmp;
tv = time(NULL);
- tmp = localtime(&tv);
+ localtime_r(&tv, &tmp);
/* 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\n", CIT_OK, (long)tv, tmp.tm_gmtoff, tmp.tm_isdst);
#else
- cprintf("%d %ld|%ld|%d\n", CIT_OK, (long)tv, timezone, tmp->tm_isdst);
+ cprintf("%d %ld|%ld|%d\n", CIT_OK, (long)tv, timezone, tmp.tm_isdst);
#endif
}
char *dirs[2];
int a;
+ unbuffer_output();
+
if (CtdlAccessCheck(ac_aide)) return;
extract(buf,mname,0);
return(-1);
}
+ if ((required_level >= ac_logged_in) && (CC->logged_in == 0)) {
+ cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
+ return(-1);
+ }
+
if (CC->user.axlevel >= 6) return(0);
if (required_level >= ac_aide) {
cprintf("%d This command requires Aide access.\n",
return(-1);
}
- if (CC->logged_in) return(0);
- if (required_level >= ac_logged_in) {
- cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
- return(-1);
- }
-
/* shhh ... succeed quietly */
return(0);
}
*/
void begin_session(struct CitContext *con)
{
- int len; /* should be socklen_t but doesn't work on Macintosh */
+ int len;
struct sockaddr_in sin;
/*
len = sizeof sin;
if (!CC->is_local_socket) {
if (!getpeername(con->client_socket,
- (struct sockaddr *) &sin, &len))
+ (struct sockaddr *) &sin, &len)) /* should be socklen_t but doesn't work on Macintosh */
locate_host(con->cs_host, sizeof con->cs_host,
con->cs_addr, sizeof con->cs_addr,
&sin.sin_addr);
}
lprintf(CTDL_INFO, "Citadel: %s\n", cmdbuf);
+ buffer_output();
+
/*
* Let other clients see the last command we executed, and
* update the idle time, but not NOOP, QNOP, PEXP, or GEXP.
ERROR + CMD_NOT_SUPPORTED);
}
+ unbuffer_output();
+
/* Run any after-each-command routines registered by modules */
PerformSessionHooks(EVT_CMD);
}