* Reordered the wiki rev code
[citadel.git] / citadel / modules / wiki / serv_wiki.c
1 /*
2  * $Id$
3  *
4  * Server-side module for Wiki rooms.  This handles things like version control. 
5  * 
6  * Copyright (c) 2009 by the citadel.org team
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 3 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "sysdep.h"
24 #include <stdlib.h>
25 #include <unistd.h>
26 #include <stdio.h>
27 #include <fcntl.h>
28 #include <signal.h>
29 #include <pwd.h>
30 #include <errno.h>
31 #include <ctype.h>
32 #include <sys/types.h>
33
34 #if TIME_WITH_SYS_TIME
35 # include <sys/time.h>
36 # include <time.h>
37 #else
38 # if HAVE_SYS_TIME_H
39 #  include <sys/time.h>
40 # else
41 #  include <time.h>
42 # endif
43 #endif
44
45 #include <sys/wait.h>
46 #include <string.h>
47 #include <limits.h>
48 #include <libcitadel.h>
49 #include "citadel.h"
50 #include "server.h"
51 #include "citserver.h"
52 #include "support.h"
53 #include "config.h"
54 #include "control.h"
55 #include "user_ops.h"
56 #include "policy.h"
57 #include "database.h"
58 #include "msgbase.h"
59 #include "euidindex.h"
60 #include "ctdl_module.h"
61
62 /*
63  * Data passed back and forth between wiki_rev() and its MIME parser callback
64  */
65 struct HistoryEraserCallBackData {
66         char *tempfilename;             /* name of temp file being patched */
67         char *stop_when;                /* stop when we hit this uuid */
68         int done;                       /* set to nonzero when we're done patching */
69 };
70
71 /*
72  * Name of the temporary room we create to store old revisions when someone requests them.
73  * We put it in an invalid namespace so the DAP cleans up after us later.
74  */
75 char *wwm = "9999999999.WikiWaybackMachine";
76
77 /*
78  * Before allowing a wiki page save to execute, we have to perform version control.
79  * This involves fetching the old version of the page if it exists.
80  */
81 int wiki_upload_beforesave(struct CtdlMessage *msg) {
82         struct CitContext *CCC = CC;
83         long old_msgnum = (-1L);
84         struct CtdlMessage *old_msg = NULL;
85         long history_msgnum = (-1L);
86         struct CtdlMessage *history_msg = NULL;
87         char diff_old_filename[PATH_MAX];
88         char diff_new_filename[PATH_MAX];
89         char diff_cmd[PATH_MAX];
90         FILE *fp;
91         int rv;
92         char history_page[1024];
93         char boundary[256];
94         char prefixed_boundary[258];
95         char buf[1024];
96         int nbytes = 0;
97         char *diffbuf = NULL;
98         size_t diffbuf_len = 0;
99         char *ptr = NULL;
100
101         if (!CCC->logged_in) return(0); /* Only do this if logged in. */
102
103         /* Is this a room with a Wiki in it, don't run this hook. */
104         if (CCC->room.QRdefaultview != VIEW_WIKI) {
105                 return(0);
106         }
107
108         /* If this isn't a MIME message, don't bother. */
109         if (msg->cm_format_type != 4) return(0);
110
111         /* If there's no EUID we can't do this. */
112         if (msg->cm_fields['E'] == NULL) return(0);
113         snprintf(history_page, sizeof history_page, "%s_HISTORY_", msg->cm_fields['E']);
114
115         /* Make sure we're saving a real wiki page rather than a wiki history page.
116          * This is important in order to avoid recursing infinitely into this hook.
117          */
118         if (    (strlen(msg->cm_fields['E']) >= 9)
119                 && (!strcasecmp(&msg->cm_fields['E'][strlen(msg->cm_fields['E'])-9], "_HISTORY_"))
120         ) {
121                 CtdlLogPrintf(CTDL_DEBUG, "History page not being historied\n");
122                 return(0);
123         }
124
125         /* If there's no message text, obviously this is all b0rken and shouldn't happen at all */
126         if (msg->cm_fields['M'] == NULL) return(0);
127
128         /* See if we can retrieve the previous version. */
129         old_msgnum = locate_message_by_euid(msg->cm_fields['E'], &CCC->room);
130         if (old_msgnum > 0L) {
131                 old_msg = CtdlFetchMessage(old_msgnum, 1);
132         }
133         else {
134                 old_msg = NULL;
135         }
136
137         if ((old_msg != NULL) && (old_msg->cm_fields['M'] == NULL)) {   /* old version is corrupt? */
138                 CtdlFreeMessage(old_msg);
139                 old_msg = NULL;
140         }
141         
142         /* If no changes were made, don't bother saving it again */
143         if ((old_msg != NULL) && (!strcmp(msg->cm_fields['M'], old_msg->cm_fields['M']))) {
144                 CtdlFreeMessage(old_msg);
145                 return(1);
146         }
147
148         /*
149          * Generate diffs
150          */
151         CtdlMakeTempFileName(diff_old_filename, sizeof diff_old_filename);
152         CtdlMakeTempFileName(diff_new_filename, sizeof diff_new_filename);
153
154         if (old_msg != NULL) {
155                 fp = fopen(diff_old_filename, "w");
156                 rv = fwrite(old_msg->cm_fields['M'], strlen(old_msg->cm_fields['M']), 1, fp);
157                 fclose(fp);
158                 CtdlFreeMessage(old_msg);
159         }
160
161         fp = fopen(diff_new_filename, "w");
162         rv = fwrite(msg->cm_fields['M'], strlen(msg->cm_fields['M']), 1, fp);
163         fclose(fp);
164
165         diffbuf_len = 0;
166         diffbuf = NULL;
167         snprintf(diff_cmd, sizeof diff_cmd,
168                 "diff -u %s %s",
169                 diff_new_filename,
170                 ((old_msg != NULL) ? diff_old_filename : "/dev/null")
171         );
172         fp = popen(diff_cmd, "r");
173         if (fp != NULL) {
174                 do {
175                         diffbuf = realloc(diffbuf, diffbuf_len + 1025);
176                         nbytes = fread(&diffbuf[diffbuf_len], 1, 1024, fp);
177                         diffbuf_len += nbytes;
178                 } while (nbytes == 1024);
179                 diffbuf[diffbuf_len] = 0;
180                 pclose(fp);
181         }
182         CtdlLogPrintf(CTDL_DEBUG, "diff length is %d bytes\n", diffbuf_len);
183
184         unlink(diff_old_filename);
185         unlink(diff_new_filename);
186
187         /* Determine whether this was a bogus (empty) edit */
188         if ((diffbuf_len = 0) && (diffbuf != NULL)) {
189                 free(diffbuf);
190                 diffbuf = NULL;
191         }
192         if (diffbuf == NULL) {
193                 return(1);              /* No changes at all?  Abandon the post entirely! */
194         }
195
196         /* Now look for the existing edit history */
197
198         history_msgnum = locate_message_by_euid(history_page, &CCC->room);
199         history_msg = NULL;
200         if (history_msgnum > 0L) {
201                 history_msg = CtdlFetchMessage(history_msgnum, 1);
202         }
203
204         /* Create a new history message if necessary */
205         if (history_msg == NULL) {
206                 history_msg = malloc(sizeof(struct CtdlMessage));
207                 memset(history_msg, 0, sizeof(struct CtdlMessage));
208                 history_msg->cm_magic = CTDLMESSAGE_MAGIC;
209                 history_msg->cm_anon_type = MES_NORMAL;
210                 history_msg->cm_format_type = FMT_RFC822;
211                 history_msg->cm_fields['A'] = strdup("Citadel");
212                 history_msg->cm_fields['R'] = strdup(CCC->room.QRname);
213                 history_msg->cm_fields['E'] = strdup(history_page);
214                 history_msg->cm_fields['U'] = strdup(history_page);
215                 snprintf(boundary, sizeof boundary, "Citadel--Multipart--%04x--%08lx", getpid(), time(NULL));
216                 history_msg->cm_fields['M'] = malloc(1024);
217                 snprintf(history_msg->cm_fields['M'], 1024,
218                         "Content-type: multipart/mixed; boundary=\"%s\"\n\n"
219                         "This is a Citadel wiki history encoded as multipart MIME.\n"
220                         "Each part is comprised of a diff script representing one change set.\n"
221                         "\n"
222                         "--%s--\n"
223                         ,
224                         boundary, boundary
225                 );
226         }
227
228         /* Update the history message (regardless of whether it's new or existing) */
229
230         /* First, figure out the boundary string.  We do this even when we generated the
231          * boundary string in the above code, just to be safe and consistent.
232          */
233         strcpy(boundary, "");
234
235         ptr = history_msg->cm_fields['M'];
236         do {
237                 ptr = memreadline(ptr, buf, sizeof buf);
238                 if (*ptr != 0) {
239                         striplt(buf);
240                         if (!IsEmptyStr(buf) && (!strncasecmp(buf, "Content-type:", 13))) {
241                                 if (
242                                         (bmstrcasestr(buf, "multipart") != NULL)
243                                         && (bmstrcasestr(buf, "boundary=") != NULL)
244                                 ) {
245                                         safestrncpy(boundary, bmstrcasestr(buf, "\""), sizeof boundary);
246                                         char *qu;
247                                         qu = strchr(boundary, '\"');
248                                         if (qu) {
249                                                 strcpy(boundary, ++qu);
250                                         }
251                                         qu = strchr(boundary, '\"');
252                                         if (qu) {
253                                                 *qu = 0;
254                                         }
255                                 }
256                         }
257                 }
258         } while ( (IsEmptyStr(boundary)) && (*ptr != 0) );
259
260         /* Now look for the first boundary.  That is where we need to insert our fun.
261          */
262         if (!IsEmptyStr(boundary)) {
263                 snprintf(prefixed_boundary, sizeof prefixed_boundary, "--%s", boundary);
264                 history_msg->cm_fields['M'] = realloc(history_msg->cm_fields['M'],
265                         strlen(history_msg->cm_fields['M']) + strlen(diffbuf) + 1024
266                 );
267                 ptr = bmstrcasestr(history_msg->cm_fields['M'], prefixed_boundary);
268                 if (ptr != NULL) {
269                         char *the_rest_of_it = strdup(ptr);
270                         char uuid[32];
271                         char memo[512];
272                         char encoded_memo[768];
273                         generate_uuid(uuid);
274                         snprintf(memo, sizeof memo, "%s|%ld|%s|%s", 
275                                 uuid,
276                                 time(NULL),
277                                 CCC->user.fullname,
278                                 config.c_nodename
279                                 /* no longer logging CCC->cs_inet_email */
280                         );
281                         CtdlEncodeBase64(encoded_memo, memo, strlen(memo), 0);
282                         sprintf(ptr, "--%s\n"
283                                         "Content-type: text/plain\n"
284                                         "Content-Disposition: inline; filename=\"%s\"\n"
285                                         "Content-Transfer-Encoding: 8bit\n"
286                                         "\n"
287                                         "%s\n"
288                                         "%s"
289                                         ,
290                                 boundary,
291                                 encoded_memo,
292                                 diffbuf,
293                                 the_rest_of_it
294                         );
295                         free(the_rest_of_it);
296                 }
297
298                 history_msg->cm_fields['T'] = realloc(history_msg->cm_fields['T'], 32);
299                 snprintf(history_msg->cm_fields['T'], 32, "%ld", time(NULL));
300         
301                 CtdlSubmitMsg(history_msg, NULL, "", 0);
302         }
303         else {
304                 CtdlLogPrintf(CTDL_ALERT, "Empty boundary string in history message.  No history!\n");
305         }
306
307         free(diffbuf);
308         free(history_msg);
309         return(0);
310 }
311
312
313 /*
314  * MIME Parser callback for wiki_history()
315  *
316  * The "filename" field will contain a memo field.  All we have to do is decode
317  * the base64 and output it.  The data is already in a delimited format suitable
318  * for our client protocol.
319  */
320 void wiki_history_callback(char *name, char *filename, char *partnum, char *disp,
321                    void *content, char *cbtype, char *cbcharset, size_t length,
322                    char *encoding, char *cbid, void *cbuserdata)
323 {
324         char memo[1024];
325
326         CtdlDecodeBase64(memo, filename, strlen(filename));
327         cprintf("%s\n", memo);
328 }
329
330
331 /*
332  * Fetch a list of revisions for a particular wiki page
333  */
334 void wiki_history(char *pagename) {
335         int r;
336         char history_page_name[270];
337         long msgnum;
338         struct CtdlMessage *msg;
339
340         r = CtdlDoIHavePermissionToReadMessagesInThisRoom();
341         if (r != om_ok) {
342                 if (r == om_not_logged_in) {
343                         cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
344                 }
345                 else {
346                         cprintf("%d An unknown error has occurred.\n", ERROR);
347                 }
348                 return;
349         }
350
351         snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
352         msgnum = locate_message_by_euid(history_page_name, &CC->room);
353         if (msgnum > 0L) {
354                 msg = CtdlFetchMessage(msgnum, 1);
355         }
356         else {
357                 msg = NULL;
358         }
359
360         if ((msg != NULL) && (msg->cm_fields['M'] == NULL)) {
361                 CtdlFreeMessage(msg);
362                 msg = NULL;
363         }
364
365         if (msg == NULL) {
366                 cprintf("%d Revision history for '%s' was not found.\n", ERROR+MESSAGE_NOT_FOUND, pagename);
367                 return;
368         }
369
370         
371         cprintf("%d Revision history for '%s'\n", LISTING_FOLLOWS, pagename);
372         mime_parser(msg->cm_fields['M'], NULL, *wiki_history_callback, NULL, NULL, NULL, 0);
373         cprintf("000\n");
374
375         CtdlFreeMessage(msg);
376         return;
377 }
378
379 /*
380  * MIME Parser callback for wiki_rev()
381  *
382  * The "filename" field will contain a memo field, which includes (among other things)
383  * the uuid of this revision.  After we hit the desired revision, we stop processing.
384  *
385  * The "content" filed will contain "diff" output suitable for applying via "patch"
386  * to our temporary file.
387  */
388 void wiki_rev_callback(char *name, char *filename, char *partnum, char *disp,
389                    void *content, char *cbtype, char *cbcharset, size_t length,
390                    char *encoding, char *cbid, void *cbuserdata)
391 {
392         struct HistoryEraserCallBackData *hecbd = (struct HistoryEraserCallBackData *)cbuserdata;
393         char memo[1024];
394         char this_rev[256];
395         FILE *fp;
396         char *ptr = NULL;
397         char buf[1024];
398
399         /* Did a previous callback already indicate that we've reached our target uuid?
400          * If so, don't process anything else.
401          */
402         if (hecbd->done) {
403                 return;
404         }
405
406         CtdlDecodeBase64(memo, filename, strlen(filename));
407         extract_token(this_rev, memo, 0, '|', sizeof this_rev);
408         CtdlLogPrintf(CTDL_DEBUG, "callback found rev: %s\n", this_rev);
409
410         /* Perform the patch */
411         fp = popen("patch -f -s -p0 >/dev/null 2>/dev/null", "w");
412         if (fp) {
413                 /* Replace the filenames in the patch with the tempfilename we're actually tweaking */
414                 fprintf(fp, "--- %s\n", hecbd->tempfilename);
415                 fprintf(fp, "+++ %s\n", hecbd->tempfilename);
416
417                 ptr = (char *)content;
418                 int linenum = 0;
419                 do {
420                         ++linenum;
421                         ptr = memreadline(ptr, buf, sizeof buf);
422                         if (*ptr != 0) {
423                                 if (linenum <= 2) {
424                                         /* skip the first two lines; they contain bogus filenames */
425                                 }
426                                 else {
427                                         fprintf(fp, "%s\n", buf);
428                                 }
429                         }
430                 } while ((*ptr != 0) && ((int)ptr < ((int)content + length)));
431                 pclose(fp);
432         }
433
434         if (!strcasecmp(this_rev, hecbd->stop_when)) {
435                 /* Found our target rev.  Tell any subsequent callbacks to suppress processing. */
436                 CtdlLogPrintf(CTDL_DEBUG, "Target revision has been reached -- stop patching.\n");
437                 hecbd->done = 1;
438         }
439 }
440
441
442 /*
443  * Fetch a specific revision of a wiki page.  The "operation" string may be set to "fetch" in order
444  * to simply fetch the desired revision and store it in a temporary location for viewing, or "revert"
445  * to revert the currently active page to that revision.
446  */
447 void wiki_rev(char *pagename, char *rev, char *operation)
448 {
449         int r;
450         char history_page_name[270];
451         long msgnum;
452         char temp[PATH_MAX];
453         char timestamp[64];
454         struct CtdlMessage *msg;
455         FILE *fp;
456         struct HistoryEraserCallBackData hecbd;
457         long len = 0L;
458         int rv;
459
460         r = CtdlDoIHavePermissionToReadMessagesInThisRoom();
461         if (r != om_ok) {
462                 if (r == om_not_logged_in) {
463                         cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
464                 }
465                 else {
466                         cprintf("%d An unknown error has occurred.\n", ERROR);
467                 }
468                 return;
469         }
470
471         /* Begin by fetching the current version of the page.  We're going to patch
472          * backwards through the diffs until we get the one we want.
473          */
474         msgnum = locate_message_by_euid(pagename, &CC->room);
475         if (msgnum > 0L) {
476                 msg = CtdlFetchMessage(msgnum, 1);
477         }
478         else {
479                 msg = NULL;
480         }
481
482         if ((msg != NULL) && (msg->cm_fields['M'] == NULL)) {
483                 CtdlFreeMessage(msg);
484                 msg = NULL;
485         }
486
487         if (msg == NULL) {
488                 cprintf("%d Page '%s' was not found.\n", ERROR+MESSAGE_NOT_FOUND, pagename);
489                 return;
490         }
491
492         /* Output it to a temporary file */
493
494         CtdlMakeTempFileName(temp, sizeof temp);
495         fp = fopen(temp, "w");
496         if (fp != NULL) {
497                 r = fwrite(msg->cm_fields['M'], strlen(msg->cm_fields['M']), 1, fp);
498                 fclose(fp);
499         }
500         else {
501                 CtdlLogPrintf(CTDL_ALERT, "Cannot open %s: %s\n", temp, strerror(errno));
502         }
503         CtdlFreeMessage(msg);
504
505         /* Get the revision history */
506
507         snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
508         msgnum = locate_message_by_euid(history_page_name, &CC->room);
509         if (msgnum > 0L) {
510                 msg = CtdlFetchMessage(msgnum, 1);
511         }
512         else {
513                 msg = NULL;
514         }
515
516         if ((msg != NULL) && (msg->cm_fields['M'] == NULL)) {
517                 CtdlFreeMessage(msg);
518                 msg = NULL;
519         }
520
521         if (msg == NULL) {
522                 cprintf("%d Revision history for '%s' was not found.\n", ERROR+MESSAGE_NOT_FOUND, pagename);
523                 return;
524         }
525
526         /* Start patching backwards (newest to oldest) through the revision history until we
527          * hit the revision uuid requested by the user.  (The callback will perform each one.)
528          */
529
530         memset(&hecbd, 0, sizeof(struct HistoryEraserCallBackData));
531         hecbd.tempfilename = temp;
532         hecbd.stop_when = rev;
533
534         mime_parser(msg->cm_fields['M'], NULL, *wiki_rev_callback, NULL, NULL, (void *)&hecbd, 0);
535         CtdlFreeMessage(msg);
536
537         /* Were we successful? */
538         if (hecbd.done == 0) {
539                 cprintf("%d Revision '%s' of page '%s' was not found.\n",
540                         ERROR + MESSAGE_NOT_FOUND, rev, pagename
541                 );
542         }
543
544         /* We have the desired revision on disk.  Now do something with it. */
545
546         else if ( (!strcasecmp(operation, "fetch")) || (!strcasecmp(operation, "revert")) ) {
547                 msg = malloc(sizeof(struct CtdlMessage));
548                 memset(msg, 0, sizeof(struct CtdlMessage));
549                 msg->cm_magic = CTDLMESSAGE_MAGIC;
550                 msg->cm_anon_type = MES_NORMAL;
551                 msg->cm_format_type = FMT_RFC822;
552                 fp = fopen(temp, "r");
553                 if (fp) {
554                         fseek(fp, 0L, SEEK_END);
555                         len = ftell(fp);
556                         fseek(fp, 0L, SEEK_SET);
557                         msg->cm_fields['M'] = malloc(len + 1);
558                         rv = fread(msg->cm_fields['M'], len, 1, fp);
559                         CtdlLogPrintf(CTDL_DEBUG, "\033[32mdid %d blocks of %d bytes\033[0m\n", rv, len);
560                         msg->cm_fields['M'][len] = 0;
561                         fclose(fp);
562                 }
563                 if (len <= 0) {
564                         msgnum = (-1L);
565                 }
566                 else if (!strcasecmp(operation, "fetch")) {
567                         msg->cm_fields['A'] = strdup("Citadel");
568                         CtdlCreateRoom(wwm, 5, "", 0, 1, 1, VIEW_BBS);  /* Not an error if already exists */
569                         msgnum = CtdlSubmitMsg(msg, NULL, wwm, 0);      /* Store the revision here */
570                 }
571                 else if (!strcasecmp(operation, "revert")) {
572                         snprintf(timestamp, sizeof timestamp, "%ld", time(NULL));
573                         msg->cm_fields['T'] = strdup(timestamp);
574                         msg->cm_fields['A'] = strdup(CC->user.fullname);
575                         msg->cm_fields['F'] = strdup(CC->cs_inet_email);
576                         msg->cm_fields['O'] = strdup(CC->room.QRname);
577                         msg->cm_fields['N'] = strdup(NODENAME);
578                         msg->cm_fields['E'] = strdup(pagename);
579                         msgnum = CtdlSubmitMsg(msg, NULL, "", 0);       /* Replace the current revision */
580                 }
581                 else {
582                         /* Theoretically it is impossible to get here, but throw an error anyway */
583                         msgnum = (-1L);
584                 }
585                 CtdlFreeMessage(msg);
586                 if (msgnum >= 0L) {
587                         cprintf("%d %ld\n", CIT_OK, msgnum);            /* Give the client a msgnum */
588                 }
589                 else {
590                         cprintf("%d Error %ld has occurred.\n", ERROR+INTERNAL_ERROR, msgnum);
591                 }
592         }
593
594         /* We did all this work for nothing.  Express anguish to the caller. */
595         else {
596                 cprintf("%d An unknown operation was requested.\n", ERROR+CMD_NOT_SUPPORTED);
597         }
598
599         unlink(temp);
600         return;
601 }
602
603
604
605 /*
606  * commands related to wiki management
607  */
608 void cmd_wiki(char *argbuf) {
609         char subcmd[32];
610         char pagename[256];
611         char rev[128];
612         char operation[16];
613
614         extract_token(subcmd, argbuf, 0, '|', sizeof subcmd);
615
616         if (!strcasecmp(subcmd, "history")) {
617                 extract_token(pagename, argbuf, 1, '|', sizeof pagename);
618                 wiki_history(pagename);
619                 return;
620         }
621
622         if (!strcasecmp(subcmd, "rev")) {
623                 extract_token(pagename, argbuf, 1, '|', sizeof pagename);
624                 extract_token(rev, argbuf, 2, '|', sizeof rev);
625                 extract_token(operation, argbuf, 3, '|', sizeof operation);
626                 wiki_rev(pagename, rev, operation);
627                 return;
628         }
629
630         cprintf("%d Invalid subcommand\n", ERROR + CMD_NOT_SUPPORTED);
631 }
632
633
634
635 /*
636  * Module initialization
637  */
638 CTDL_MODULE_INIT(wiki)
639 {
640         if (!threading)
641         {
642                 CtdlRegisterMessageHook(wiki_upload_beforesave, EVT_BEFORESAVE);
643                 CtdlRegisterProtoHook(cmd_wiki, "WIKI", "Commands related to Wiki management");
644         }
645
646         /* return our Subversion id for the Log */
647         return "$Id$";
648 }