fclose(fp);
snprintf(diff_cmd, sizeof diff_cmd,
- "diff -u %s %s >%s",
+ DIFF " -u %s %s >%s",
diff_new_filename,
((old_msg != NULL) ? diff_old_filename : "/dev/null"),
diff_out_filename
fclose(fp);
}
- syslog(LOG_DEBUG, "diff length is %d bytes", diffbuf_len);
+ syslog(LOG_DEBUG, "diff length is "SIZE_T_FMT" bytes", diffbuf_len);
unlink(diff_old_filename);
unlink(diff_new_filename);
syslog(LOG_DEBUG, "callback found rev: %s\n", this_rev);
/* Perform the patch */
- fp = popen("patch -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w");
+ fp = popen(PATCH " -f -s -p0 -r /dev/null >/dev/null 2>/dev/null", "w");
if (fp) {
/* Replace the filenames in the patch with the tempfilename we're actually tweaking */
fprintf(fp, "--- %s\n", hecbd->tempfilename);
msg->cm_fields['A'] = strdup("Citadel");
CtdlCreateRoom(wwm, 5, "", 0, 1, 1, VIEW_BBS); /* Not an error if already exists */
msgnum = CtdlSubmitMsg(msg, NULL, wwm, 0); /* Store the revision here */
+
+ /*
+ * WARNING: VILE SLEAZY HACK
+ * This will avoid the 'message xxx is not in this room' security error,
+ * but only if the client fetches the message we just generated immediately
+ * without first trying to perform other fetch operations.
+ */
+ if (CC->cached_msglist != NULL) {
+ free(CC->cached_msglist);
+ CC->cached_msglist = NULL;
+ CC->cached_num_msgs = 0;
+ }
+ CC->cached_msglist = malloc(sizeof(long));
+ if (CC->cached_msglist != NULL) {
+ CC->cached_num_msgs = 1;
+ CC->cached_msglist[0] = msgnum;
+ }
+
}
else if (!strcasecmp(operation, "revert")) {
snprintf(timestamp, sizeof timestamp, "%ld", time(NULL));
CtdlRegisterProtoHook(cmd_wiki, "WIKI", "Commands related to Wiki management");
}
- /* return our Subversion id for the Log */
+ /* return our module name for the log */
return "wiki";
}