2 * This module handles states which are global to the entire server.
4 * Copyright (c) 1987-2019 by the citadel.org team
6 * This program is open source software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
17 #include <libcitadel.h>
19 #include "ctdl_module.h"
21 #include "citserver.h"
24 long control_highest_user = 0;
27 * This is the legacy "control record" format for the message base. If found
28 * on disk, its contents will be migrated into the system configuration. Never
31 struct legacy_ctrl_format {
32 long MMhighest; /* highest message number in file */
33 unsigned MMflags; /* Global system flags */
34 long MMnextuser; /* highest user number on system */
35 long MMnextroom; /* highest room number on system */
36 int MM_hosted_upgrade_level; /* Server-hosted upgrade level */
37 int MM_fulltext_wordbreaker; /* ID of wordbreaker in use */
38 long MMfulltext; /* highest message number indexed */
39 int MMdbversion; /* Version of Berkeley DB used on previous server run */
44 * Callback to get highest room number when rebuilding message base metadata
46 * sanity_diag_mode (can be set by -s flag at startup) may be:
47 * 0 = attempt to fix inconsistencies
48 * 1 = show inconsistencies but don't repair them, exit after complete
49 * 2 = show inconsistencies but don't repair them, continue execution
51 void control_find_highest(struct ctdlroom *qrbuf, void *data)
54 struct cdbdata *cdbfr;
59 if (qrbuf->QRnumber > CtdlGetConfigLong("MMnextroom")) {
60 syslog(LOG_DEBUG, "control: fixing MMnextroom %ld > %ld , found in %s",
61 qrbuf->QRnumber, CtdlGetConfigLong("MMnextroom"), qrbuf->QRname
63 if (!sanity_diag_mode) {
64 CtdlSetConfigLong("MMnextroom", qrbuf->QRnumber);
68 CtdlGetRoom(&room, qrbuf->QRname);
70 /* Load the message list */
71 cdbfr = cdb_fetch(CDB_MSGLISTS, &room.QRnumber, sizeof(long));
73 msglist = (long *) cdbfr->ptr;
74 num_msgs = cdbfr->len / sizeof(long);
76 return; /* No messages at all? No further action. */
80 for (c=0; c<num_msgs; c++) {
81 if (msglist[c] > CtdlGetConfigLong("MMhighest")) {
82 syslog(LOG_DEBUG, "control: fixing MMhighest %ld > %ld , found in %s",
83 msglist[c], CtdlGetConfigLong("MMhighest"), qrbuf->QRname
85 if (!sanity_diag_mode) {
86 CtdlSetConfigLong("MMhighest", msglist[c]);
97 * Callback to get highest user number.
99 void control_find_user(char *username, void *out_data) {
100 struct ctdluser EachUser;
102 if (CtdlGetUser(&EachUser, username) != 0) {
106 if (EachUser.usernum > CtdlGetConfigLong("MMnextuser")) {
107 syslog(LOG_DEBUG, "control: fixing MMnextuser %ld > %ld , found in %s",
108 EachUser.usernum, CtdlGetConfigLong("MMnextuser"), EachUser.fullname
110 if (!sanity_diag_mode) {
111 CtdlSetConfigLong("MMnextuser", EachUser.usernum);
118 * If we have a legacy format control record on disk, import it.
120 void migrate_legacy_control_record(void)
123 struct legacy_ctrl_format c;
124 memset(&c, 0, sizeof(c));
126 fp = fopen(file_citadel_control, "rb+");
128 syslog(LOG_INFO, "control: legacy format record found -- importing to db");
129 fread(&c, sizeof(struct legacy_ctrl_format), 1, fp);
131 CtdlSetConfigLong( "MMhighest", c.MMhighest);
132 CtdlSetConfigInt( "MMflags", c.MMflags);
133 CtdlSetConfigLong( "MMnextuser", c.MMnextuser);
134 CtdlSetConfigLong( "MMnextroom", c.MMnextroom);
135 CtdlSetConfigInt( "MM_hosted_upgrade_level", c.MM_hosted_upgrade_level);
136 CtdlSetConfigInt( "MM_fulltext_wordbreaker", c.MM_fulltext_wordbreaker);
137 CtdlSetConfigLong( "MMfulltext", c.MMfulltext);
140 if (unlink(file_citadel_control) != 0) {
141 fprintf(stderr, "Unable to remove legacy control record %s after migrating it.\n", file_citadel_control);
142 fprintf(stderr, "Exiting to prevent data corruption.\n");
143 exit(CTDLEXIT_CONFIG);
150 * check_control - check the control record has sensible values for message, user and room numbers
152 void check_control(void)
154 syslog(LOG_INFO, "control: sanity checking the recorded highest message and room numbers");
155 CtdlForEachRoom(control_find_highest, NULL);
156 syslog(LOG_INFO, "control: sanity checking the recorded highest user number");
157 ForEachUser(control_find_user, NULL);
158 syslog(LOG_INFO, "control: sanity checks complete");
159 if (sanity_diag_mode == 1) {
160 syslog(LOG_INFO, "control: sanity check diagnostic mode is active - exiting now");
167 * get_new_message_number() - Obtain a new, unique ID to be used for a message.
169 long get_new_message_number(void)
172 begin_critical_section(S_CONTROL);
173 retval = CtdlGetConfigLong("MMhighest");
175 CtdlSetConfigLong("MMhighest", retval);
176 end_critical_section(S_CONTROL);
182 * CtdlGetCurrentMessageNumber() - Obtain the current highest message number in the system
183 * This provides a quick way to initialise a variable that might be used to indicate
184 * messages that should not be processed. EG. a new Sieve script will use this
185 * to record determine that messages older than this should not be processed.
187 * (Why is this function here? Can't we just go straight to the config variable it fetches?)
189 long CtdlGetCurrentMessageNumber(void)
191 return CtdlGetConfigLong("MMhighest");
196 * get_new_user_number() - Obtain a new, unique ID to be used for a user.
198 long get_new_user_number(void)
201 begin_critical_section(S_CONTROL);
202 retval = CtdlGetConfigLong("MMnextuser");
204 CtdlSetConfigLong("MMnextuser", retval);
205 end_critical_section(S_CONTROL);
211 * get_new_room_number() - Obtain a new, unique ID to be used for a room.
213 long get_new_room_number(void)
216 begin_critical_section(S_CONTROL);
217 retval = CtdlGetConfigLong("MMnextroom");
219 CtdlSetConfigLong("MMnextroom", retval);
220 end_critical_section(S_CONTROL);
226 * Helper function for cmd_conf() to handle boolean values
228 int confbool(char *v)
230 if (IsEmptyStr(v)) return(0);
231 if (atoi(v) != 0) return(1);
237 * Get or set global configuration options
239 * IF YOU ADD OR CHANGE FIELDS HERE, YOU *MUST* DOCUMENT YOUR CHANGES AT:
240 * http://www.citadel.org/doku.php/documentation:appproto:system_config
243 void cmd_conf(char *argbuf)
252 if (CtdlAccessCheck(ac_aide)) return;
254 extract_token(cmd, argbuf, 0, '|', sizeof cmd);
256 // CONF GET - retrieve system configuration in legacy format
257 // This is deprecated; please do not add fields or change their order.
258 if (!strcasecmp(cmd, "GET")) {
259 cprintf("%d Configuration...\n", LISTING_FOLLOWS);
260 cprintf("%s\n", CtdlGetConfigStr("c_nodename"));
261 cprintf("%s\n", CtdlGetConfigStr("c_fqdn"));
262 cprintf("%s\n", CtdlGetConfigStr("c_humannode"));
263 cprintf("xxx\n"); /* placeholder -- field no longer in use */
264 cprintf("%d\n", CtdlGetConfigInt("c_creataide"));
265 cprintf("%d\n", CtdlGetConfigInt("c_sleeping"));
266 cprintf("%d\n", CtdlGetConfigInt("c_initax"));
267 cprintf("%d\n", CtdlGetConfigInt("c_regiscall"));
268 cprintf("%d\n", CtdlGetConfigInt("c_twitdetect"));
269 cprintf("%s\n", CtdlGetConfigStr("c_twitroom"));
270 cprintf("%s\n", CtdlGetConfigStr("c_moreprompt"));
271 cprintf("%d\n", CtdlGetConfigInt("c_restrict"));
272 cprintf("%s\n", CtdlGetConfigStr("c_site_location"));
273 cprintf("%s\n", CtdlGetConfigStr("c_sysadm"));
274 cprintf("%d\n", CtdlGetConfigInt("c_maxsessions"));
275 cprintf("xxx\n"); /* placeholder -- field no longer in use */
276 cprintf("%d\n", CtdlGetConfigInt("c_userpurge"));
277 cprintf("%d\n", CtdlGetConfigInt("c_roompurge"));
278 cprintf("%s\n", CtdlGetConfigStr("c_logpages"));
279 cprintf("%d\n", CtdlGetConfigInt("c_createax"));
280 cprintf("%ld\n", CtdlGetConfigLong("c_maxmsglen"));
281 cprintf("%d\n", CtdlGetConfigInt("c_min_workers"));
282 cprintf("%d\n", CtdlGetConfigInt("c_max_workers"));
283 cprintf("%d\n", CtdlGetConfigInt("c_pop3_port"));
284 cprintf("%d\n", CtdlGetConfigInt("c_smtp_port"));
285 cprintf("%d\n", CtdlGetConfigInt("c_rfc822_strict_from"));
286 cprintf("%d\n", CtdlGetConfigInt("c_aide_zap"));
287 cprintf("%d\n", CtdlGetConfigInt("c_imap_port"));
288 cprintf("%ld\n", CtdlGetConfigLong("c_net_freq"));
289 cprintf("%d\n", CtdlGetConfigInt("c_disable_newu"));
290 cprintf("1\n"); /* niu */
291 cprintf("%d\n", CtdlGetConfigInt("c_purge_hour"));
293 cprintf("%s\n", CtdlGetConfigStr("c_ldap_host"));
294 cprintf("%d\n", CtdlGetConfigInt("c_ldap_port"));
295 cprintf("%s\n", CtdlGetConfigStr("c_ldap_base_dn"));
296 cprintf("%s\n", CtdlGetConfigStr("c_ldap_bind_dn"));
297 cprintf("%s\n", CtdlGetConfigStr("c_ldap_bind_pw"));
305 cprintf("%s\n", CtdlGetConfigStr("c_ip_addr"));
306 cprintf("%d\n", CtdlGetConfigInt("c_msa_port"));
307 cprintf("%d\n", CtdlGetConfigInt("c_imaps_port"));
308 cprintf("%d\n", CtdlGetConfigInt("c_pop3s_port"));
309 cprintf("%d\n", CtdlGetConfigInt("c_smtps_port"));
310 cprintf("%d\n", CtdlGetConfigInt("c_enable_fulltext"));
311 cprintf("%d\n", CtdlGetConfigInt("c_auto_cull"));
313 cprintf("%d\n", CtdlGetConfigInt("c_allow_spoofing"));
314 cprintf("%d\n", CtdlGetConfigInt("c_journal_email"));
315 cprintf("%d\n", CtdlGetConfigInt("c_journal_pubmsgs"));
316 cprintf("%s\n", CtdlGetConfigStr("c_journal_dest"));
317 cprintf("%s\n", CtdlGetConfigStr("c_default_cal_zone"));
318 cprintf("%d\n", CtdlGetConfigInt("c_pftcpdict_port"));
319 cprintf("%d\n", CtdlGetConfigInt("c_managesieve_port"));
320 cprintf("%d\n", CtdlGetConfigInt("c_auth_mode"));
325 cprintf("%d\n", CtdlGetConfigInt("c_rbl_at_greeting"));
328 cprintf("%s\n", CtdlGetConfigStr("c_pager_program"));
329 cprintf("%d\n", CtdlGetConfigInt("c_imap_keep_from"));
330 cprintf("%d\n", CtdlGetConfigInt("c_xmpp_c2s_port"));
331 cprintf("%d\n", CtdlGetConfigInt("c_xmpp_s2s_port"));
332 cprintf("%ld\n", CtdlGetConfigLong("c_pop3_fetch"));
333 cprintf("%ld\n", CtdlGetConfigLong("c_pop3_fastest"));
334 cprintf("%d\n", CtdlGetConfigInt("c_spam_flag_only"));
335 cprintf("%d\n", CtdlGetConfigInt("c_guest_logins"));
336 cprintf("%d\n", CtdlGetConfigInt("c_port_number"));
337 cprintf("%d\n", ctdluid);
338 cprintf("%d\n", CtdlGetConfigInt("c_nntp_port"));
339 cprintf("%d\n", CtdlGetConfigInt("c_nntps_port"));
343 // CONF SET - set system configuration in legacy format
344 // This is deprecated; please do not add fields or change their order.
345 else if (!strcasecmp(cmd, "SET")) {
347 cprintf("%d Send configuration...\n", SEND_LISTING);
349 while (client_getln(buf, sizeof buf) >= 0 && strcmp(buf, "000")) {
352 CtdlSetConfigStr("c_nodename", buf);
355 CtdlSetConfigStr("c_fqdn", buf);
358 CtdlSetConfigStr("c_humannode", buf);
361 /* placeholder -- field no longer in use */
364 CtdlSetConfigInt("c_creataide", confbool(buf));
367 CtdlSetConfigInt("c_sleeping", atoi(buf));
373 CtdlSetConfigInt("c_initax", i);
376 CtdlSetConfigInt("c_regiscall", confbool(buf));
379 CtdlSetConfigInt("c_twitdetect", confbool(buf));
382 CtdlSetConfigStr("c_twitroom", buf);
385 CtdlSetConfigStr("c_moreprompt", buf);
388 CtdlSetConfigInt("c_restrict", confbool(buf));
391 CtdlSetConfigStr("c_site_location", buf);
394 CtdlSetConfigStr("c_sysadm", buf);
399 CtdlSetConfigInt("c_maxsessions", i);
402 /* placeholder -- field no longer in use */
405 CtdlSetConfigInt("c_userpurge", atoi(buf));
408 CtdlSetConfigInt("c_roompurge", atoi(buf));
411 CtdlSetConfigStr("c_logpages", buf);
417 CtdlSetConfigInt("c_createax", i);
422 CtdlSetConfigLong("c_maxmsglen", ii);
427 if (i >= 3) { // minimum value
428 CtdlSetConfigInt("c_min_workers", i);
433 if (i >= CtdlGetConfigInt("c_min_workers")) { // max must be >= min
434 CtdlSetConfigInt("c_max_workers", i);
438 CtdlSetConfigInt("c_pop3_port", atoi(buf));
441 CtdlSetConfigInt("c_smtp_port", atoi(buf));
444 CtdlSetConfigInt("c_rfc822_strict_from", atoi(buf));
447 CtdlSetConfigInt("c_aide_zap", confbool(buf));
450 CtdlSetConfigInt("c_imap_port", atoi(buf));
453 CtdlSetConfigLong("c_net_freq", atol(buf));
456 CtdlSetConfigInt("c_disable_newu", confbool(buf));
463 if ((i >= 0) && (i <= 23)) {
464 CtdlSetConfigInt("c_purge_hour", i);
468 CtdlSetConfigStr("c_ldap_host", buf);
471 CtdlSetConfigInt("c_ldap_port", atoi(buf));
474 CtdlSetConfigStr("c_ldap_base_dn", buf);
477 CtdlSetConfigStr("c_ldap_bind_dn", buf);
480 CtdlSetConfigStr("c_ldap_bind_pw", buf);
483 CtdlSetConfigStr("c_ip_addr", buf);
486 CtdlSetConfigInt("c_msa_port", atoi(buf));
489 CtdlSetConfigInt("c_imaps_port", atoi(buf));
492 CtdlSetConfigInt("c_pop3s_port", atoi(buf));
495 CtdlSetConfigInt("c_smtps_port", atoi(buf));
498 CtdlSetConfigInt("c_enable_fulltext", confbool(buf));
501 CtdlSetConfigInt("c_auto_cull", confbool(buf));
507 CtdlSetConfigInt("c_allow_spoofing", confbool(buf));
510 CtdlSetConfigInt("c_journal_email", confbool(buf));
513 CtdlSetConfigInt("c_journal_pubmsgs", confbool(buf));
516 CtdlSetConfigStr("c_journal_dest", buf);
519 CtdlSetConfigStr("c_default_cal_zone", buf);
522 CtdlSetConfigInt("c_pftcpdict_port", atoi(buf));
525 CtdlSetConfigInt("c_managesieve_port", atoi(buf));
528 CtdlSetConfigInt("c_auth_mode", atoi(buf));
543 CtdlSetConfigInt("c_rbl_at_greeting", confbool(buf));
552 CtdlSetConfigStr("c_pager_program", buf);
555 CtdlSetConfigInt("c_imap_keep_from", confbool(buf));
558 CtdlSetConfigInt("c_xmpp_c2s_port", atoi(buf));
561 CtdlSetConfigInt("c_xmpp_s2s_port", atoi(buf));
564 CtdlSetConfigLong("c_pop3_fetch", atol(buf));
567 CtdlSetConfigLong("c_pop3_fastest", atol(buf));
570 CtdlSetConfigInt("c_spam_flag_only", confbool(buf));
573 CtdlSetConfigInt("c_guest_logins", confbool(buf));
576 CtdlSetConfigInt("c_port_number", atoi(buf));
582 CtdlSetConfigInt("c_nntp_port", atoi(buf));
585 CtdlSetConfigInt("c_nntps_port", atoi(buf));
590 snprintf(buf, sizeof buf,
591 "The global system configuration has been edited by %s.\n",
592 (CC->logged_in ? CC->curr_user : "an administrator")
594 CtdlAideMessage(buf, "Citadel Configuration Manager Message");
596 if (!IsEmptyStr(CtdlGetConfigStr("c_logpages")))
597 CtdlCreateRoom(CtdlGetConfigStr("c_logpages"), 3, "", 0, 1, 1, VIEW_BBS);
599 /* If full text indexing has been disabled, invalidate the
600 * index so it doesn't try to use it later.
602 if (CtdlGetConfigInt("c_enable_fulltext") == 0) {
603 CtdlSetConfigInt("MM_fulltext_wordbreaker", 0);
607 // CONF GETSYS - retrieve arbitrary system configuration stanzas stored in the message base
608 else if (!strcasecmp(cmd, "GETSYS")) {
609 extract_token(confname, argbuf, 1, '|', sizeof confname);
610 confptr = CtdlGetSysConfig(confname);
611 if (confptr != NULL) {
614 len = strlen(confptr);
615 cprintf("%d %s\n", LISTING_FOLLOWS, confname);
616 client_write(confptr, len);
617 if ((len > 0) && (confptr[len - 1] != 10))
618 client_write("\n", 1);
622 cprintf("%d No such configuration.\n",
623 ERROR + ILLEGAL_VALUE);
627 // CONF PUTSYS - store arbitrary system configuration stanzas in the message base
628 else if (!strcasecmp(cmd, "PUTSYS")) {
629 extract_token(confname, argbuf, 1, '|', sizeof confname);
631 cprintf("%d %s\n", SEND_LISTING, confname);
632 confptr = CtdlReadMessageBody(HKEY("000"), CtdlGetConfigLong("c_maxmsglen"), NULL, 0);
633 CtdlPutSysConfig(confname, confptr);
637 // CONF GETVAL - retrieve configuration variables from the database
638 // CONF LOADVAL - same thing but can handle variables bigger than 1 KB
639 else if ( (!strcasecmp(cmd, "GETVAL")) || (!strcasecmp(cmd, "LOADVAL")) ) {
640 extract_token(confname, argbuf, 1, '|', sizeof confname);
641 char *v = CtdlGetConfigStr(confname);
642 if ( (v) && (!strcasecmp(cmd, "GETVAL")) ) {
643 cprintf("%d %s|\n", CIT_OK, v);
645 else if ( (v) && (!strcasecmp(cmd, "LOADVAL")) ) {
646 cprintf("%d %d\n", BINARY_FOLLOWS, (int)strlen(v));
647 client_write(v, strlen(v));
650 cprintf("%d |\n", ERROR);
654 // CONF PUTVAL - store configuration variables in the database
655 else if (!strcasecmp(cmd, "PUTVAL")) {
656 if (num_tokens(argbuf, '|') < 3) {
657 cprintf("%d name and value required\n", ERROR);
660 extract_token(confname, argbuf, 1, '|', sizeof confname);
661 extract_token(buf, argbuf, 2, '|', sizeof buf);
662 CtdlSetConfigStr(confname, buf);
663 cprintf("%d setting '%s' to '%s'\n", CIT_OK, confname, buf);
667 // CONF STOREVAL - store configuration variables in the database bigger than 1 KB
668 else if (!strcasecmp(cmd, "STOREVAL")) {
669 if (num_tokens(argbuf, '|') < 3) {
670 cprintf("%d name and length required\n", ERROR);
673 extract_token(confname, argbuf, 1, '|', sizeof confname);
674 int bytes = extract_int(argbuf, 2);
675 char *valbuf = malloc(bytes + 1);
676 cprintf("%d %d\n", SEND_BINARY, bytes);
677 client_read(valbuf, bytes);
679 CtdlSetConfigStr(confname, valbuf);
684 // CONF LISTVAL - list configuration variables in the database and their values
685 else if (!strcasecmp(cmd, "LISTVAL")) {
686 struct cdbdata *cdbcfg;
691 cprintf("%d all configuration variables\n", LISTING_FOLLOWS);
692 cdb_rewind(CDB_CONFIG);
693 while (cdbcfg = cdb_next_item(CDB_CONFIG), cdbcfg != NULL) {
694 if (cdbcfg->len < 1020) {
695 keylen = strlen(cdbcfg->ptr);
697 value = cdbcfg->ptr + keylen + 1;
698 cprintf("%s|%s\n", key, value);
706 cprintf("%d Illegal option(s) specified.\n", ERROR + ILLEGAL_VALUE);
711 typedef struct __ConfType {
716 ConfType CfgNames[] = {
717 { {HKEY("localhost") }, 0},
718 { {HKEY("directory") }, 0},
719 { {HKEY("smarthost") }, 2},
720 { {HKEY("fallbackhost") }, 2},
721 { {HKEY("rbl") }, 3},
722 { {HKEY("spamassassin") }, 3},
723 { {HKEY("masqdomain") }, 1},
724 { {HKEY("clamav") }, 3},
725 { {HKEY("notify") }, 3},
729 HashList *CfgNameHash = NULL;
730 void cmd_gvdn(char *argbuf)
732 const ConfType *pCfg;
734 long min = atol(argbuf);
735 const char *Pos = NULL;
736 const char *PPos = NULL;
747 List = NewHash(1, NULL);
748 Cfg = NewStrBufPlain(CtdlGetConfigStr("c_fqdn"), -1);
749 Put(List, SKEY(Cfg), Cfg, HFreeStrBuf);
752 confptr = CtdlGetSysConfig(INTERNETCFG);
753 Config = NewStrBufPlain(confptr, -1);
756 Line = NewStrBufPlain(NULL, StrLength(Config));
757 CfgToken = NewStrBufPlain(NULL, StrLength(Config));
758 while (StrBufSipLine(Line, Config, &Pos))
761 Cfg = NewStrBufPlain(NULL, StrLength(Line));
763 StrBufExtract_NextToken(Cfg, Line, &PPos, '|');
764 StrBufExtract_NextToken(CfgToken, Line, &PPos, '|');
765 if (GetHash(CfgNameHash, SKEY(CfgToken), &vptr) &&
768 pCfg = (ConfType *) vptr;
769 if (pCfg->Type <= min)
771 Put(List, SKEY(Cfg), Cfg, HFreeStrBuf);
777 cprintf("%d Valid Domains\n", LISTING_FOLLOWS);
778 It = GetNewHashPos(List, 1);
779 while (GetNextHashPos(List, It, &HKLen, &HKey, &vptr))
790 FreeStrBuf(&CfgToken);
794 /*****************************************************************************/
795 /* MODULE INITIALIZATION STUFF */
796 /*****************************************************************************/
798 void control_cleanup(void)
800 DeleteHash(&CfgNameHash);
802 CTDL_MODULE_INIT(control)
807 CfgNameHash = NewHash(1, NULL);
808 for (i = 0; CfgNames[i].Name.Key != NULL; i++)
809 Put(CfgNameHash, CKEY(CfgNames[i].Name), &CfgNames[i], reference_free_handler);
811 CtdlRegisterProtoHook(cmd_gvdn, "GVDN", "get valid domain names");
812 CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration");
813 CtdlRegisterCleanupHook(control_cleanup);
816 /* return our id for the Log */