#define END_OF_MESSAGE "---eom---dbd---"
-char artv_tempfilename1[256];
-char artv_tempfilename2[256];
+char artv_tempfilename1[PATH_MAX];
+char artv_tempfilename2[PATH_MAX];
FILE *artv_global_message_list;
void artv_export_users_backend(struct usersupp *usbuf, void *data) {
void artv_export_rooms(void) {
- char cmd[256];
+ char cmd[SIZ];
artv_global_message_list = fopen(artv_tempfilename1, "w");
ForEachRoom(artv_export_rooms_backend, NULL);
fclose(artv_global_message_list);
struct visit vbuf;
struct cdbdata *cdbv;
+ cdb_begin_transaction();
cdb_rewind(CDB_VISIT);
while (cdbv = cdb_next_item(CDB_VISIT), cdbv != NULL) {
cprintf("%ld\n", vbuf.v_lastseen);
cprintf("%u\n", vbuf.v_flags);
}
+ cdb_end_transaction();
}
struct CtdlMessage *msg;
struct ser_ret smr;
FILE *fp;
- char buf[256];
- char tempfile[256];
+ char buf[SIZ];
+ char tempfile[SIZ];
msg = CtdlFetchMessage(msgnum);
if (msg == NULL) return; /* fail silently */
void artv_export_messages(void) {
- char buf[256];
+ char buf[SIZ];
long msgnum;
int count = 0;
void artv_import_config(void) {
- char buf[256];
+ char buf[SIZ];
lprintf(9, "Importing config file\n");
client_gets(config.c_nodename);
void artv_import_control(void) {
- char buf[256];
+ char buf[SIZ];
lprintf(9, "Importing control file\n");
client_gets(buf); CitControl.MMhighest = atol(buf);
void artv_import_user(void) {
- char buf[256];
+ char buf[SIZ];
struct usersupp usbuf;
client_gets(buf); usbuf.version = atoi(buf);
void artv_import_room(void) {
- char buf[256];
+ char buf[SIZ];
struct quickroom qrbuf;
long msgnum;
int msgcount = 0;
void artv_import_floor(void) {
struct floor flbuf;
int i;
- char buf[256];
+ char buf[SIZ];
client_gets(buf); i = atoi(buf);
client_gets(buf); flbuf.f_flags = atoi(buf);
*/
void artv_import_visit(void) {
struct visit vbuf;
- char buf[256];
+ char buf[SIZ];
client_gets(buf); vbuf.v_roomnum = atol(buf);
client_gets(buf); vbuf.v_roomgen = atol(buf);
long msgnum;
int msglen;
FILE *fp;
- char buf[256];
- char tempfile[256];
+ char buf[SIZ];
+ char tempfile[SIZ];
char *mbuf;
memset(&smi, 0, sizeof(struct SuppMsgInfo));
void artv_do_import(void) {
- char buf[256];
- char s_version[256];
+ char buf[SIZ];
+ char s_version[SIZ];
int version;
cprintf("%d sock it to me\n", SEND_LISTING);
else if (!strcasecmp(buf, "message")) artv_import_message();
else break;
- /* Yes, this is correct: end *then* begin. Since we're in a
- * session command loop, there's already a transaction in
- * progress. We want to end it and then begin a new one at the
- * end of every object import, otherwise the entire import
- * logs as a single transaction. Not only would that be a bad
- * idea, but it'll actually crash the db when importing very
- * large files.
- */
- cdb_end_transaction();
- cdb_begin_transaction();
-
}
lprintf(7, "Invalid keyword <%s>. Flushing input.\n", buf);
while (client_gets(buf), strcmp(buf, "000")) ;;
void cmd_artv(char *cmdbuf) {
- char cmd[256];
+ char cmd[SIZ];
static int is_running = 0;
if (CtdlAccessCheck(ac_aide)) return; /* FIXME should be intpgm */