Commit 6ee9dcb0 authored by David Byers's avatar David Byers
Browse files

Documentation updates:

        Merged lyskomd.texi, hacking.texi and dbck.texi
        Added what-is-unread.swe to Protocol-A.texi

Aux-items:
        Handle disabled item types in a cleaner manner.
        Fixed bugs related to linked aux items. This feature
        should work pretty well now.
        Added test cases to test linking aux items.
parent 32965bf8
...@@ -5,6 +5,38 @@ ...@@ -5,6 +5,38 @@
lyskomd.0/08.exp. lyskomd.0/08.exp.
* src/server/testsuite/lyskomd.0/08.exp: New file. * src/server/testsuite/lyskomd.0/08.exp: New file.
1999-05-18 David Byers <davby@ida.liu.se>
* doc/lyskomd.texi: Merged dbck.texi and hacking.texi into
lyskomd.texi.
* src/server/testsuite/lyskomd.0/03.exp: Updated
query-predefined-aux-items result.
* src/server/testsuite/lyskomd.0/01.exp: Updated
query-predefined-aux-items result.
* src/server/aux-items.c (undelete_aux_item_list): Fixed
conference/text mixup
(delete_aux_item_list): Same here.
(undelete_aux_item_list): Save kom_errno and err_stat across call.
* src/server/aux-item-def-parse.y: Deal with disabled definitions
in a more sensible manner.
* src/server/aux-items.c (aux_item_add_perm): Check the disabled
field of the aux-item definition.
* src/server/aux-items.h: Added disabled field.
1999-05-17 David Byers <davby@ida.liu.se>
* src/server/aux-items.c (aux_item_list_add_items): New utility
function.
(system_add_aux_item_list): Use aux_item_list_add_items.
(text_stat_add_aux_item_list): Use aux_item_list_add_items.
(conf_stat_add_aux_item_list): Use aux_item_list_add_items.
1999-05-16 Per Cederqvist <ceder@lysator.liu.se> 1999-05-16 Per Cederqvist <ceder@lysator.liu.se>
Use a global variable to store the current time, so that it is Use a global variable to store the current time, so that it is
...@@ -111,6 +143,24 @@ ...@@ -111,6 +143,24 @@
* src/server/ram-smalloc.c: Don't test USE_GNU_MALLOC; that symbol * src/server/ram-smalloc.c: Don't test USE_GNU_MALLOC; that symbol
was removed 1998-08-09. was removed 1998-08-09.
1999-05-16 David Byers <davby@ida.liu.se>
* src/server/aux-items.c (prepare_aux_item): Don't clear the link
field of the aux item.
(aux_inherit_items): Clear the link in the copied item before
calling add triggers.
(aux_item_link_items): New function.
(aux_item_trigger_mirror_faq): Use aux_item_link_items.
(aux_item_trigger_link_item): Use aux_item_link_items.
(aux_item_call_add_triggers): Fix the trigger data after calling
each trigger since one of them might move the aux item list in
memory.
1999-05-15 David Byers <davby@ida.liu.se>
* src/server/aux-items.c (aux_item_trigger_link_item): New
function for debugging linking aux items.
1999-05-14 Per Cederqvist <ceder@lysator.liu.se> 1999-05-14 Per Cederqvist <ceder@lysator.liu.se>
Fixes to the test suite. Fixes to the test suite.
...@@ -143,6 +193,116 @@ ...@@ -143,6 +193,116 @@
(lyskomd_fail_start): Likewise. Find the database files relative (lyskomd_fail_start): Likewise. Find the database files relative
to top_srcdir. to top_srcdir.
1999-05-14 David Byers <davby@ida.liu.se>
* src/server/text.c (do_create_text): Return long-array if there
are too many misc items.
(modify_text_info): Set err_stat to max length when returning
KOM_LONG_ARRAY.
* src/include/kom-types.h (Info_datum): Added unknown_type to
union.
* src/server/text.c (find_recipient): Add unknown_info to the
switch. Stop the server if COMPILE_CHECKS is undefined.
(is_member_in_recpt): Same here.
(do_delete_misc): Same here.
(do_sub_recpt): Same here.
(sender): Same here.
(is_sender): Same here.
(is_comm_sender): Same here.
(skip_recp): Same here.
(recp_sent_by): Same here.
(filter_secret_info): Same here.
(do_delete_text): Same here.
(check_double_subm): Same here.
(check_double_comm): Same here.
(create_text_check_misc): Return an illegal-info-typye if we see
an unknown info. Set err_stat to the index of the bad item when
returning a KOM_ILL_MISC.
(create_text_add_miscs): Same here.
* src/server/prot-a.c (prot_a_destruct): Free the misc_info_list
field of the connection.
* src/server/membership.c (add_rec_time): Handle unknown_info and
other unknown misc info types by shutting down the server.
* src/server/call-switch.awk: Add support for misc_info_list in
fncdef.txt.
* src/server/text.c (create_text_old): Changed parameter list to
use Misc_info_list instead of an integer and a Misc_info pointer.
(create_text): Same here.
(create_anonymous_text): Same here.
(create_anonymous_text_old): Same here.
* src/server/fncdef.txt: Changed all "num c_misc_info_p" to
misc_info_list.
* src/server/prot-a-parse-arg-c.awk: The aux_item type works again.
Allow misc_info_list as a type name.
* src/server/prot-a-parse.c (prot_a_parse_misc_info_list): New
function.
* src/server/prot-a.c (prot_a_init): Initialize the misc_info_list
field.
* src/server/internal-connections.c (kill_client): Use
misc_info_list field of Connection.
* src/server/connections.c (free_parsed): Clear the misc_info_list
field.
* src/include/kom-types.h (Misc_info_list): New type
* src/server/internal-connections.c (init_connection): Initialize
hunt_parse_pos, array_hunt_depth and array_hunt_num. Initialize
misc_info_list.
* src/server/prot-a-parse.c (prot_a_hunt_array_end): New function
hunts for the end of an array.c
* src/server/prot-a.c (prot_a_init): Initialize hunt_parse_pos and
array_hunt_num.
* src/include/kom-types.h (Info_type): Added unknown info type.
* src/server/prot-a-parse.c (prot_a_parse_misc_info): Parse all
misc-info types that the server knows about. Unknown types
generate a protocol error.
* src/server/testsuite/lyskomd.0/prot-a-parse-cov.exp (1021):
Expcet long-array and not protocol-error.
* src/server/prot-a-parse.c (prot_a_parse_aux_item_list): Discard
the part of the list that is longer than the max rather than send
a protocol error.
1999-05-13 David Byers <davby@ida.liu.se>
* src/server/testsuite/lyskomd.0/prot-a-parse-cov.exp
(protocol_error): Removed expected failure.
* src/server/admin.c (modify_server_info): Return KOM_LONG_ARRAY
when we see a long array.
* src/server/conference.c (modify_conf_info): Return
KOM_LONG_ARRAY when we see a long array.
* src/server/text.c (modify_text_info): Return KOM_LONG_ARRAY when
we see a long array.
* src/server/prot-a-parse.c (prot_a_parse_num_list): Truncate a
parsed array to one more than the maximum length and skip all
other elements.
* src/server/aux-items.c (undelete_aux_item_list): Log if the link
type is undefined and do not attempt to undelete.
(delete_aux_item_list): Likewise.
1999-05-13 Per Cederqvist <ceder@gratia> 1999-05-13 Per Cederqvist <ceder@gratia>
Distribute the leaks tests, and run them during "make check". Distribute the leaks tests, and run them during "make check".
......
...@@ -9,11 +9,13 @@ Testfall f ...@@ -9,11 +9,13 @@ Testfall f
* Showstoppers * Showstoppers
** Make sure that there are no "expected failures" in the test suite.
** Consider changing many paths so that it is safe to install lyskomd ** Consider changing many paths so that it is safe to install lyskomd
with prefix=/usr/local. with prefix=/usr/local.
How about saving this for the next release and then support
various other path conventions?
** Consider removing the pid file on exit. ** Consider removing the pid file on exit.
** Consider locking the database, so that dbck cannot do harm, and so ** Consider locking the database, so that dbck cannot do harm, and so
...@@ -29,25 +31,36 @@ Testfall f ...@@ -29,25 +31,36 @@ Testfall f
** Documentation Issues ** Documentation Issues
*** Document "%%Unsupported protocol" message
*** Document "%% No connections left" message
*** Remove the text "In all likelihood, the implementation of this flag *** Remove the text "In all likelihood, the implementation of this flag
is screwed up." from lyskomd.texi after checking that is screwed up." from lyskomd.texi after checking that
supervisor-only works properly. supervisor-only works properly.
*** Move dbck.texi, hacking.tex and lyskomdb.texi into lyskomd.texi. *** Document updateLysKOM in lyskomd.texi.
Two reasons: there are too many manuals, and automake apparently There should be an "Invoking updateLysKOM" node.
doesn't allow more than one file to include version.texi. updateLysKOM should use the "Status file" parameter (and other
parameters). (DONE)
Use parameters in src/server/updateLysKOM.c`savecore(). (DONE)
I will do this --ceder
*** Fix doc/lyskomdb.texi (Version 1) (see FIXME comments). *** Document komrunning in lyskomd.texi.
There should be an "Invoking komrunning" node.
komrunning should be rewritten i C; it only works with BSD-style ps
programs. (DONE, but it no longer displays the process)
I am doing this --ceder
*** Dump all little doc files into the texinfo manuals. *** Dump all little doc files into the texinfo manuals.
Remaining:
disc-cache.spec lyskomd.texi översätt, uppdatera
local-to-global.doc lyskomd.texi ceder?
prot-a-tankar *
prot_a *
security-levels.txt Protocol-A.texi DONE
what-is-unread.swe Protocol-A.texi DONE
I will do this --DCB I will do this --DCB
*** Fix the node structure of Protocol-A.texi (3228867). *** Fix the node structure of Protocol-A.texi (3228867).
I will do this --DCB I will do this --DCB
Looks done...
*** Update/rewrite README. *** Update/rewrite README.
...@@ -62,8 +75,6 @@ Testfall f ...@@ -62,8 +75,6 @@ Testfall f
*** The protocol revision section of Protocol-A.info is incomplete. *** The protocol revision section of Protocol-A.info is incomplete.
I will do this --ceder I will do this --ceder
*** Document that session number 0 can be used in call 55.
** Build Issues ** Build Issues
*** Check that texinfo.tex is included in a proper place by automake. *** Check that texinfo.tex is included in a proper place by automake.
...@@ -76,6 +87,12 @@ Testfall f ...@@ -76,6 +87,12 @@ Testfall f
** Testing ** Testing
*** Try sending in negative lengths whenever we can send an array.
DONE for misc-info-list, add-aux delete-aux
*** Check that we don't leak memory when truncating a long
aux_item_list send from the client.
*** In prot_a_get_token, what is an insane token length? *** In prot_a_get_token, what is an insane token length?
*** Test validation of regexps containing groups. Try "X\\(YZ\\)?X". *** Test validation of regexps containing groups. Try "X\\(YZ\\)?X".
...@@ -87,13 +104,6 @@ Testfall f ...@@ -87,13 +104,6 @@ Testfall f
*** Should anyone be able to set their letterbox to secret? *** Should anyone be able to set their letterbox to secret?
*** There is no way to set the Personal_flags. It's not even obvious
where it gets its initial value! This is Not Good At All.
*** If we try to create a pers or conf and have reached the limit
of how many confs we can create, lyskomd just dies. Nasty. It
should return index-out-of-range, like create-text.
*** Timestamps of various things are not synchronized. *** Timestamps of various things are not synchronized.
This is seen easily when lyskomd executes really slowly. This is seen easily when lyskomd executes really slowly.
Known cases: last-written does not match text-stat (FIXED) Known cases: last-written does not match text-stat (FIXED)
...@@ -671,6 +681,59 @@ Testfall f ...@@ -671,6 +681,59 @@ Testfall f
removed. (1108039). removed. (1108039).
REJECT: too much work to be worth it. REJECT: too much work to be worth it.
*** Document "%%Unsupported protocol" message
DONE.
*** Document "%% No connections left" message
DONE.
*** Fix doc/lyskomdb.texi (Version 1) (see FIXME comments).
DONE.
*** Document that session number 0 can be used in call 55.
DONE.
*** There is no way to set the Personal_flags. It's not even obvious
where it gets its initial value! This is Not Good At All.
DONE.
*** If we try to create a pers or conf and have reached the limit
of how many confs we can create, lyskomd just dies. Nasty. It
should return index-out-of-range, like create-text.
DONE.
** When we pass a read-only misc item in create-text we get a protocol
error. We should get an illegal-misc. We can't just pass it through
since create_text_add_miscs will abort if it sees one of these misc
items.
DONE.
** Parsing arrays that are longer than the maximum length is not
handled very well. Right now we return a protocol error most of the
time, but perhaps it would be better to return a protocol error
only when the array is insanely long, not just when it is longer
than the max. So we could have a global max array length parameter.
DONE.
** Make sure that there are no "expected failures" in the test suite.
DONE.
** Try sending a too-long aux-item list
DONE.
** Send a too-long misc-item list
DONE.
** Sending a too-long delete or add list crashes the server.
DONE.
** Call add-recipient with really bogus info type
DONE.
*** Move dbck.texi, hacking.tex and lyskomdb.texi into lyskomd.texi.
Two reasons: there are too many manuals, and automake apparently
doesn't allow more than one file to include version.texi.
DONE.
* In progress * In progress
......
This diff is collapsed.
This diff is collapsed.
\input texinfo \input texinfo
@c $Id: lyskomdb.texi,v 1.2 1999/04/03 21:58:09 ceder Exp $ @c $Id: lyskomdb.texi,v 1.3 1999/05/18 13:06:22 byers Exp $
@c %**start of header @c %**start of header
@setfilename lyskomdb.info @setfilename lyskomdb.info
@settitle "lyskomd Database Format Specification" @settitle "lyskomd Database Format Specification"
...@@ -220,16 +220,13 @@ deleted : @BB{-C} @II{integer} @BB{NL} ...@@ -220,16 +220,13 @@ deleted : @BB{-C} @II{integer} @BB{NL}
The integer in the conference, text and person records is the ID of the The integer in the conference, text and person records is the ID of the
record. This implies that records can be in any order. record. This implies that records can be in any order.
@c FIXME: doesn't it store the first unused number? There is probably a The @II{next-free-num} record is used to store the next available ID for
@c fence error here. /ceder conferences in the system. There may be several of these records in the
The @II{next-free-num} record is used to store the highest ID of any database.
conference in the system. There may be several of these records in the
database.
@c FIXME: doesn't it store the first unused number? There is probably a The @II{next-text-num} record is used to store the next available ID for
@c fence error here. /ceder texts in the system. There may be several of these records in the
The @II{next-text-num} record is used to store the highest ID of any text database.
in the system. There may be several of these records in the database.
A conference or text must have a number lower than the closest A conference or text must have a number lower than the closest
@II{next-free-num} or @II{next-text-num} preceding it. @II{next-free-num} or @II{next-text-num} preceding it.
......
/* /*
* $Id: kom-types.h,v 0.34 1999/05/12 13:24:27 byers Exp $ * $Id: kom-types.h,v 0.35 1999/05/18 13:06:26 byers Exp $
* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -185,7 +185,7 @@ typedef enum { ...@@ -185,7 +185,7 @@ typedef enum {
rec_time = 7, /* 7 Received at (time) */ rec_time = 7, /* 7 Received at (time) */
sent_by = 8, /* 8 Sent by (person) */ sent_by = 8, /* 8 Sent by (person) */
sent_at = 9, /* 9 Sent at (time) */ sent_at = 9, /* 9 Sent at (time) */
bcc_recpt = 15 /* 15 BCC recipient (for kannedom) */ bcc_recpt = 15, /* 15 BCC recipient (for kannedom) */
#ifdef PROT_a #ifdef PROT_a
, ,
x_person = 11, /* 11 External person id. (Global_name). */ x_person = 11, /* 11 External person id. (Global_name). */
...@@ -193,6 +193,8 @@ typedef enum { ...@@ -193,6 +193,8 @@ typedef enum {
x_text = 13, /* 13 External text. (Global_text). */ x_text = 13, /* 13 External text. (Global_text). */
x_system = 14 /* 14 External system identification (System_id). */ x_system = 14 /* 14 External system identification (System_id). */
#endif #endif
unknown_info = 4711 /* Internal use only. Unknown misc item encountered */
} Info_type; } Info_type;
#ifdef PROT_a #ifdef PROT_a
...@@ -223,6 +225,7 @@ typedef union { ...@@ -223,6 +225,7 @@ typedef union {
Global_text global_text; Global_text global_text;
System_id system_id; System_id system_id;
#endif #endif
Info_type unknown_type;
} Info_datum; } Info_datum;
...@@ -233,6 +236,12 @@ typedef struct { ...@@ -233,6 +236,12 @@ typedef struct {
} Misc_info; } Misc_info;
typedef struct {
unsigned short no_of_misc;
Misc_info * misc;
} Misc_info_list;
typedef struct { typedef struct {
unsigned int deleted : 1; /* This item has been deleted */ unsigned int deleted : 1; /* This item has been deleted */
unsigned int inherit : 1; /* Copy to comments */ unsigned int inherit : 1; /* Copy to comments */
......
/* /*
* $Id: services.h,v 0.44 1999/05/12 13:24:28 byers Exp $ * $Id: services.h,v 0.45 1999/05/18 13:06:27 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -485,26 +485,22 @@ KOM_( mark_as_read (Conf_no conference, ...@@ -485,26 +485,22 @@ KOM_( mark_as_read (Conf_no conference,
/* Returns 0 on error */ /* Returns 0 on error */
extern Text_no extern Text_no
KOM_( create_text (const String message, KOM_( create_text (const String message,
unsigned short no_of_misc, CONST Misc_info_list * misc,
CONST Misc_info * misc,
Aux_item_list * aux )); Aux_item_list * aux ));
extern Text_no extern Text_no
KOM_( create_text_old (const String message, KOM_( create_text_old (const String message,
unsigned short no_of_misc, CONST Misc_info_list * misc ));
CONST Misc_info * misc ));
/* Returns 0 on error. This function is experimental. */ /* Returns 0 on error. This function is experimental. */
extern Text_no extern Text_no
KOM_( create_anonymous_text (const String message, KOM_( create_anonymous_text (const String message,
unsigned short no_of_misc, CONST Misc_info_list * misc,
CONST Misc_info * misc,
Aux_item_list *aux )); Aux_item_list *aux ));
extern Text_no extern Text_no
KOM_( create_anonymous_text_old (const String message, KOM_( create_anonymous_text_old (const String message,
unsigned short no_of_misc, CONST Misc_info_list * misc ));
CONST Misc_info * misc ));
extern Success extern Success
KOM_( delete_text( Text_no text_no )); KOM_( delete_text( Text_no text_no ));
......
/* /*
* $Id: admin.c,v 0.36 1999/05/16 21:45:00 ceder Exp $ * $Id: admin.c,v 0.37 1999/05/18 13:06:45 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#endif #endif
static const char * static const char *
rcsid = "$Id: admin.c,v 0.36 1999/05/16 21:45:00 ceder Exp $"; rcsid = "$Id: admin.c,v 0.37 1999/05/18 13:06:45 byers Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -372,6 +372,21 @@ modify_server_info(Number_list *items_to_delete, ...@@ -372,6 +372,21 @@ modify_server_info(Number_list *items_to_delete,
Aux_item_list *items_to_add) Aux_item_list *items_to_add)
{ {
CHK_LOGIN(FAILURE); CHK_LOGIN(FAILURE);
if (items_to_delete->length > param.max_delete_aux)
{
kom_errno = KOM_LONG_ARRAY;
err_stat = param.max_delete_aux;
return FAILURE;
}
if (items_to_add->length > param.max_add_aux)
{
kom_errno = KOM_LONG_ARRAY;
err_stat = param.max_add_aux;
return FAILURE;
}
if ( !ENA(admin, 1) ) if ( !ENA(admin, 1) )
{ {
err_stat = 0; err_stat = 0;
......
%{ %{
/* /*
* $Id: aux-item-def-parse.y,v 1.5 1999/05/12 13:24:55 byers Exp $ * $Id: aux-item-def-parse.y,v 1.6 1999/05/18 13:06:45 byers Exp $
* Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -213,8 +213,9 @@ head : NUMBER ':' ID '(' targets ')' ...@@ -213,8 +213,9 @@ head : NUMBER ':' ID '(' targets ')'
} }
| NUMBER ':' ID '(' targets ')' DISABLED | NUMBER ':' ID '(' targets ')' DISABLED
{ {
def.tag = 0; def.tag = $1;
def.name = s_crea_c_str($3); def.name = s_crea_c_str($3);
def.disabled = TRUE;
s_clear(&($3)); s_clear(&($3));
$3 = EMPTY_STRING; $3 = EMPTY_STRING;
yylval.str = EMPTY_STRING; yylval.str = EMPTY_STRING;
......
This diff is collapsed.
/* /*
* $Id: aux-items.h,v 1.8 1999/05/16 21:45:25 ceder Exp $ * $Id: aux-items.h,v 1.9 1999/05/18 13:06:47 byers Exp $
* Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -121,6 +121,7 @@ struct Aux_item_definition_s { ...@@ -121,6 +121,7 @@ struct Aux_item_definition_s {
unsigned long tag; unsigned long tag;
Aux_item_flags clear_flags; Aux_item_flags clear_flags;
Aux_item_flags set_flags; Aux_item_flags set_flags;
Bool disabled;
Bool author_only; Bool author_only;