Commit e6dca4a9 authored by David Byers's avatar David Byers
Browse files

New RPC calls:


Modified RPC calls
        create-person (new parameter pers-flags)

Removed several hard-coded constants and paths.
        Max texts
        Max conferences
        Nologin file

Support for aux-item validation functions (not just regexps.)
Support for aux-items that can only be created by the server
Support for linking pairs of aux items

Added test cases to improve code coverage

Renamed log to kom_log to avoid conflicts with math function log.

Several bug fixes (code and documentation)
parent dc0393d3
1999-05-12 David Byers <>
Stuff I forgot to add below
* Renamed log to kom_log since log is a function in math.h.
* src/include/services.h (set_pers_flags): New prototype.
(create_person): Added flags parameter.
* run-support/config: Set defaults for max texts and max
* run-support/aux-items.conf (faq-text): Removed all triggers. Set
add-trigger to link-faq, added validator.
(faq-for-conf): New item definition.
* doc/lyskomd.texi (Parameters): Added Max conferences, Max texts,
Max client data length, Nologin fle. Updated some other parameter
(Aux-Item Definition File): Added system-only. Rewrote validate to
allow function identifiers. Added list of validator functions and
(Files): Document /etc/nologin.
* doc/hacking.texi: Correct minor typos. Change some @code into
(Linking Pairs of Aux Items): New section.
* doc/Protocol-A.texi: Correct minor typos
(Predefined Aux-Item Types): Rephrase some
of the text. Remove statement that faq-text item marks a text.
Document faq-for-conf. Specify formate for mx-message-id.
(Simple Data Types): Removed documentation for INTEGER.
(set-etc-motd): Change too-many-marks to mark-limit
(mark-text-old): Change too-many-marks to mark-limit
(set-conf-type): Correct documentation for secret-public error.
Correct spelling in invalid-membership-type documentation.
(add-recipient): Add documentation for access-denied error
(add-comment): Define error-status in index-out-of-range.
(sub-comment): Change no-comment to not-comment.
(send-message): Complete documentation of message-not-sent error.
(create-text): Add index-out-of-range as possible error.
(create-conf): Complete doc of permission-denied error.
(create-person): Added personal-flags parameter.
(create-person): Document person-exists error.
(set-pers-flags): New call.
(Error Codes): Clarify message-not-sent and index-out-of-range.
* Added flag --with-insure++. Define AVOID_ABORTS
when compiling with support for gcov.
* src/server/testsuite/ Added #hose socket to hose
the socket with lots of zeroes.
* src/server/testsuite/config/prot-a.exp: New functions
kom_set_permitted_submitters, kom_set_super_conf, kom_login_old,
kom_mark_text, kom_sub_recipient, kom_set_conf_type,
kom_change_conference, kom_set_priv_bits.
(kom_create_person): Send the pers_flags field.
* src/server/testsuite/config/unix.exp: Print a dot for every test
case in verbose mode.
(lyskomd_start): New parameters extra_config for additional config
file contents and base_config for basic config file contents
(defaults will not be used.) Don't print defaults for max
conferences or max texts if they are in extra_config. It is
possible to start lyskomd with arbitrary arguments.
(lyskomd_fail_start): Function to use when lyskomd is supposed to
not start properly (like lyskomd_start, but server failue is
(client_start_fail): New function like client_start, but failure
is expected.
(kill_client): Unset expect_active and expect_always instead of
setting to the empty string.
(hose_client): New function
* src/server/testsuite/lyskomd.0/00.exp: Send pers-flags in calls
to create-person.
* src/server/testsuite/lyskomd.0/01.exp: Update expected results
in query-predefined-aux-items. Send pers-flags in call to
create-person. Add test for set-pers-flags. Add test for
nonexistent call 107.
* src/server/testsuite/lyskomd.0/02.exp: Send pers-flags in call
to create-person.
* src/server/testsuite/lyskomd.0/03.exp: Expect aux-item 28 in
query-predefined-aux-items. Send pers-flags in call to
create-person. Expect the faq-for-conf aux-item in test 1327.
Expect failure attempting to set nonexistent text as faq (test
1342.) Remove the now failed faq item in subsequent tests. Add
test for set-pers-flags.
* src/server/testsuite/lyskomd.0/04.exp: Send pers-flags in calls
to kom_create_person.
* src/server/testsuite/lyskomd.0/05.exp: Send pers-flags in calls
to kom_create_person. Be more flexible when expecting time
corresponding to time_t zero. Set garb and sync interval to
something really high to avoid spurious async messages while
running the tests.
* src/server/testsuite/lyskomd.0/06.exp: Send pers-flags in calls
to kom_create_person.
* src/server/testsuite/lyskomd.0/admin-cov.exp: More setup to
support new tests. Test that we can't send messages to secret
confs. Test that messages are filtered for passive members.
* src/server/testsuite/lyskomd.0/aux-items-cov.exp: Send
pers-flags in calls to kom_create_person. Attempt to create
aux-items with broken validation regexp. Test the system-only
attribute. Test a broken aux-item config file.
* src/server/testsuite/lyskomd.0/aux-items.cov: Add an item
definition with system-only property.
* src/server/prot-a-parse.h: Added prototype for
* src/server/prot-a-parse.c (prot_a_parse_pers_flags): New
function to parse pers flags.
* src/server/prot-a-output.c (prot_a_output_text_mapping):
Initialize the fields of iter to avoid warnings from tools that
detect access to uninitialize memory.
* src/server/local-to-global.c: Use kom_log instead of log.
* src/server/kom-memory.c: Added prototypes for init_aux_item and
* src/server/aux-items.c (system_check_add_aux_item_list): Call
aux_item_add_perm with INFO_OBJECT_TYPE for the object_type
* src/server/admin.c: Use kom_log instead of log everywhere.
(send_message): Do not permit sending group messages to secret
conferences. Set errno to KOM_MESSAGE_NOT_SENT if there are no
appropriate recipients.
* src/server/aux-item-def-parse.y: Parse validation functions in
addition to validation regexps. Use kom_log instead of log. Parse
the system-only property.
(aux_item_def_check_validate): New function.
* src/server/aux-items.c: Add the aux-item being involved item
itself to aux-item trigger data.
(aux_item_validate_existing_text): New validation function.
(aux_item_trigger_mirror_faq): New add trigger function
(aux_item_trigger_unmark_text): Modified to work for aux-items on
texts and conferences, not just conferences. Do not unmark an
unmarked text.
(aux_item_trigger_mark_text): Do not add more marks than
(find_aux_item_index): New function to find the index of an item
with a particular number in an aux item list.
(commit_aux_item_list): Renamed to commit_aux_item_list_internal.
(commit_aux_item_list_internal): Delete linked aux items.
(commit_aux_item_list): Wrapper for commit_aux_item_list_internal.
(delete_aux_item_list): Manage deletion of linked items.
(undelete_aux_item_list): Manage undeletion of linked items.
(mark_linked_object_as_changed): New function to mark the object
containing a linked aux item as changed.
(find_linked_aux_item): New function to find the aux item that is
linked to a given aux item.
(find_linked_aux_item_list): New function to find the aux item
list containing the aux item that is linked to a given aux item.
(aux_item_validate): New function for validating aux items. Deals
with regexps and validation functions.
(aux_item_add_perm): Handle the system-only property of aux item
1999-05-09 David Byers <>
* src/server/aux-items.c (prepare_aux_item): Clear the linked_item
field properly.
* src/server/memory.c (init_aux_item_link): New function.
(init_aux_item): Use init_aux_item_link
(init_aux_item): New function added earlier.
* src/server/prot-a-parse.c (prot_a_parse_aux_item): Clear the
parsed aux_item to get good defaults for fields that are not read
in the parser.
* src/server/admin.c (modify_server_info): Pass INFO_OBJECT_TYPE
to delete_aux_item_list and undelete_aux_item_list.
* src/server/aux-items.h: Changed all declarations of object_type
from short to Object_type.
* src/server/aux-items.c: Changed all declarations of object_type
from short to Object_type.
* src/server/ram-parse.c (fparse_aux_item_link): New function.
(fparse_aux_item): Parse the link as well.
* src/include/kom-types.h (Object_type): New type (moved defs from
(Aux_item_link): New type
(Aux_item): Added linked_item field.
* src/server/ram-output.c (foutput_aux_item): Output linked_item
(foutput_aux_item_link): New function to output a link to another
aux item.
* src/server/aux-items.c: Added handling of item field in aux item
trigger calls.
* src/server/aux-items.h (Aux_item_trigger_data_s): Added item
* src/server/aux-items.c (system_check_add_aux_item_list): Set
owner_check to TRUE in call to aux_item_add_perm so system-only
restriction works on system-info aux-item list.
* src/server/testsuite/lyskomd.0/admin-cov.exp: Added tests for
sending messages to secret confs and to conf with passive member
logged in.
* doc/Protocol-A.texi (send-message): Document that
message-not-sent is returned when there are no recipients for a
group message.
* src/server/com-h.awk: Set illegal_fnc to -1 (was cnt) since cnt
might be a legal function.
1999-05-02 Per Cederqvist <ceder@gratia>
"make check" in the top directory failed in some environments.
......@@ -155,6 +386,27 @@
* src/server/testsuite/test-l2g.c (main): Set the block size to 10.
1999-04-23 David Byers <>
* src/server/standalone.c (kom_info): Initialize the
aux_item_list too.
* src/server/ramkomd.c (initialize): Use kom_log instead of log.
* src/server/local-to-global.c (l2g_read): Use kom_log instead of
* src/server/text.c (text_read_access): Call
person_text_read_access to do the work.
(person_text_read_access): New function generalizes
* src/server/manipulate.h: Prototype for person_text_read_access.
1999-04-21 David Byers <>
* src/server/aux-items.c (aux_item_find_validator): New function.
1999-04-20 Per Cederqvist <ceder@gratia>
Two file descriptors were leaked during startup.
......@@ -632,6 +884,16 @@
* TODO: Updated according to priorization made by me and David
1999-03-28 David Byers <>
* src/server/simple-cache.c (cached_conf_exists): Test existance
in small_conf_arr. Don't go to disk.
(cached_delete_conf): Free the associated small_conf_stat and set
small_conf_arr[x] to NULL.
* run-support/aux-items.conf: Restrict creation of mx-author to
creation time.
1999-02-06 Per Cederqvist <ceder@gratia>
* Fixed a syntax error introduced yesterday.
......@@ -672,9 +934,200 @@
* src/include/kom-types.h (L2g_iterator_as_text_list): Typedef
1999-01-18 David Byers <>
1999-02-02 David Byers <>
* src/server/aux-items.h (Aux_item_validation_data): New type.
(Aux_item_validation_function): New type.
(Aux_item_validator): New type.
1999-01-28 David Byers <>
* src/server/prot-a-parse.c (prot_a_parse_aux_item_list): Check
array size for -1. Check allocation of result.
* src/server/person.c (mark_text): Return no-such-text if the user
is not allowed to read the text (just like get-text-stat)
(set_user_area): Return UNDEF_PERS, not UNDEF_CONF.
* src/include/kom-errno.h (enum kom_errno): Define
* src/server/person.c (create_person_generic): Return
1999-01-27 David Byers <>
* src/server/conference.c (do_create_conf): Don't just DIE if we
fail to create a conference. Log a message and return an error.
* src/server/person.c (create_person_generic): Don't just DIE if
we fail to create a conference. Log a message and return an error.
* src/server/testsuite/ (fdset): Accep
* src/server/ram-output.c (foutput_conference_2): Output a space
before the l2g mapping.
(foutput_person_2): Same thing here.
1999-01-26 David Byers <>
* src/server/person.c (create_person_old): Add parameter in call
to create_person.
(create_person): Added flags parameter.
(create_person_generic): Set the personal flags from the
(set_pers_flags): New function to set the personal flags of a
* src/server/fncdef.txt: Added set_pers_flags and added pers_flags
argument to create_person.
1999-01-25 David Byers <>
* doc/hacking.texi (Parsing Bit Fields): New section.
* src/server/prot-a-parse.c (prot_a_parse_priv_bits): New
function. New model for parsing bit fields that's really tolerant
about the token length. Anything from one bit and up is cool.
* src/server/prot-a-parse.h: Added prot_a_parse_priv_bits.
* src/server/connections.h: Added pers_flags to Connection.
* src/server/internal-connections.c (init_connection): Initializer
pers_flags field.
* src/server/prot-a-parse-arg-c.awk: Added pers_flags.
* src/server/call-switch.awk: Added pers_flags.
* src/server/person.c (set_user_area): Return KOM_UNDEF_CONF if
the person is secret.
* src/server/conference.c (get_conf_stat_old): Check access with
<= none and not == none.
(get_conf_stat_older): Same here.
* src/server/person.c (get_person_stat): Check access with <= none
and not == none
(get_person_stat_old): Same here.
(get_created_texts): Same here.
(map_created_texts): Same here.
1999-01-24 David Byers <>
* src/server/connections.c (login_request): Use param.nologin_file
instead of hard-coded path.
* doc/lyskomd.texi (Parameters): Documented Nologin file
* src/server/server-config.c: Added "Nologin file"
* src/server/param.h: Added nologin_file.
* src/server/conference.c (legal_name): Return bad-name on attempt
to use null string.
* src/server/log.c (restart_kom): Do normal exit if AVOID_ABORTS
is defined.
* acconfig.h: Added AVOID_ABORTS
* Define AVOID_ABORTS when the user says --with-gcov
* src/server/conf-file.c (configure_line): Complain about too many
assignments at one too many assignments, not two too many.
* src/server/simple-cache.c (sync_part): Don't save if
param.never_save is set.
* src/server/server-config.c: Compile in never_save always.
1999-01-23 David Byers <>
* src/server/session.c (set_client_version): Use client_data_len
as max length for client version and client name.
* doc/lyskomd.texi (Parameters): Documented max client data
* src/server/param.h: Added client_data_len.
* src/server/server-config.c: Added max client data length.
* src/server/text.c (submit_to): Set err-stat to the last conf in
the chain, not zero, if we hit the top of the super-conf chain
without finding something we can write to.
(sub_recipient): Check for access to the supposed recipient before
checking if it is a recipient. This plugs two leaks of secret
(add_footnote): Set err-stat to footnote when failing because of
not being author to footnote.
(check_comm): Don't set err-stat. The caller will.
1999-01-22 David Byers <>
* src/server/text.c (create_text_check_misc): Return no-such-text
if no read access to footnoted text. Check read access before
checking anything else to avoid leaking secret information.
* src/server/membership.c (fast_access_perm): fast_access_perm
always returned read_protected for rd_prot conferences, even if
the viewer was the supervisor. Fixed.
* src/server/text.c (text_read_access): If an open conf is a bcc
recpt, anyone can see the text.
* doc/Protocol-A.texi (add-recipient): Added error code
* src/server/text.c (create_text_check_misc): Don't set
kom_errno if it was set in submit_to.
(submit_to): Set kom_errno here instead of in the caller.
(add_recipient): Return KOM_ACCESS if we are not allowed to write
to the target conference.
* doc/Protocol-A.texi (Error Codes): Fxied speling error
1999-01-21 David Byers <>
* src/server/text.c (recp_sent_by): Fixed error message.
(do_create_text): Fixed speling erorr
* doc/lyskomd.texi (Parameters): Added documentation for max
conferences and max texts.
1999-01-19 David Byers <>
* src/server/text.c (do_create_text): Pass time to
create_text_add_miscs to ensure correct timestamp.
(create_text_add_miscs): Set last_written to correct
* src/server/conf-file.c (assign_ulong): New function.
* run-support/config: Added max_confs and max_texts to default
config file.
Remove compiled-in size limits.
* src/server/dbck-cache.c (init_cache): Dynamically allocate
pers_arr, conf_arr, text_arr and name_list.
* src/server/dbck.c: Dynamically alloc person_scratchpad in
* src/server/simple-cache.c (init_cache): Allocate the
(cached_create_conf): Use param.max_conf, not MAX_CONF
(cached_create_text): Use param.max_text, not MAX_TEXT
(init_cache): Use param.max_conf and param.max_text, not MAX_CONF
* src/server/aux-items.c: Moved initialization of sent_at to
prepare_aux_item_list from other functions.
* src/server/log.h: Changed names from log to kom_log to avoid
shadowing log in math.h.
1999-01-18 David Byers <>
* src/server/testsuite/config/unix.exp (suspend_client): New
function. Suspends reading from lyskomd.
......@@ -34,8 +34,15 @@ Changes in lyskomd 2.0.0 (Release date TBD)
* There is a call to get the collate table being used by the server.
* The error status field is now set to something semi-useful in all
* A call to set the flags field in a person structure has been added.
The new version of create-person also takes flags as a parameter.
* Error reporting from the server has been improved. The possible
error codes from each call have been checked and documented. In the
process some calls now return errors they previously did not. Since
the error returns were never defined, this should not present a
problem for existing clients. The error-status field is set to
something semi-useful in all cases.
* There is a new parameter (keep_commented) on conferences for tuning
the garbage collection process. This tuning is not implemented in
......@@ -4,6 +4,9 @@ server.
Before the next release
Dokumentera vad sessionsnummer 0 betyder.
Testfall för sända meddelande till hemligt möte
* Showstoppers
** Make sure that there are no "expected failures" in the test suite.
......@@ -26,6 +29,10 @@ Before the next release
** Documentation Issues
*** Document "%%Unsupported protocol" message
*** Document "%% No connections left" message
*** Remove the text "In all likelihood, the implementation of this flag
is screwed up." from lyskomd.texi after checking that
supervisor-only works properly.
......@@ -82,18 +89,97 @@ Before the next release
** Testing
*** In prot_a_get_token, what is an insane token length?
*** Test validation of regexps containing groups. Try "X\\(YZ\\)?X".
I will do this. --DCB
*** Statement coverage tests for the aux-item-def parser
** Known Bugs
*** 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.
This is seen easily when lyskomd executes really slowly.
Known cases: last-written does not match text-stat (FIXED)
aux-item sent-at don't match created in text&conf
There might be others.
*** Fixa s{kerhetsbuggen vid read_texts et c. Det b|r vara s} att man
inte f}r veta mappningen s} ofta som nu. Vilka texter som {r l{sta
b|r ocks} vara mer hemligt. Ett nytt anrop, query_unread(), b|r
inf|ras. Resultatet {r antalet ol{sat brev och _kanske_
Local_text_no f|r det h|gsta nummret.
(Det var l{nge sen jag skrev det h{r, och jag minns inte riktigt
vad jag menar, men man borde nog titta p} det h{r s} sm}ningom).
*** Asynchronous messages may not be censored enough. Check all
messages that contain conf-nos.
*** difftime is not used everywhere where it should be used. There are
a few places where '-' is still used to get a diff in seconds.
** Improvements
*** We have to be able to limit creation of certain aux-items to users
with special privileges. Most of the import/export items need
this. Put in a new flag in the aux-item-definition file, add it to
the parser, check it in aux_item_check_add_perm or whatever the
hell the function was named. Test it. The biggest problem is to
figure out what permissions should be needed. I suppose it's
possible that we could let the user specify level and bits in the
aux-items.conf file, but that would mean mucking more with the
I will do this. --DCB
*** We have to be able to specify that some aux-items can only be
created by the server. It's possible that admins should be allowed
to create them as well. Perhaps this point and the previous point
can be solved as one.
*** When creating an FAQ item create a reverse item on the text. Make
sure that they are always added and removed as a pair. Accomplish
this with the add, delete and undelete triggers.
*** Add triggers have to have the capability of preventing addition.
This is difficult since we check the validity of addition before
adding the items. The prevention would have to happen in the check
phase, when the triggers are not called. The correct solution is
probably to implement validation functions in addition to
validation strings and let the validation function take care of
checking if the item can be added.
*** The mark text trigger has to cause add failure if the text does
not exist.
*** Fine-tune the Text_mapping data type (3623903, 3624144, 3624179, 3624173).
*** The Info structure should contain statistics about the server
(uptime, other interesting stuff.) (from 1991) Implement, reject
or postpone.
*** Read all texts in LysKOM (-) Systemet, protokollet mm created
after 1991 (start at text 170527) and incorporate selected
information in this document.
*** Improve the file format for local-to-global.c.
*** Improve the file format for local-to-global.c. Warning: this will
cause an incompatible change in the database format.
*** Use libisc 1.0.
I will do this --ceder
......@@ -115,6 +201,21 @@ Before the next release
* High priority, but they can wait until after the next release.
** Fix all bitfield parsers to deal with arbitrary lengths. Maybe...
** Call to s_fcrea_str in prot_a_get_token should be removed. There is
really no reason why we can't us a statically allocated string
instead (I know, this is microoptimization, but this function gets
called a *lot*)
** Change log.c to something better.
** Look over all places where restart_kom is called. Frequently the
error is not severe enough to warrant panicing (or so I think.) For
example, if cached_create_person fails it is very serious, but all
code that calls this function is prepared to deal with the
** Actually remove all man pages. This must wait till after the next release.
** We have to be able to limit creation of certain aux-items to users
......@@ -479,6 +580,10 @@ Before the next release
*** Integrate doc/Bugrapporter into this document.
*** Get rid of tmp-limits.h
I'll do this --DCB
** Let the author of a text add other people's texts as footnotes.
(from 1991)
REJECT. (ceder & DCB 1999-03-28)
......@@ -566,6 +671,7 @@ Before the next release
removed. (1108039).
REJECT: too much work to be worth it.
* In progress
** Document aux-items for mail import/export. (3229403)
......@@ -662,8 +768,8 @@ Before the next release
eller något väsensskillt?)
(3228045) ------------------------------------------
Local variables: