diff --git a/ChangeLog b/ChangeLog index 278c87867f64d51f42b4eda8f5edd1c342365130..c48639fce4029e2c1fc6293d23859f5933e8e782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,81 @@ +2006-09-28 Per Cederqvist <ceder@lysator.liu.se> + + Renamed the error code illegal-aux-item to illegal-aux-item-tag. + Added error code 62=aux-exists, 63=aux-bad-object, + 64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only, + 67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text. + Return proper error codes. (Bug 192). + * doc/Protocol-A.texi (Predefined Aux-Item Types): Renamed the + error code illegal-aux-item to illegal-aux-item-tag. + (create-text): Updated the error code section to mention the + aux-related error codes illegal-aux-item-tag, aux-item-permission, + aux-exists, aux-bad-object, illegal-aux-data, aux-modify-only, + aux-server-only, aux-data-exists and aux-no-such-text instead of + only illegal-aux-item and aux-item-permission. Refer to the + "Error Codes" node instead of duplicating the reasons here. + (create-anonymous-text): Ditto. + (create-conf): Ditto. + (create-person): Ditto. + (modify-text-info): Ditto, but with aux-create-only instead of + aux-modify-only. + (modify-conf-info): Ditto. + (modify-system-info): Ditto. + (Error Codes): Renamed error code 48 from illegal-aux-item to + illegal-aux-item-tag, and redefine it to not include errors in the + data. Added error code 62=aux-exists, 63=aux-bad-object, + 64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only, + 67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text. + * doc/Makefile.am (check-doc): Replaced the error code + illegal-aux-item with illegal-aux-item-tag and + illegal-aux-item-data. + * src/include/kom-errno.h (enum kom_err): Renamed KOM_ILL_AUX to + KOM_ILL_AUX_TAG. Added KOM_AUX_EXISTS, KOM_AUX_BAD_OBJECT, + KOM_ILL_AUX_DATA, KOM_AUX_CREATE_ONLY, KOM_AUX_MODIFY_ONLY, + KOM_AUX_SERVER_ONLY, KOM_AUX_DATA_EXISTS and KOM_AUX_NO_SUCH_TEXT. + * src/server/aux-items.c (aux_item_validate): Doc added. Added + missing punctuation in comments. Set kom_errno to + KOM_ILL_AUX_DATA instead of KOM_ILL_AUX when a regexp cannot be + compiled or doesn't match an entry, or when a validator fails. + (aux_item_add_perm): Document that kom_errno is set on failure. + Do not modify kom_errno on success. Track name change of + KOM_ILL_AUX_TAG. Set KOM_AUX_MODIFY_ONLY, KOM_AUX_CREATE_ONLY, + KOM_AUX_SERVER_ONLY when appropriate (used to be KOM_AUX_PERM). + Don't override the error code set by aux_item_check_unique() or + aux_item_validate() when any of those check fails. + (aux_item_check_unique): Set kom_errno to KOM_AUX_EXISTS or + KOM_AUX_DATA_EXISTS on failure (used to sometimes be + KOM_ILL_AUX). + (text_stat_check_add_aux_item_list): Track name change of + KOM_ILL_AUX_TAG. Set kom_errno to KOM_AUX_BAD_OBJECT if the + aux-item is not allowed on the active object (used to be + KOM_AUX_PERM). + (conf_stat_check_add_aux_item_list): Ditto. + (system_check_add_aux_item_list): Ditto. + (aux_item_validate_existing_text): Set kom_errno to + KOM_AUX_NO_SUCH_TEXT instead of NO_SUCH_TEXT. Set it to + KOM_ILL_AUX_DATA if the text number is non-numeric. + * src/server/testsuite/lyskomd.0/00.exp: Updated the expected + error codes for aux-item-related errors. + * src/server/testsuite/lyskomd.0/03.exp: Ditto. + * src/server/testsuite/lyskomd.0/04.exp: Ditto. + * src/server/testsuite/lyskomd.0/14.exp: Ditto. + * src/server/testsuite/lyskomd.0/17.exp: Ditto. + * src/server/testsuite/lyskomd.0/55.exp: Ditto. + * src/server/testsuite/lyskomd.0/aux-items-cov.exp: Ditto. + * src/server/testsuite/lyskomd.0/bug-572.exp: Ditto. + * src/server/testsuite/lyskomd.0/20.exp: Ditto. Remove the + want_illegal_aux_item proc and simplify the code that checks the + error codes. + * src/server/testsuite/lyskomd.0/23.exp: Ditto. + * src/server/testsuite/lyskomd.0/26.exp: Ditto. + * src/server/testsuite/lyskomd.0/28.exp: Ditto. + + Added test cases for handling duplicate faq-text aux-items. + * src/server/testsuite/lyskomd.0/21.exp: Added new tests that + attempt to set duplicate faq-text aux-items on a conference in + various ways, and removing it and re-adding it. Also test adding + two different faq-text aux-items at the same time. + 2006-09-09 Per Cederqvist <ceder@lysator.liu.se> Get rid of gcc-4.1.1 warnings by initializing more fields. diff --git a/doc/Makefile.am b/doc/Makefile.am index 0e20f3f1664873551fcf1a536e2bb0961ef25c14..0fa6c38b3baa6ab69728c5e2c90ec3eecc88dc3e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -253,7 +253,8 @@ if HAVE_PYTHON -e 's/ undef-session$$/ undefined-session/' \ -e 's/ tempfail$$/ temporary-failure/' \ -e 's/ anon-rejected$$/ anonymous-rejected/' \ - -e 's/ ill-aux$$/ illegal-aux-item/' \ + -e 's/ ill-aux-tag$$/ illegal-aux-item-tag/' \ + -e 's/ ill-aux-data$$/ illegal-aux-item-data/' \ -e 's/ aux-perm$$/ aux-item-permission/' \ | tee errorcodes-numbered.tmp \ | sed 's/[0-9]* //' \ diff --git a/doc/Protocol-A.texi b/doc/Protocol-A.texi index cb2d795b6b2d12a15779eb4c7c5f630bed49ca74..ec541c1b8620bc8911fb8f9217817894463b1843 100644 --- a/doc/Protocol-A.texi +++ b/doc/Protocol-A.texi @@ -833,7 +833,7 @@ field of an item, regardless of what the client requests. All items with tags in the range 1-9999 and 30000 and up are considered predefined. If a client attempts to create an item with a tag in this range, but the server has no idea what that tag means, the server will -return an error (@errorcode{illegal-aux-item}). +return an error (@errorcode{illegal-aux-item-tag}). Some items with tags in the range 10000-19999 are also predefined. They are items that initially were reserved for private use for a @@ -7242,12 +7242,17 @@ anonymous texts. Invalid misc-info list. A recipient is listed more than once or there is an unknown misc item in the misc-info list. -@item illegal-aux-item -One of the aux-items in @rarg{aux-items} is illegal. The tag might be -out of range, the item not applicable to texts or whatever. - -@item aux-item-permission -One of the items looks valid but could not be created anyway. +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-modify-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{aux-items} is illegal. @xref{Error +Codes}, for the meaning of the various errors. @item long-array Too many Misc-Info items or aux-items were specified. @@ -7310,11 +7315,19 @@ anonymous texts. @item illegal-misc Invalid misc-info list. A recipient is listed more than once or there is an unknown misc item in the misc-info list. -@item illegal-aux-item -One of the aux-items in @rarg{aux-items} is illegal. The tag might be -out of range, the item not applicable to texts or whatever -@item aux-item-permission -One of the items looks valid but could not be created anyway. + +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-modify-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{aux-items} is illegal. @xref{Error +Codes}, for the meaning of the various errors. + @end table @@ -7364,12 +7377,17 @@ A conference named @rarg{name} already exists. The conference type has the @conftype{secret} bit set, but the @conftype{rd-prot} bit is cleared. -@item illegal-aux-item -One of the aux-items in @rarg{aux-items} is illegal. The tag might be -out of range, the item not applicable to conferences or whatever - -@item aux-item-permission -One of the items looks valid but could not be created anyway. +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-modify-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{aux-items} is illegal. @xref{Error +Codes}, for the meaning of the various errors. @item index-out-of-range Attempt to create a conference failed because we reached the maximum @@ -7426,13 +7444,17 @@ There is already a person named @rarg{name}. @item invalid-password The string @rarg{passwd} is not a valid password. -@item illegal-aux-item -One of the aux-items in @rarg{aux-items} is illegal. The tag might be -out of range, the item not applicable to conferences or mailboxes or -whatever. - -@item aux-item-permission -One of the items looks valid but could not be created anyway. +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-modify-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{aux-items} is illegal. @xref{Error +Codes}, for the meaning of the various errors. @item index-out-of-range Attempt to create a person failed because we reached the maximum @@ -7518,12 +7540,20 @@ completely fail or completely succeed. Login required before issuing this call. @item no-such-text The text @rarg{text} does not exist or is secret. -@item aux-item-permission -No permission to delete one or more of the items in @rarg{delete}, or -@rarg{delete} indicates a non-existent aux-item, or not enough -permissions to add one or more of the items in @rarg{add}. -@item illegal-aux-item -One of the items in @rarg{add} is illegal for some reason. + +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-create-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{add} is illegal, or one of items in +@rarg{delete} cannot be deleted or does not exist. @xref{Error +Codes}, for the meaning of the various errors. + @end table @@ -7554,12 +7584,20 @@ to either completely fail or completely succeed. Login required before issuing this call. @item undefined-conference The conference @rarg{conf} does not exist or is secret. -@item aux-item-permission -No permission to delete one or more of the items in @rarg{delete}, or -@rarg{delete} indicates a non-existent aux-item, or not enough -permissions to add one or more of the items in @rarg{add}. -@item illegal-aux-item -One of the items in @rarg{add} is illegal for some reason. + +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-create-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{add} is illegal, or one of items in +@rarg{delete} cannot be deleted or does not exist. @xref{Error +Codes}, for the meaning of the various errors. + @end table @@ -7610,12 +7648,20 @@ deletions or additions succeeded, or none of them is made. Login requires before issuing this call. @item permission-denied Admin bit not set or privileges not enabled. -@item illegal-aux-item -Attempt to create an invalid aux item. -@item aux-item-permission -No permission to delete one or more of the items in @rarg{items-to-delete}, or -@rarg{items-to-delete} indicates a non-existent aux-item, or not enough -permissions to add one or more of the items in @rarg{items-to-add}. + +@item illegal-aux-item-tag +@itemx aux-item-permission +@itemx aux-exists +@itemx aux-bad-object +@itemx illegal-aux-data +@itemx aux-create-only +@itemx aux-server-only +@itemx aux-data-exists +@itemx aux-no-such-text +One of the aux-items in @rarg{items-to-add} is illegal, or one of +items in @rarg{items-to-delete} cannot be deleted or does not exist. +@xref{Error Codes}, for the meaning of the various errors. + @end table @@ -9664,10 +9710,10 @@ undefined. Attempt to send an anonymous text to a conference that does not accept anonymous texts. @field{error-status} is undefined. -@item illegal-aux-item (48) -Attempt to create an invalid aux-item. Probably the tag or data are -invalid. @field{error-status} contains the index in the aux-item list -where the invalid item appears. +@item illegal-aux-item-tag (48) +Attempt to create an invalid aux-item. The tag is invalid. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. @item aux-item-permission (49) Attempt to manipulate an aux-item without enough permissions. This @@ -9733,6 +9779,59 @@ An argument of type @type{BOOL} was given a value that is neither @samp{0} nor @samp{1}. @field{error-status} is undefined. +@item aux-exists (62) +The aux-item tag is already set on the specified object, and that tag +can only be used once (or once per person, and the tag is already set +by you). +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-bad-object (63) +The specified aux-item tag cannot be set on the type of object you are +attempting to set it on. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item illegal-aux-data (64) +The value of an aux-item is not acceptable. @xref{Aux-Item Types}, +for more information. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-create-only (65) +You are attempting to add a an aux-item to a pre-existing object, but +the aux-item type only allows it to be specified when the object is +created. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-modify-only (66) +You are attempting to add a an aux-item while creating an object, but +the aux-item type only allows it to be added at a later time. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-server-only (67) +You are attempting to add an aux-item of a type that can only be added +by the server itself. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-data-exists (68) +You are attempting to add an aux-item whose value must be unique (such +as @aux{faq-text}), and such an aux-item already exists on the object. +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + +@item aux-no-such-text (69) +You are attempting to add an aux-item whose value is (or contains) a +text number, and no such text number exists (or the text is not +readable by you). +@field{error-status} contains the index in the aux-item list where the +invalid item appears. + @end table diff --git a/src/include/kom-errno.h b/src/include/kom-errno.h index 045c35c462b1cce24cf5fe287289e605e18d5b30..422b99641b0c5a4707eb831583a453b9ffd10828 100644 --- a/src/include/kom-errno.h +++ b/src/include/kom-errno.h @@ -85,8 +85,8 @@ enum kom_err KOM_TEMPFAIL = 45, /* Try again later. */ KOM_LONG_ARRAY = 46, /* Too long array supplied. */ KOM_ANON_REJECTED = 47, /* Anonymous text not allowed in conference. */ - KOM_ILL_AUX = 48, /* Bad misc item */ - KOM_AUX_PERM = 49, /* No permission to set aux */ + KOM_ILL_AUX_TAG = 48, /* Bad aux item tag value. */ + KOM_AUX_PERM = 49, /* No permission to set aux item. */ KOM_UNKNOWN_ASYNC = 50, /* Accepting an unknown async message */ KOM_INTERNAL_ERROR = 51, /* Internal server error */ KOM_FEATURE_DISABLED = 52, /* Server feature is disabled */ @@ -99,6 +99,14 @@ enum kom_err KOM_WEIGHT_DENIED = 59, /* You cannot increase your weight that much.*/ KOM_WEIGHT_ZERO = 60, /* You cannot increase your weight that much.*/ KOM_BAD_BOOL = 61, /* A Bool must be 0 or 1. */ + KOM_AUX_EXISTS = 62, /* Attempt to set use the same tag twice. */ + KOM_AUX_BAD_OBJECT = 63, /* Aux item cannot be set on this object. */ + KOM_ILL_AUX_DATA = 64, /* Bad aux item value. */ + KOM_AUX_CREATE_ONLY = 65, /* Aux item cannot be added later. */ + KOM_AUX_MODIFY_ONLY = 66, /* Aux item can only be added later. */ + KOM_AUX_SERVER_ONLY = 67, /* Aux item can only be added by the server. */ + KOM_AUX_DATA_EXISTS = 68, /* Attempt to set use the same value twice. */ + KOM_AUX_NO_SUCH_TEXT = 69, /* Attempt to link to non-existing text. */ KOM_num_errs /* End marker */ }; diff --git a/src/server/aux-items.c b/src/server/aux-items.c index 2d09a484f15e13aca473801f6c36e33bf7ddc1d9..05e55532c57842857f2780170177171dee8e3895 100644 --- a/src/server/aux-items.c +++ b/src/server/aux-items.c @@ -888,6 +888,9 @@ prepare_aux_item(Aux_item *item, +/* + * Sets kom_errno when it returns FAILURE. + */ static Success aux_item_validate(Aux_item_validation_data validation_data) { @@ -901,10 +904,11 @@ aux_item_validate(Aux_item_validation_data validation_data) { case AUX_VALIDATE_FUNCTION: /* - * Call the validation function - * If it returns FAILURE, then abort validation + * Call the validation function. + * If it returns FAILURE, then abort validation (the + * validation function must set kom_errno). * If it returns OK, then continue with the - * next validator + * next validator. */ if ((*def->validators[i].v.fn.function)(&validation_data) != OK) @@ -916,7 +920,7 @@ aux_item_validate(Aux_item_validation_data validation_data) case AUX_VALIDATE_REGEXP: /* - * Ensure that the regexp is cached + * Ensure that the regexp is cached. */ if (def->validators[i].v.re.cached_re_buf == NULL) @@ -925,9 +929,9 @@ aux_item_validate(Aux_item_validation_data validation_data) } /* - * If the RE is still not cached there is a problem - * in this case to not validate the item at all and - * log a problem + * If the RE is still not cached there is a problem. + * In this case to not validate the item at all and + * log a problem. */ if (def->validators[i].v.re.cached_re_buf == NULL) @@ -938,7 +942,7 @@ aux_item_validate(Aux_item_validation_data validation_data) sfree(def->validators[i].v.re.regexp); def->validators[i].v.re.regexp = NULL; def->validators[i].type = AUX_VALIDATE_REJECT; - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_DATA; return FAILURE; } @@ -955,12 +959,12 @@ aux_item_validate(Aux_item_validation_data validation_data) { case -1: /* No match */ - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_DATA; return FAILURE; case -2: /* Internal error (may be temporary) */ kom_log("Internal error in regex matching aux-item data.\n"); - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_DATA; return FAILURE; break; default: @@ -974,10 +978,10 @@ aux_item_validate(Aux_item_validation_data validation_data) case AUX_VALIDATE_REJECT: /* * Just reject the item. Used when we detect a problem - * with a validator + * with a validator. */ - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_DATA; return FAILURE; break; @@ -988,7 +992,7 @@ aux_item_validate(Aux_item_validation_data validation_data) } /* - * If we got all the way to here we passed all the validators + * If we got all the way to here we passed all the validators. */ return OK; @@ -1015,6 +1019,8 @@ aux_item_validate(Aux_item_validation_data validation_data) * CREATING is true if we are checking while creating the object that * the item will be added to. * OBJECT_TYPE is the type of the object the item is added to. + * + * Sets kom_errno when it returns FALSE. */ static Bool @@ -1029,8 +1035,6 @@ aux_item_add_perm(const Aux_item *item, { short can_add_when = 0; - kom_errno = KOM_NO_ERROR; - /* Either there is a connection responsible for the creation, or we are inheriting. If we are inheriting, creating must be true. */ assert(creating_conn != NULL || creating); @@ -1042,13 +1046,13 @@ aux_item_add_perm(const Aux_item *item, if (def == NULL) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_TAG; return FALSE; } if (def->disabled) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_TAG; return FALSE; } @@ -1061,17 +1065,27 @@ aux_item_add_perm(const Aux_item *item, if (can_add_when) { - if (!((creating && (can_add_when & AUX_ITEM_ADD_ON_CREATE)) - || (!creating && (can_add_when & AUX_ITEM_ADD_ON_MODIFY)))) + if (creating) + { + if (!(can_add_when & AUX_ITEM_ADD_ON_CREATE)) + { + kom_errno = KOM_AUX_MODIFY_ONLY; + return FALSE; + } + } + else { - kom_errno = KOM_AUX_PERM; - return FALSE; - } + if (!(can_add_when & AUX_ITEM_ADD_ON_MODIFY)) + { + kom_errno = KOM_AUX_CREATE_ONLY; + return FALSE; + } + } } if (def->system_only) { - kom_errno = KOM_AUX_PERM; + kom_errno = KOM_AUX_SERVER_ONLY; return FALSE; } @@ -1100,12 +1114,8 @@ aux_item_add_perm(const Aux_item *item, /* Even the administrator can't override this */ - kom_errno = KOM_NO_ERROR; if (!aux_item_check_unique(item, def, add_to_list, start_looking_at)) - { - kom_errno = kom_errno?kom_errno:KOM_AUX_PERM; return FALSE; - } /* Check the contents */ @@ -1129,10 +1139,7 @@ aux_item_add_perm(const Aux_item *item, #endif if (aux_item_validate(validation_data) != OK) - { - kom_errno = KOM_ILL_AUX; return FALSE; - } } return TRUE; @@ -1147,6 +1154,8 @@ aux_item_add_perm(const Aux_item *item, * DEF is the item's definitioon * ADD_TO_LIST is the list we want to add to * START_LOOKING_AT is the first index in the list to look at. + * + * Sets kom_errno when it returns FALSE. */ static Bool @@ -1172,13 +1181,16 @@ aux_item_check_unique(const Aux_item *item, && add_to_list->items[i].tag == item->tag && add_to_list->items[i].creator == item->creator && !add_to_list->items[i].flags.deleted) + { + kom_errno = KOM_AUX_EXISTS; return FALSE; + } if (def->unique_data && add_to_list->items[i].tag == item->tag && s_streq(add_to_list->items[i].data, item->data)) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_AUX_DATA_EXISTS; return FALSE; } } @@ -1722,11 +1734,18 @@ text_stat_check_add_aux_item_list(Text_stat *text_s, def = find_aux_item_definition(item); if (def == NULL) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_TAG; err_stat = i; return FAILURE; } - + + if (!def->texts) + { + kom_errno = KOM_AUX_BAD_OBJECT; + err_stat = i; + return FAILURE; + } + if (!aux_item_add_perm(item, def, creating_conn, @@ -1735,8 +1754,7 @@ text_stat_check_add_aux_item_list(Text_stat *text_s, 0, text_s == NULL, TEXT_OBJECT_TYPE) - || !aux_item_check_unique(item, def, list, i + 1) - || !def->texts) + || !aux_item_check_unique(item, def, list, i + 1)) { kom_errno = kom_errno?kom_errno:KOM_AUX_PERM; err_stat = i; @@ -1791,11 +1809,18 @@ conf_stat_check_add_aux_item_list(Conference *conf, def = find_aux_item_definition(item); if (def == NULL) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_TAG; err_stat = i; return FAILURE; } + if (conf->type.letter_box ? !def->letterboxes : !def->confs) + { + kom_errno = KOM_AUX_BAD_OBJECT; + err_stat = i; + return FAILURE; + } + if (!aux_item_add_perm(item, def, creating_conn, @@ -1804,9 +1829,7 @@ conf_stat_check_add_aux_item_list(Conference *conf, 0, creating, CONF_OBJECT_TYPE) - || !aux_item_check_unique(item, def, list, i + 1) - || (!conf->type.letter_box && !def->confs) - || (conf->type.letter_box && !def->letterboxes)) + || !aux_item_check_unique(item, def, list, i + 1)) { kom_errno = kom_errno?kom_errno:KOM_AUX_PERM; err_stat = i; @@ -1855,11 +1878,24 @@ Success system_check_add_aux_item_list(Info *info, def = find_aux_item_definition(item); if (def == NULL) { - kom_errno = KOM_ILL_AUX; + kom_errno = KOM_ILL_AUX_TAG; err_stat = i; return FAILURE; } + if (!def->system) + { + kom_errno = KOM_AUX_BAD_OBJECT; + err_stat = i; + return FAILURE; + } + + if (!aux_item_check_unique(item, def, list, i + 1)) + { + err_stat = i; + return FAILURE; + } + /* Pass creating_conn->pers_no as the subordinate, so that the owner checks will be short-circuited. When we arrive here, we already know that the user has enough privileges to @@ -1872,9 +1908,7 @@ Success system_check_add_aux_item_list(Info *info, &info->aux_item_list, /* add_to_list */ 0, /* start_looking_at */ FALSE, /* creating */ - INFO_OBJECT_TYPE) - || !aux_item_check_unique(item, def, list, i + 1) - || !def->system) + INFO_OBJECT_TYPE)) { kom_errno = kom_errno?kom_errno:KOM_AUX_PERM; err_stat = i; @@ -2117,7 +2151,7 @@ aux_item_trigger_link_item(Aux_item_trigger_data *data) /* - * Aux item validators + * Aux item validators. */ @@ -2129,7 +2163,18 @@ aux_item_validate_existing_text(Aux_item_validation_data *v_data) String_size ill_char; text_no = s_strtol(v_data->item->data, &ill_char); - GET_T_STAT(text_stat, text_no, FAILURE); + if (ill_char != v_data->item->data.len) + { + kom_errno = KOM_ILL_AUX_DATA; + return FAILURE; + } + + text_stat = cached_get_text_stat(text_no); + if (text_stat == NULL) + { + kom_errno = KOM_AUX_NO_SUCH_TEXT; + return FAILURE; + } if (v_data->creating_conn != NULL && text_read_access(v_data->creating_conn, text_no, text_stat)) @@ -2137,5 +2182,6 @@ aux_item_validate_existing_text(Aux_item_validation_data *v_data) return OK; } + kom_errno = KOM_AUX_NO_SUCH_TEXT; return FAILURE; } diff --git a/src/server/testsuite/lyskomd.0/00.exp b/src/server/testsuite/lyskomd.0/00.exp index ab37db0ab45ad9c64337c433773516d0c59d3b08..104c8945e529061d282bcdcb6c9af2f5bfcac78c 100644 --- a/src/server/testsuite/lyskomd.0/00.exp +++ b/src/server/testsuite/lyskomd.0/00.exp @@ -347,7 +347,7 @@ simple_expect "=1056 3 3 1 0 0 \\*" "one map (new-style)" talk_to client 1 send "1057 86 [holl "text0005 failed attempt"] 1 { 0 1 } 1 { 9 00000000 1 [holl "simulated compface data"] }\n" -simple_expect "%1057 49 0" "not allowed to add compface to texts" +simple_expect "%1057 63 0" "not allowed to add compface to texts" send "1058 86 [holl "text0005"] 1 { 0 1 } 1 { 1 00000000 1 [holl "text/plain"] }\n" simple_expect ":18 15 5 $any_time 6 0 8 0 2 { 0 1 6 4 } 1 { 1 1 6 $any_time 00000000 1 [holl "text/plain"] }" "async to c1" diff --git a/src/server/testsuite/lyskomd.0/03.exp b/src/server/testsuite/lyskomd.0/03.exp index 3168c939da11ff36db53c2267bd68220ae53c6aa..feb90b19e2e9aa095f5c6482df4cf3527a4e5d02 100644 --- a/src/server/testsuite/lyskomd.0/03.exp +++ b/src/server/testsuite/lyskomd.0/03.exp @@ -1296,7 +1296,7 @@ send "1344 95 0 { } 2 { 9 00000000 1 [holl "compface must die"] 13 00000000 1 [h simple_expect "=1344" # Attempt to set a nonexisting text as faq for the server. send "1345 95 0 { } 1 { 14 00000000 1 [holl "999"] }\n" -simple_expect "%1345 48 0" +simple_expect "%1345 69 0" send "1346 94\n" simple_expect "=1346 $server_compat_version 1 2 3 4 0 2 { 1 9 5 $any_time 00000000 1 [holl "compface must die"] 2 13 5 $any_time 00000000 1 [holl "maint@kom"] }" @@ -1599,7 +1599,7 @@ send "1440 1\n" simple_expect "=1440" send "1441 89 [holl "Kelly Talisman II"] [holl "the stars"] 00000000 11 { 3 00000000 0 [holl "C6 My Creator"] 3 00000000 0 [holl "C7 Slightly offensive name, huh"] 8 00000000 0 [holl "E-mail:kelly@hotbox.com"] 9 00000000 0 [holl "compface must die"] 10 00000000 0\n" send "[holl "Air"] 12 00000000 0 [holl "PGP public key"] 13 00000000 0 [holl "kelly@hotbox.com"] 30 00000000 0 [holl "2 text/plain"] 30 00000000 0 [holl "2 x-kom/basic"] 33 00000000 1 1H0 14 00000000 0 [holl "3"] }\n" -simple_expect "%1441 48 10" +simple_expect "%1441 69 10" # Disconnect all but the first session diff --git a/src/server/testsuite/lyskomd.0/04.exp b/src/server/testsuite/lyskomd.0/04.exp index 63bc724bcdbf50c38ffb87a7c72f093aebadb297..765417ba447c293ab4db904f38847c3e73bc6d38 100644 --- a/src/server/testsuite/lyskomd.0/04.exp +++ b/src/server/testsuite/lyskomd.0/04.exp @@ -186,7 +186,7 @@ simple_expect "=2022 $any_time 7 0 6 0 3 { 0 9 6 3 2 2 } 2 { 8 1017 7 $any_time # Attempt to add and delete items where add fails send "2023 92 3 1 { 8 } 1 { 10000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2023 49 0" "AIT: Creator adding and deleting with add fail (add)" +simple_expect "%2023 63 0" "AIT: Creator adding and deleting with add fail (add)" send "2024 90 3\n" simple_expect "=2024 $any_time 7 0 6 0 3 { 0 9 6 3 2 2 } 2 { 8 1017 7 $any_time 00000000 0 [holl "D8"] 9 1018 7 $any_time 00000000 0 [holl "D9"] }" "AIT: Creator adding and deleting with add fail (read)" @@ -353,7 +353,7 @@ simple_expect "=2048 [holl "Conference 9"] 00001000 $any_time $any_time 7 0 7 0 # Attempt to add and delete items where add fails send "2049 93 $conf_9 1 { 8 } 1 { 10000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2049 49 0" "AIC: Add and delete where add fails (add)" +simple_expect "%2049 63 0" "AIC: Add and delete where add fails (add)" send "2050 91 $conf_9\n" simple_expect "=2050 [holl "Conference 9"] 00001000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 3 0 2 { 8 1017 7 $any_time 00000000 0 [holl "A8"] 9 1018 7 $any_time 00000000 0 [holl "A9"] }" "AIC: Add and delete where add fails (read)" @@ -526,7 +526,7 @@ simple_expect "=2120 $any_num $any_num $any_num $any_num $any_num $any_num 1 { 7 # Try add and delete with add fail send "2121 95 1 { 7 } 1 { 10001 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2121 49 0" "AIS: Add and delete with add fail (add)" +simple_expect "%2121 63 0" "AIS: Add and delete with add fail (add)" send "2122 94\n" simple_expect "=2122 $any_num $any_num $any_num $any_num $any_num $any_num 1 { 7 1009 5 $any_time 00000000 0 [holl "S7"] }" "AIS: Add and delete with add fail (read)" @@ -596,19 +596,19 @@ extracting_expect "=2200 ($any*) 0 \\*" text_stat 1 # Add text-only to text send "2201 92 4 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2201 49 0" "AIR: Add conf-only to text (add)" +simple_expect "%2201 63 0" "AIR: Add conf-only to text (add)" send "2202 90 4\n" simple_expect "=2202 $text_stat 0 \\*" "AIR: Add conf-only to text (read)" send "2203 92 4 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2203 49 0" "AIR: Add letterbox-only to text (add)" +simple_expect "%2203 63 0" "AIR: Add letterbox-only to text (add)" send "2204 90 4\n" simple_expect "=2204 $text_stat 0 \\*" "AIR: Add letterbox-only to text (read)" send "2205 92 4 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2205 49 0" "AIR: Add system-only to text (add)" +simple_expect "%2205 63 0" "AIR: Add system-only to text (add)" send "2206 90 4\n" simple_expect "=2206 $text_stat 0 \\*" "AIR: Add system-only to text (read)" @@ -629,19 +629,19 @@ send "2300 91 7\n" extracting_expect "=2300 ($any*) 0 \\*" conf_stat 1 send "2301 93 7 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2301 49 0" "AIR: Adding system-only to letterbox (add)" +simple_expect "%2301 63 0" "AIR: Adding system-only to letterbox (add)" send "2302 91 7\n" simple_expect "=2302 $conf_stat 0 \\*" "AIR: Adding system-only to letterbox (read)" send "2303 93 7 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2303 49 0" "AIR: Adding conf-only to letterbox (add)" +simple_expect "%2303 63 0" "AIR: Adding conf-only to letterbox (add)" send "2304 91 7\n" simple_expect "=2304 $conf_stat 0 \\*" "AIR: Adding conf-only to letterbox (read)" send "2305 93 7 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2305 49 0" "AIR: Adding text-only to letterbox (add)" +simple_expect "%2305 63 0" "AIR: Adding text-only to letterbox (add)" send "2306 91 7\n" simple_expect "=2306 $conf_stat 0 \\*" "AIR: Adding text-only to letterbox (read)" @@ -665,19 +665,19 @@ send "2400 91 11\n" extracting_expect "=2400 ($any*) 0 \\*" conf_stat 1 send "2401 93 11 0 { } 1 { 10000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2401 49 0" "AIR: Adding system-only to conf (add)" +simple_expect "%2401 63 0" "AIR: Adding system-only to conf (add)" send "2402 91 11\n" simple_expect "=2402 $conf_stat 0 \\*" "AIR: Adding system-only to conf (read)" send "2403 93 11 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2403 49 0" "AIR: Adding pers-only to conf (add)" +simple_expect "%2403 63 0" "AIR: Adding pers-only to conf (add)" send "2404 91 11\n" simple_expect "=2404 $conf_stat 0 \\*" "AIR: Adding conf-only to conf (read)" send "2405 93 11 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2405 49 0" "AIR: Adding text-only to conf (add)" +simple_expect "%2405 63 0" "AIR: Adding text-only to conf (add)" send "2406 91 11\n" simple_expect "=2406 $conf_stat 0 \\*" "AIR: Adding text-only to conf (read)" @@ -703,19 +703,19 @@ send "2500 94\n" extracting_expect "=2500 ($any*) 0 \\*" info_struct 1 send "2501 95 0 { } 1 { 10003 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2501 49 0" "AIR: Adding pers-only to system (add)" +simple_expect "%2501 63 0" "AIR: Adding pers-only to system (add)" send "2502 94\n" simple_expect "=2502 $info_struct 0 \\*" "AIR: Adding pers-only to system (read)" send "2503 95 0 { } 1 { 10001 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2503 49 0" "AIR: Adding conf-only to system (add)" +simple_expect "%2503 63 0" "AIR: Adding conf-only to system (add)" send "2504 94\n" simple_expect "=2504 $info_struct 0 \\*" "AIR: Adding conf-only to system (read)" send "2505 95 0 { } 1 { 10002 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%2505 49 0" "AIR: Adding text-only to system (add)" +simple_expect "%2505 63 0" "AIR: Adding text-only to system (add)" send "2506 94\n" simple_expect "=2506 $info_struct 0 \\*" "AIR: Adding text-only to system (read)" @@ -752,7 +752,7 @@ simple_expect "=3003 $text_stat 0 \\*" # Check content validation send "3004 92 5 0 { } 1 { 2003 00000000 1 [holl "FAIL"] }\n" -simple_expect "%3004 48 0" +simple_expect "%3004 64 0" send "3005 90 5\n" simple_expect "=3005 $text_stat 0 \\*" @@ -783,7 +783,7 @@ extracting_expect "=4001 ($any*) 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 # Try to add second one-per-person item as person A send "4002 92 6 0 { } 1 { 2006 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%4002 49 0" +simple_expect "%4002 62 0" send "4003 90 6\n" simple_expect "=4003 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }" @@ -799,7 +799,7 @@ simple_expect "=4005 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 # Try to add create-restricted item after create send "4006 92 6 0 { } 1 { 3000 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%4006 49 0" +simple_expect "%4006 65 0" send "4007 90 6\n" simple_expect "=4007 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }" @@ -813,7 +813,7 @@ kom_login 8 "pw3" 0 # Add two one-per-person at once send "4100 92 6 0 { } 2 { 2006 00000000 0 [holl "AOB1"] 2006 00000000 0 [holl "AOB2"] }\n" -simple_expect "%4100 49 0" +simple_expect "%4100 62 0" send "4101 90 6\n" simple_expect "=4101 $text_stat 4 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] }" @@ -831,7 +831,7 @@ simple_expect "=4103 $text_stat 5 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 # Add another one-per-person as person B send "4104 92 6 0 { } 1 { 2006 00000000 0 [holl "AOB1"] }\n" -simple_expect "%4104 49 0" +simple_expect "%4104 62 0" send "4105 90 6\n" simple_expect "=4105 $text_stat 5 { 1 2004 7 $any_time 00000000 0 [holl "AO"] 2 2006 7 $any_time 00000000 0 [holl "UQ"] 3 2007 7 $any_time 00000000 0 [holl "PM"] 4 3000 7 $any_time 00000000 0 [holl "CT"] 5 2006 8 $any_time 00000000 0 [holl "AOB1"] }" @@ -924,7 +924,7 @@ send "4399 91 12\n" extracting_expect "=4399 ($any*)" conf_stat 1 send "4400 93 11 0 { } 1 { 3001 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%4400 49 0" +simple_expect "%4400 65 0" send "4401 91 12\n" simple_expect "=4401 $conf_stat" @@ -939,7 +939,7 @@ send "4402 91 13\n" extracting_expect "=4402 ($any*)" conf_stat 1 send "4403 93 13 0 { } 1 { 3002 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%4403 49 0" +simple_expect "%4403 65 0" send "4404 91 13\n" simple_expect "=4404 $conf_stat" @@ -964,7 +964,7 @@ send "4503 90 7\n" simple_expect "=4503 $any_time 7 0 6 1 2 { 0 9 6 7 } 0 \\*" send "4504 93 14 1 { 1 } 1 { 10000 00000000 0 [holl "FUBAR" ] }\n" -simple_expect "%4504 49 0" +simple_expect "%4504 63 0" send "4505 90 7\n" simple_expect "=4505 $any_time 7 0 6 1 2 { 0 9 6 7 } 0 \\*" diff --git a/src/server/testsuite/lyskomd.0/14.exp b/src/server/testsuite/lyskomd.0/14.exp index 587207c3bd960e2da22003b3b084c092866ebea5..73e9e7448e34ab30857a119cf540e8e40a8628f8 100644 --- a/src/server/testsuite/lyskomd.0/14.exp +++ b/src/server/testsuite/lyskomd.0/14.exp @@ -95,7 +95,7 @@ simple_expect "=1017" # Attempt to add a broken FAQ aux-item with trailing garbage. send "1018 93 4 0 { } 1 { 14 00000000 0 [holl "3garbage"] }\n" -simple_expect "%1018 48 0" +simple_expect "%1018 64 0" # Create a proper FAQ item send "1019 93 4 0 { } 1 { 14 00000000 0 [holl "3"] }\n" diff --git a/src/server/testsuite/lyskomd.0/17.exp b/src/server/testsuite/lyskomd.0/17.exp index 0b8e0fc4167b3b1e2f0553989f76596245e79e9d..a40bf3802b40404cc84d23fc7708d17ab0cbada1 100644 --- a/src/server/testsuite/lyskomd.0/17.exp +++ b/src/server/testsuite/lyskomd.0/17.exp @@ -58,16 +58,16 @@ simple_expect "=1007" # A few invalid values. send "1008 95 0 { } 1 { 29 00000000 1 [holl "4 250 00000000 4"] }\n" -simple_expect "%1008 48 0" +simple_expect "%1008 64 0" send "1009 95 0 { } 1 { 29 00000000 1 [holl "4 00000000"] }\n" -simple_expect "%1009 48 0" +simple_expect "%1009 64 0" send "1010 95 0 { } 1 { 29 00000000 1 [holl "4 2c0 00000000"] }\n" -simple_expect "%1010 48 0" +simple_expect "%1010 64 0" send "1011 95 0 { } 1 { 29 00000000 1 [holl "4 250 00200000"] }\n" -simple_expect "%1011 48 0" +simple_expect "%1011 64 0" # A fourth valid item. send "1012 95 0 { } 1 { 29 00000000 1 [holl "4 190 00000000"] }\n" diff --git a/src/server/testsuite/lyskomd.0/20.exp b/src/server/testsuite/lyskomd.0/20.exp index 38c07b6693048ccafabe28767f186fda2106f657..4bcd939b047e9d7c127520b7a5d2c77c6f1cf00c 100644 --- a/src/server/testsuite/lyskomd.0/20.exp +++ b/src/server/testsuite/lyskomd.0/20.exp @@ -24,24 +24,6 @@ # Check the aux-items added in lyskomd 2.0.5 (31, 32, 10100-10104). # Check the syntax of mx-date (21). - -# We currently get aux-item-permission (49) instead of illegal-aux-item (48) -# in several places. -proc want_illegal_aux_item {tst} { - global test - global errorcode - - set test "$tst" - setup_xfail "*-*-*" "Bug 192" - if {$errorcode == 48} { - pass "$test" - } else { - fail "$test" - } - unset test -} - - proc enable {} { send "990 42 255\n" simple_expect "=990" @@ -86,8 +68,7 @@ simple_expect "=1004 $server_compat_version 1 2 3 4 0 1 { 1 31 5 $any_time 00000 # Check that we cannot have more than one canonical-name. send "1005 95 0 { } 1 { 31 00000000 1 [holl "foo.bar.se"] }\n" -extracting_expect "%1005 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for duplicate canonical-name" +simple_expect "%1005 62 0" send "1006 94\n" simple_expect "=1006 $server_compat_version 1 2 3 4 0 1 { 1 31 5 $any_time 00000000 1 [holl "foo.bar.gazonk"] }" @@ -106,7 +87,7 @@ proc set_bad_canonical_name {tag} { global any_time send "998 95 1 { 2 } 1 { 31 00000000 1 [holl "$tag"] }\n" - simple_expect "%998 48 0" + simple_expect "%998 64 0" send "999 94\n" simple_expect "=999 $server_compat_version 1 2 3 4 0 1 { 2 31 5 $any_time 00000000 1 [holl "foo.bar.gazonk:942"] }" @@ -132,16 +113,13 @@ simple_expect "=1010 $server_compat_version 1 2 3 4 0 1 { 3 31 5 $any_time 00000 disable send "1011 86 [holl "foo"] 0 { } 1 { 31 00000000 1 [holl "kom.liu.se"] }\n" -extracting_expect "%1011 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for canonical-name on text" +simple_expect "%1011 63 0" send "1012 89 [holl "person foo"] [holl "password"] 00000000 1 { 31 00000000 1 [holl "kom.liu.se"] }\n" -extracting_expect "%1012 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for canonical-name on person" +simple_expect "%1012 63 0" send "1013 88 [holl "conference foo"] 00000000 1 { 31 00000000 1 [holl "kom.liu.se"] }\n" -extracting_expect "%1013 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for canonical-name on conference" +simple_expect "%1013 63 0" # # Test mx-list-name (32). @@ -151,20 +129,17 @@ want_illegal_aux_item "Correct error code for canonical-name on conference" enable send "1014 95 0 { } 1 { 32 00000000 1 [holl "foo@bar.com"] }\n" -extracting_expect "%1014 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-list-name on system." +simple_expect "%1014 63 0" disable # Not on text. send "1015 86 [holl "foo"] 0 { } 1 { 32 00000000 1 [holl "foo@bar.com"] }\n" -extracting_expect "%1015 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-list-name on text" +simple_expect "%1015 63 0" # Not on person. send "1016 89 [holl "person 6"] [holl "password"] 00000000 1 { 32 00000000 1 [holl "foo@bar.com"] }\n" -extracting_expect "%1016 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-list-name on person" +simple_expect "%1016 63 0" # On conference. send "1017 88 [holl "conference 6"] 00000000 1 { 32 00000000 1 [holl "foo@bar.com"] }\n" @@ -190,7 +165,7 @@ proc set_bad_list_name {item} { global any_time send "992 93 $aconf 1 { 1 } 1 { 32 00000000 1 [holl "$item"] }\n" - simple_expect "%992 48 0" + simple_expect "%992 64 0" send "993 91 $aconf\n" simple_expect "=993 [holl "conference 6"] 00000000 $any_time $any_time 5 0 5 0 5 0 77 77 0 1 0 0 1 { 1 32 5 $any_time 00000000 1 [holl "foo@bar.com"] }" @@ -209,7 +184,7 @@ set_bad_list_name "" # Set up a "reverse" link: the subpart is entered first. send "1018 86 [holl "part"] 1 { 0 $aconf } 1 { 10100 00000000 1 [holl "1"] }\n" -simple_expect "%1018 48 0" +simple_expect "%1018 69 0" send "1019 86 [holl "part"] 1 { 0 $aconf } 0 { }\n" simple_expect "=1019 1" @@ -223,7 +198,7 @@ simple_expect "=1021" # Set up a "forward" link: the root is entered first. send "1022 86 [holl "root"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "4"] }\n" -simple_expect "%1022 48 0" +simple_expect "%1022 69 0" send "1023 86 [holl "root"] 1 { 0 $aconf } 0 { }\n" simple_expect "=1023 3" @@ -237,48 +212,44 @@ simple_expect "=1025" # Try a few broken text numbers. send "1026 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "99"] }\n" -simple_expect "%1026 48 0" +simple_expect "%1026 69 0" send "1027 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "t"] }\n" -simple_expect "%1027 48 0" +simple_expect "%1027 64 0" send "1028 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl ""] }\n" -simple_expect "%1028 48 0" +simple_expect "%1028 64 0" send "1029 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "0"] }\n" -simple_expect "%1029 48 0" +simple_expect "%1029 69 0" send "1030 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "-4711"] }\n" -simple_expect "%1030 48 0" +simple_expect "%1030 64 0" send "1031 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "-1"] }\n" -simple_expect "%1031 48 0" +simple_expect "%1031 64 0" send "1032 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "+1"] }\n" -simple_expect "%1032 48 0" +simple_expect "%1032 64 0" send "1033 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl " 1"] }\n" -simple_expect "%1033 48 0" +simple_expect "%1033 64 0" send "1034 86 [holl "t"] 1 { 0 $aconf } 1 { 10101 00000000 1 [holl "1 "] }\n" -simple_expect "%1034 48 0" +simple_expect "%1034 64 0" # Not on conferences. send "1035 88 [holl "badconf 1"] 00000000 1 { 10100 00000000 1 [holl "1"] }\n" -extracting_expect "%1035 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on conference" +simple_expect "%1035 63 0" send "1036 88 [holl "badconf 2"] 00000000 1 { 10101 00000000 1 [holl "1"] }\n" -extracting_expect "%1036 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-part-in on conference" +simple_expect "%1036 63 0" # Not on persons. send "1037 89 [holl "badperson 1"] [holl "password"] 00000000 1 { 10100 00000000 1 [holl "1"] }\n" -extracting_expect "%1037 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on person" +simple_expect "%1037 63 0" "Correct error code for mx-mime-belongs-to on person" send "1038 89 [holl "badperson 1"] [holl "password"] 00000000 1 { 10101 00000000 1 [holl "1"] }\n" -extracting_expect "%1038 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-part-in on person" +simple_expect "%1038 63 0" "Correct error code for mx-mime-part-in on person" # @@ -291,27 +262,21 @@ simple_expect "=1039 5" # Not on conferences. send "1040 88 [holl "badconf 1"] 00000000 1 { 10102 00000000 1 [holl "header"] }\n" -extracting_expect "%1040 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on conference" +simple_expect "%1040 63 0" "Correct error code for mx-mime-belongs-to on conference" send "1041 88 [holl "badconf 1"] 00000000 1 { 10103 00000000 1 [holl "1"] }\n" -extracting_expect "%1041 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on conference" +simple_expect "%1041 63 0" "Correct error code for mx-mime-belongs-to on conference" send "1042 88 [holl "badconf 2"] 00000000 1 { 10104 00000000 1 [holl "1"] }\n" -extracting_expect "%1042 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-part-in on conference" +simple_expect "%1042 63 0" "Correct error code for mx-mime-part-in on conference" # Not on persons. send "1043 89 [holl "badperson 1"] [holl "password"] 00000000 1 { 10102 00000000 1 [holl "header"] }\n" -extracting_expect "%1043 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on person" +simple_expect "%1043 63 0" "Correct error code for mx-mime-belongs-to on person" send "1044 89 [holl "badperson 1"] [holl "password"] 00000000 1 { 10103 00000000 1 [holl "1"] }\n" -extracting_expect "%1044 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-belongs-to on person" +simple_expect "%1044 63 0" "Correct error code for mx-mime-belongs-to on person" send "1045 89 [holl "badperson 1"] [holl "password"] 00000000 1 { 10104 00000000 1 [holl "1"] }\n" -extracting_expect "%1045 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for mx-mime-part-in on person" +simple_expect "%1045 63 0" "Correct error code for mx-mime-part-in on person" # @@ -325,10 +290,10 @@ send "1047 90 6\n" simple_expect "=1047 $any_time 5 0 13 0 2 { 0 $aconf 6 6 } 1 { 1 21 5 $any_time 00000111 99 [holl "2001-09-30 13:52:37"] }" send "1048 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl " 2001-09-30 13:52:37"] }\n" -simple_expect "%1048 48 0" +simple_expect "%1048 64 0" send "1049 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52:37 "] }\n" -simple_expect "%1049 48 0" +simple_expect "%1049 64 0" send "1050 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 00000000 1 [holl "2001-09-30 13:52:37 +0200"] }\n" simple_expect "=1050 7" @@ -343,19 +308,19 @@ send "1053 90 8\n" simple_expect "=1053 $any_time 5 0 13 0 2 { 0 $aconf 6 8 } 1 { 1 21 5 $any_time 00000000 1 [holl "2001-09-30 13:52:37 -1150"] }" send "1054 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52:37 GMT"] }\n" -simple_expect "%1054 48 0" +simple_expect "%1054 64 0" send "1055 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52:37 +0200 "] }\n" -simple_expect "%1055 48 0" +simple_expect "%1055 64 0" send "1056 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52:37 +0200"] }\n" -simple_expect "%1056 48 0" +simple_expect "%1056 64 0" send "1057 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52 +0200"] }\n" -simple_expect "%1057 48 0" +simple_expect "%1057 64 0" send "1058 86 [holl "imported mail"] 1 { 0 $aconf } 1 { 21 11111111 99 [holl "2001-09-30 13:52"] }\n" -simple_expect "%1058 48 0" +simple_expect "%1058 64 0" # # Shut down diff --git a/src/server/testsuite/lyskomd.0/21.exp b/src/server/testsuite/lyskomd.0/21.exp index 3252cf9fdc85807c8c56ff8d4b1f5de50f4d469c..aa0adf2746d65d4b0ab34e804326550e39fbe3a4 100644 --- a/src/server/testsuite/lyskomd.0/21.exp +++ b/src/server/testsuite/lyskomd.0/21.exp @@ -535,8 +535,100 @@ simple_expect "%1111 49 0" # Check that Conference 12 and text 1 looks OK. send "1112 91 12\n" simple_expect "=1112 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { 12 14 11 $any_time 00000000 1 [holl "1"] }" -send "1105 90 1\n" -simple_expect "=1105 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 00001000 0 [holl "12"] }" +send "1113 90 1\n" +simple_expect "=1113 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 00001000 0 [holl "12"] }" + +# Attempt to set a duplicate faq-text on Conference 12. + +talk_to client 2 + +send "1114 93 12 0 { } 1 { 14 00000000 1 [holl "1"] }\n" +simple_expect "%1114 68 0" + +# Attempt to remote a faq-text and add it back later. + +send "1115 93 12 1 { 12 } 0 { }\n" +simple_expect "=1115" +send "1116 93 12 0 { } 1 { 14 00000000 1 [holl "1"] }\n" +simple_expect "=1116" + +# Attempt to remote a faq-text and add it back in the same operation. +# This should work, but currently fails. + +send "1117 93 12 1 { 13 } 1 { 14 00000000 1 [holl "1"] }\n" +if {0} { + simple_expect "=1117" + set aux 14 +} else { + simple_expect "%1117 68 0" + setup_xfail "*-*-*" "Bug 1614" + fail "Removing and adding back the same faq-text aux-item in a single operation (got KOM_AUX_DATA_EXISTS)" + set aux 13 +} + +send "1118 91 12\n" +simple_expect "=1118 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { $aux 14 7 $any_time 00000000 1 [holl "1"] }" + +# Attempt to remove one faq-text and add back two instances of the same faq-text. + +send "1119 93 12 1 { $aux } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "1"] }\n" +extracting_expect "%1119 68 ($any_num)" dupaux 1 +set test "correct aux-item flagged as duplicate when adding back two instances of the same faq-text" +if {$dupaux == 1} { + pass "$test" +} else { + if {$dupaux == 0} { + setup_xfail "*-*-*" "Bug 1615" + } + fail "$test (got $dupaux instead of 1)" +} +unset test + +send "1120 91 12\n" +simple_expect "=1120 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 1 { $aux 14 7 $any_time 00000000 1 [holl "1"] }" + +# Remove the faq-text. Then, attempt to add it two identical faq-texts at once. + +send "1121 93 12 1 { $aux } 0 { }\n" +simple_expect "=1121" +send "1122 93 12 0 { } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "1"] }\n" +extracting_expect "%1122 68 ($any_num)" dupaux 1 +set test "correct aux-item flagged as duplicate when adding two identixal faq-texts" +if {$dupaux == 1} { + pass "$test" +} else { + if {$dupaux == 0} { + setup_xfail "*-*-*" "Bug 1615" + } + fail "$test (got $dupaux instead of 1)" +} +unset test + +send "1123 91 12\n" +simple_expect "=1123 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 1 0 0 \\*" + +# Add two faq-texts in a single operation. One points to an non-existing text. +send "1124 93 12 0 { } 2 { 14 00000000 1 [holl "1"] 14 00000000 1 [holl "2"] }\n" +simple_expect "%1124 69 1" +send "1125 93 12 0 { } 2 { 14 00000000 1 [holl "2"] 14 00000000 1 [holl "1"] }\n" +simple_expect "%1125 69 0" + +# Create text 2 +send "1126 86 [holl "Text 2"] 1 { 0 12 } 0 { }\n" +simple_expect "=1126 2" + +# Add two faq-texts in a single operation. +send "1127 93 12 0 { } 2 { 14 00000000 1 [holl "2"] 14 00000000 1 [holl "1"] }\n" +simple_expect "=1127" + +# Check that Conference 12 and texts 1 and 2 looks OK. +send "1128 91 12\n" +simple_expect "=1128 [holl "Conference 12"] 00000000 $any_time $any_time 7 0 7 0 7 0 77 77 0 1 2 0 2 { [expr {$aux + 1}] 14 7 $any_time 00000000 1 [holl "2"] [expr {$aux + 2}] 14 7 $any_time 00000000 1 [holl "1"] }" +send "1129 90 1\n" +simple_expect "=1129 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 8 28 7 $any_time 00001000 0 [holl "12"] }" +send "1130 90 2\n" +simple_expect "=1130 $any_time 7 0 6 0 2 { 0 12 6 2 } 1 { 1 28 7 $any_time 00001000 0 [holl "12"] }" + # @@ -544,41 +636,41 @@ simple_expect "=1105 $any_time 7 0 6 0 2 { 0 12 6 1 } 1 { 6 28 11 $any_time 0000 # talk_to client 6 -send "1113 55 0\n" -simple_expect "=1113" +send "1131 55 0\n" +simple_expect "=1131" client_death 6 talk_to client 5 -send "1114 55 0\n" -simple_expect "=1114" +send "1132 55 0\n" +simple_expect "=1132" client_death 5 talk_to client 4 -send "1115 55 0\n" -simple_expect "=1115" +send "1133 55 0\n" +simple_expect "=1133" client_death 4 talk_to client 3 -send "1116 55 0\n" -simple_expect "=1116" +send "1134 55 0\n" +simple_expect "=1134" client_death 3 talk_to client 2 -send "1117 55 0\n" -simple_expect "=1117" +send "1135 55 0\n" +simple_expect "=1135" client_death 2 talk_to client 1 -send "1118 55 0\n" -simple_expect "=1118" +send "1136 55 0\n" +simple_expect "=1136" client_death 1 talk_to client 0 -send "1119 42 255\n" -simple_expect "=1119" +send "1137 42 255\n" +simple_expect "=1137" -send "1120 44 0\n" -simple_expect "=1120" +send "1138 44 0\n" +simple_expect "=1138" client_death 0 lyskomd_death diff --git a/src/server/testsuite/lyskomd.0/23.exp b/src/server/testsuite/lyskomd.0/23.exp index 671bb25c2317d47a0bc6bb65ede1d33f51a8372d..af623c56f38f2edffe5b59fa7b0d6dd0b0ce3067 100644 --- a/src/server/testsuite/lyskomd.0/23.exp +++ b/src/server/testsuite/lyskomd.0/23.exp @@ -51,22 +51,6 @@ # 2. Created by 6. Recipients: 9. # 3. Created by 6. Recipients: 10. -# We currently get aux-item-permission (49) instead of illegal-aux-item (48) -# in several places. -proc want_illegal_aux_item {tst} { - global test - global errorcode - - set test "$tst" - setup_xfail "*-*-*" "Bug 192" - if {$errorcode == 48} { - pass "$test" - } else { - fail "$test" - } - unset test -} - proc enable {} { send "990 42 255\n" simple_expect "=990" @@ -143,65 +127,55 @@ set next_conf 11 # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 1 send "1014 88 [holl "conf $next_conf I"] 00000000 1 { 33 00000000 1 [holl "0"] }\n" -extracting_expect "%1014 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1014 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "1" while creating a conference. # Should fail, since we can only set send-comments-to on letterboxes. send "1015 88 [holl "conf $next_conf II"] 00000000 1 { 33 00000000 1 [holl "1"] }\n" -extracting_expect "%1015 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1015 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "0" while creating a text. # Should fail, since we can only set send-comments-to on letterboxes. send "1016 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "0"] }\n" -extracting_expect "%1016 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1016 63 0" "Correct error code for send-comments-to on texts" # Attempt to set "1" while creating a text. # Should fail, since we can only set send-comments-to on letterboxes. send "1017 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "1"] }\n" -extracting_expect "%1017 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1017 63 0" "Correct error code for send-comments-to on texts" # Attempt to set "0" on system while enabled. # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 0 enable send "1018 95 0 { } 1 { 33 00000000 1 [holl "0"] }\n" -extracting_expect "%1018 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1018 63 0" "Correct error code for send-comments-to on system" # Attempt to set "1" on system while enabled. # Should fail, since we can only set send-comments-to on letterboxes. send "1019 95 0 { } 1 { 33 00000000 1 [holl "1"] }\n" -extracting_expect "%1019 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1019 63 0" "Correct error code for send-comments-to on system" # Attempt to set "0" on an existing conference. # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 1 send "1020 93 10 0 { } 1 { 33 00000000 1 [holl "0"] }\n" -extracting_expect "%1020 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1020 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "1" on an existing conference. # Should fail, since we can only set send-comments-to on letterboxes. send "1021 93 10 0 { } 1 { 33 00000000 1 [holl "1"] }\n" -extracting_expect "%1021 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1021 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "0" on an existing text. # Should fail, since we can only set send-comments-to on letterboxes. send "1022 92 3 0 { } 1 { 33 00000000 1 [holl "0"] }\n" -extracting_expect "%1022 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1022 63 0" "Correct error code for send-comments-to on text" # Attempt to set "1" on an existing text. # Should fail, since we can only set send-comments-to on letterboxes. send "1023 92 3 0 { } 1 { 33 00000000 1 [holl "1"] }\n" -extracting_expect "%1023 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1023 63 0" "Correct error code for send-comments-to on text" # Attempt to set "0" while creating a person. # Should work. @@ -347,37 +321,37 @@ simple_expect "=1040" # They should all fail. talk_to client 1 send "1041 93 6 0 { } 1 { 33 00000000 1 [holl ""] }\n" -simple_expect "%1041 48 0" +simple_expect "%1041 64 0" send "1042 93 6 0 { } 1 { 33 00000000 1 [holl " "] }\n" -simple_expect "%1042 48 0" +simple_expect "%1042 64 0" send "1043 93 6 0 { } 1 { 33 00000000 1 [holl "-1"] }\n" -simple_expect "%1043 48 0" +simple_expect "%1043 64 0" send "1044 93 6 0 { } 1 { 33 00000000 1 [holl "-6"] }\n" -simple_expect "%1044 48 0" +simple_expect "%1044 64 0" send "1045 93 6 0 { } 1 { 33 00000000 1 [holl "a"] }\n" -simple_expect "%1045 48 0" +simple_expect "%1045 64 0" send "1046 93 6 0 { } 1 { 33 00000000 1 [holl "0a"] }\n" -simple_expect "%1046 48 0" +simple_expect "%1046 64 0" send "1047 93 6 0 { } 1 { 33 00000000 1 [holl "0x0a"] }\n" -simple_expect "%1047 48 0" +simple_expect "%1047 64 0" send "1048 93 6 0 { } 1 { 33 00000000 1 [holl "06"] }\n" -simple_expect "%1048 48 0" +simple_expect "%1048 64 0" send "1049 93 6 0 { } 1 { 33 00000000 1 [holl "5 2"] }\n" -simple_expect "%1049 48 0" +simple_expect "%1049 64 0" send "1050 93 6 0 { } 1 { 33 00000000 1 [holl "5 5"] }\n" -simple_expect "%1050 48 0" +simple_expect "%1050 64 0" send "1051 93 6 0 { } 1 { 33 00000000 1 [holl "5 "] }\n" -simple_expect "%1051 48 0" +simple_expect "%1051 64 0" send "1052 93 6 0 { } 1 { 33 00000000 1 [holl " 5 "] }\n" -simple_expect "%1052 48 0" +simple_expect "%1052 64 0" send "1053 93 6 0 { } 1 { 33 00000000 1 [holl " 5"] }\n" -simple_expect "%1053 48 0" +simple_expect "%1053 64 0" send "1054 93 6 0 { } 1 { 33 00000000 1 [holl "0 "] }\n" -simple_expect "%1054 48 0" +simple_expect "%1054 64 0" send "1055 93 6 0 { } 1 { 33 00000000 1 [holl " 0 "] }\n" -simple_expect "%1055 48 0" +simple_expect "%1055 64 0" send "1056 93 6 0 { } 1 { 33 00000000 1 [holl " 0"] }\n" -simple_expect "%1056 48 0" +simple_expect "%1056 64 0" # Set to "0". send "1057 94\n" diff --git a/src/server/testsuite/lyskomd.0/26.exp b/src/server/testsuite/lyskomd.0/26.exp index 1c021e2a5ba471f63f91dbbceaa2d41f5a22133d..42c4558a085dbc4b0ed7569ba31f1a6287312688 100644 --- a/src/server/testsuite/lyskomd.0/26.exp +++ b/src/server/testsuite/lyskomd.0/26.exp @@ -24,22 +24,6 @@ # Check the world-readable (33) aux-items. -# We currently get aux-item-permission (49) instead of illegal-aux-item (48) -# in several places. -proc want_illegal_aux_item {tst} { - global test - global errorcode - - set test "$tst" - setup_xfail "*-*-*" "Bug 192" - if {$errorcode == 48} { - pass "$test" - } else { - fail "$test" - } - unset test -} - lyskomd_start # Client 0, person 5, logged in as admin. @@ -70,23 +54,23 @@ simple_expect "=1005 1" send "1006 86 [holl "text 2"] 1 { 0 1 } 1 { 34 01111000 20 [holl ""] }\n" simple_expect "=1006 2" send "1007 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl " "] }\n" -simple_expect "%1007 48 0" +simple_expect "%1007 64 0" send "1008 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "^$"] }\n" -simple_expect "%1008 48 0" +simple_expect "%1008 64 0" send "1009 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "^"] }\n" -simple_expect "%1009 48 0" +simple_expect "%1009 64 0" send "1010 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "$"] }\n" -simple_expect "%1010 48 0" +simple_expect "%1010 64 0" send "1011 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "@"] }\n" -simple_expect "%1011 48 0" +simple_expect "%1011 64 0" send "1012 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "."] }\n" -simple_expect "%1012 48 0" +simple_expect "%1012 64 0" send "1013 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl ".*"] }\n" -simple_expect "%1013 48 0" +simple_expect "%1013 64 0" send "1014 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "1"] }\n" -simple_expect "%1014 48 0" +simple_expect "%1014 64 0" send "1015 86 [holl "failed"] 1 { 0 1 } 1 { 34 01111000 20 [holl "xyzzy"] }\n" -simple_expect "%1015 48 0" +simple_expect "%1015 64 0" send "1016 86 [holl "text 3"] 0 { } 1 { 34 00000000 1 [holl ""] }\n" simple_expect "=1016 3" send "1017 86 [holl "text 4"] 1 { 0 1 } 0 { }\n" @@ -197,8 +181,7 @@ talk_to client 1 # world-readable is already set, and unique, so this fails. send "1056 92 3 0 { } 1 { 34 00000000 1 [holl ""] }\n" -extracting_expect "%1056 (48|49) 0" errorcode 1 -want_illegal_aux_item "Attempt to add duplicate world-readable, wich is unique" +simple_expect "%1056 62 0" "Attempt to add duplicate world-readable, wich is unique" send "1057 92 4 0 { } 1 { 34 00000000 1 [holl ""] }\n" simple_expect "=1057" diff --git a/src/server/testsuite/lyskomd.0/28.exp b/src/server/testsuite/lyskomd.0/28.exp index e06ec1b7e3bc6db88fe4f72459df180ed26326f8..bfeeaec47090bc66c6642df859b519f06a5a5a58 100644 --- a/src/server/testsuite/lyskomd.0/28.exp +++ b/src/server/testsuite/lyskomd.0/28.exp @@ -51,22 +51,6 @@ # 2. Created by 6. Recipients: 9. # 3. Created by 6. Recipients: 10. -# We currently get aux-item-permission (49) instead of illegal-aux-item (48) -# in several places. -proc want_illegal_aux_item {tst} { - global test - global errorcode - - set test "$tst" - setup_xfail "*-*-*" "Bug 192" - if {$errorcode == 48} { - pass "$test" - } else { - fail "$test" - } - unset test -} - proc enable {} { send "990 42 255\n" simple_expect "=990" @@ -143,145 +127,115 @@ set next_conf 11 # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 1 send "1014 88 [holl "conf $next_conf I"] 00000000 1 { 33 00000000 1 [holl "0 0"] }\n" -extracting_expect "%1014 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1014 63 0" "Correct error code for send-comments-to on conference" send "1015 88 [holl "conf $next_conf I"] 00000000 1 { 33 00000000 1 [holl "0 1"] }\n" -extracting_expect "%1015 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1015 63 0" "Correct error code for send-comments-to on conference" send "1016 88 [holl "conf $next_conf I"] 00000000 1 { 33 00000000 1 [holl "0 15"] }\n" -extracting_expect "%1016 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1016 63 0" "Correct error code for send-comments-to on conference" send "1017 88 [holl "conf $next_conf I"] 00000000 1 { 33 00000000 1 [holl "0 2"] }\n" -simple_expect "%1017 48 0" +simple_expect "%1017 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "1" while creating a conference. # Should fail, since we can only set send-comments-to on letterboxes. send "1018 88 [holl "conf $next_conf II"] 00000000 1 { 33 00000000 1 [holl "1 0"] }\n" -extracting_expect "%1018 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1018 63 0" "Correct error code for send-comments-to on conference" send "1019 88 [holl "conf $next_conf II"] 00000000 1 { 33 00000000 1 [holl "1 1"] }\n" -extracting_expect "%1019 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1019 63 0" "Correct error code for send-comments-to on conference" send "1020 88 [holl "conf $next_conf II"] 00000000 1 { 33 00000000 1 [holl "1 15"] }\n" -extracting_expect "%1020 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1020 63 0" "Correct error code for send-comments-to on conference" send "1021 88 [holl "conf $next_conf II"] 00000000 1 { 33 00000000 1 [holl "1 13"] }\n" -simple_expect "%1021 48 0" +simple_expect "%1021 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "0" while creating a text. # Should fail, since we can only set send-comments-to on letterboxes. send "1022 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "0 0"] }\n" -extracting_expect "%1022 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1022 63 0" "Correct error code for send-comments-to on texts" send "1023 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "0 1"] }\n" -extracting_expect "%1023 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1023 63 0" "Correct error code for send-comments-to on texts" send "1024 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "0 15"] }\n" -extracting_expect "%1024 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1024 63 0" "Correct error code for send-comments-to on texts" send "1025 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "0 7"] }\n" -simple_expect "%1025 48 0" +simple_expect "%1025 63 0" "Correct error code for send-comments-to on texts" # Attempt to set "1" while creating a text. # Should fail, since we can only set send-comments-to on letterboxes. send "1026 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "1 0"] }\n" -extracting_expect "%1026 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1026 63 0" "Correct error code for send-comments-to on texts" send "1027 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "1 1"] }\n" -extracting_expect "%1027 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1027 63 0" "Correct error code for send-comments-to on texts" send "1028 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "1 15"] }\n" -extracting_expect "%1028 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on texts" +simple_expect "%1028 63 0" "Correct error code for send-comments-to on texts" send "1029 86 [holl "text N"] 1 { 0 1 } 1 { 33 00000000 1 [holl "1 16"] }\n" -simple_expect "%1029 48 0" errorcode 1 +simple_expect "%1029 63 0" "Correct error code for send-comments-to on texts" # Attempt to set "0" on system while enabled. # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 0 enable send "1030 95 0 { } 1 { 33 00000000 1 [holl "0 0"] }\n" -extracting_expect "%1030 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1030 63 0" "Correct error code for send-comments-to on system" send "1031 95 0 { } 1 { 33 00000000 1 [holl "0 1"] }\n" -extracting_expect "%1031 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1031 63 0" "Correct error code for send-comments-to on system" send "1032 95 0 { } 1 { 33 00000000 1 [holl "0 15"] }\n" -extracting_expect "%1032 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1032 63 0" "Correct error code for send-comments-to on system" send "1033 95 0 { } 1 { 33 00000000 1 [holl "0 3"] }\n" -simple_expect "%1033 48 0" errorcode 1 +simple_expect "%1033 63 0" "Correct error code for send-comments-to on system" # Attempt to set "1" on system while enabled. # Should fail, since we can only set send-comments-to on letterboxes. send "1034 95 0 { } 1 { 33 00000000 1 [holl "1 0"] }\n" -extracting_expect "%1034 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1034 63 0" "Correct error code for send-comments-to on system" send "1035 95 0 { } 1 { 33 00000000 1 [holl "1 1"] }\n" -extracting_expect "%1035 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1035 63 0" "Correct error code for send-comments-to on system" send "1036 95 0 { } 1 { 33 00000000 1 [holl "1 15"] }\n" -extracting_expect "%1036 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on system" +simple_expect "%1036 63 0" "Correct error code for send-comments-to on system" send "1037 95 0 { } 1 { 33 00000000 1 [holl "1 4"] }\n" -simple_expect "%1037 48 0" +simple_expect "%1037 63 0" "Correct error code for send-comments-to on system" # Attempt to set "0" on an existing conference. # Should fail, since we can only set send-comments-to on letterboxes. talk_to client 1 send "1038 93 10 0 { } 1 { 33 00000000 1 [holl "0 0"] }\n" -extracting_expect "%1038 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1038 63 0" "Correct error code for send-comments-to on conference" send "1039 93 10 0 { } 1 { 33 00000000 1 [holl "0 1"] }\n" -extracting_expect "%1039 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1039 63 0" "Correct error code for send-comments-to on conference" send "1040 93 10 0 { } 1 { 33 00000000 1 [holl "0 15"] }\n" -extracting_expect "%1040 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1040 63 0" "Correct error code for send-comments-to on conference" send "1041 93 10 0 { } 1 { 33 00000000 1 [holl "0 5"] }\n" -simple_expect "%1041 48 0" +simple_expect "%1041 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "1" on an existing conference. # Should fail, since we can only set send-comments-to on letterboxes. send "1042 93 10 0 { } 1 { 33 00000000 1 [holl "1 0"] }\n" -extracting_expect "%1042 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1042 63 0" "Correct error code for send-comments-to on conference" send "1043 93 10 0 { } 1 { 33 00000000 1 [holl "1 1"] }\n" -extracting_expect "%1043 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1043 63 0" "Correct error code for send-comments-to on conference" send "1044 93 10 0 { } 1 { 33 00000000 1 [holl "1 15"] }\n" -extracting_expect "%1044 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on conference" +simple_expect "%1044 63 0" "Correct error code for send-comments-to on conference" send "1045 93 10 0 { } 1 { 33 00000000 1 [holl "1 6"] }\n" -simple_expect "%1045 48 0" +simple_expect "%1045 63 0" "Correct error code for send-comments-to on conference" # Attempt to set "0" on an existing text. # Should fail, since we can only set send-comments-to on letterboxes. send "1046 92 3 0 { } 1 { 33 00000000 1 [holl "0 0"] }\n" -extracting_expect "%1046 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1046 63 0" "Correct error code for send-comments-to on text" send "1047 92 3 0 { } 1 { 33 00000000 1 [holl "0 1"] }\n" -extracting_expect "%1047 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1047 63 0" "Correct error code for send-comments-to on text" send "1048 92 3 0 { } 1 { 33 00000000 1 [holl "0 15"] }\n" -extracting_expect "%1048 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1048 63 0" "Correct error code for send-comments-to on text" send "1049 92 3 0 { } 1 { 33 00000000 1 [holl "0 8"] }\n" -simple_expect "%1049 48 0" +simple_expect "%1049 63 0" "Correct error code for send-comments-to on text" # Attempt to set "1" on an existing text. # Should fail, since we can only set send-comments-to on letterboxes. send "1050 92 3 0 { } 1 { 33 00000000 1 [holl "1 0"] }\n" -extracting_expect "%1050 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1050 63 0" "Correct error code for send-comments-to on text" send "1051 92 3 0 { } 1 { 33 00000000 1 [holl "1 1"] }\n" -extracting_expect "%1051 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1051 63 0" "Correct error code for send-comments-to on text" send "1052 92 3 0 { } 1 { 33 00000000 1 [holl "1 15"] }\n" -extracting_expect "%1052 (48|49) 0" errorcode 1 -want_illegal_aux_item "Correct error code for send-comments-to on text" +simple_expect "%1052 63 0" "Correct error code for send-comments-to on text" send "1053 92 3 0 { } 1 { 33 00000000 1 [holl "1 9"] }\n" -simple_expect "%1053 48 0" +simple_expect "%1053 63 0" "Correct error code for send-comments-to on text" # Attempt to set "0" while creating a person. # Should work. @@ -372,7 +326,7 @@ simple_expect "=1061" # Set "10", a secret conference that is visible to the # administrator and to person 6. Should work. send "1062 93 6 0 { } 1 { 33 00000000 1 [holl "10 2"] }\n" -simple_expect "%1062 48 0" +simple_expect "%1062 64 0" send "1063 93 6 0 { } 1 { 33 00000000 1 [holl "10 0"] }\n" simple_expect "=1063" @@ -429,37 +383,37 @@ simple_expect "=1071" # They should all fail. talk_to client 1 send "1072 93 6 0 { } 1 { 33 00000000 1 [holl " 0"] }\n" -simple_expect "%1072 48 0" +simple_expect "%1072 64 0" send "1073 93 6 0 { } 1 { 33 00000000 1 [holl " 1"] }\n" -simple_expect "%1073 48 0" +simple_expect "%1073 64 0" send "1074 93 6 0 { } 1 { 33 00000000 1 [holl "-1 1"] }\n" -simple_expect "%1074 48 0" +simple_expect "%1074 64 0" send "1075 93 6 0 { } 1 { 33 00000000 1 [holl "-6 1"] }\n" -simple_expect "%1075 48 0" +simple_expect "%1075 64 0" send "1076 93 6 0 { } 1 { 33 00000000 1 [holl "a 2"] }\n" -simple_expect "%1076 48 0" +simple_expect "%1076 64 0" send "1077 93 6 0 { } 1 { 33 00000000 1 [holl "0a 2"] }\n" -simple_expect "%1077 48 0" +simple_expect "%1077 64 0" send "1078 93 6 0 { } 1 { 33 00000000 1 [holl "0x0a 1"] }\n" -simple_expect "%1078 48 0" +simple_expect "%1078 64 0" send "1079 93 6 0 { } 1 { 33 00000000 1 [holl "0 6 "] }\n" -simple_expect "%1079 48 0" +simple_expect "%1079 64 0" send "1080 93 6 0 { } 1 { 33 00000000 1 [holl "5 2"] }\n" -simple_expect "%1080 48 0" +simple_expect "%1080 64 0" send "1081 93 6 0 { } 1 { 33 00000000 1 [holl "5 5"] }\n" -simple_expect "%1081 48 0" +simple_expect "%1081 64 0" send "1082 93 6 0 { } 1 { 33 00000000 1 [holl "5 3"] }\n" -simple_expect "%1082 48 0" +simple_expect "%1082 64 0" send "1083 93 6 0 { } 1 { 33 00000000 1 [holl " 5 0"] }\n" -simple_expect "%1083 48 0" +simple_expect "%1083 64 0" send "1084 93 6 0 { } 1 { 33 00000000 1 [holl " 5 3"] }\n" -simple_expect "%1084 48 0" +simple_expect "%1084 64 0" send "1085 93 6 0 { } 1 { 33 00000000 1 [holl "0 0 "] }\n" -simple_expect "%1085 48 0" +simple_expect "%1085 64 0" send "1086 93 6 0 { } 1 { 33 00000000 1 [holl " 0 18"] }\n" -simple_expect "%1086 48 0" +simple_expect "%1086 64 0" send "1087 93 6 0 { } 1 { 33 00000000 1 [holl " 0 0"] }\n" -simple_expect "%1087 48 0" +simple_expect "%1087 64 0" # Set to "0". send "1088 94\n" diff --git a/src/server/testsuite/lyskomd.0/55.exp b/src/server/testsuite/lyskomd.0/55.exp index 000af8dbcb7bc0d19ff84b1838fa5d18e122bd5a..c10e703ba01f73fdca6d67b741d1259312d51334 100644 --- a/src/server/testsuite/lyskomd.0/55.exp +++ b/src/server/testsuite/lyskomd.0/55.exp @@ -42,11 +42,11 @@ simple_expect "=1002 1" # Create a text with a modify-only aux-item (fails). send "1003 86 [holl "foo"] 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" -simple_expect "%1003 49 0" +simple_expect "%1003 66 0" # Add a create-only aux-item to a text (fails). send "1004 92 1 0 { } 1 { 1 00000000 0 [holl "foo"] }\n" -simple_expect "%1004 49 0" +simple_expect "%1004 65 0" # Add a modify-only aux-item to a text. send "1005 92 1 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" @@ -58,11 +58,11 @@ simple_expect "=1006 6" # Create a conference with a modify-only aux-item (fails). send "1007 88 [holl "attempt 2"] 00001000 1 { 4 00000000 0 [holl "foo"] }\n" -simple_expect "%1007 49 0" +simple_expect "%1007 66 0" # Add a create-only aux-item to a conference (fails). send "1008 93 6 0 { } 1 { 3 00000000 0 [holl "foo"] }\n" -simple_expect "%1008 49 0" +simple_expect "%1008 65 0" # Add a modify-only aux-item to a conference. send "1009 93 6 0 { } 1 { 4 00000000 0 [holl "foo"] }\n" @@ -83,11 +83,11 @@ if {$attempt3 == 7} { # Create a person with a modify-only aux-item (fails). send "1011 89 [holl "attempt 4"] [holl "secret 4"] 00000000 1 { 6 00000000 0 [holl "foo"] }\n" -simple_expect "%1011 49 0" +simple_expect "%1011 66 0" # Add a create-only aux-item to a person (fails). send "1012 93 $attempt3 0 { } 1 { 5 00000000 0 [holl "foo"] }\n" -simple_expect "%1012 49 0" +simple_expect "%1012 65 0" # Add a modify-only aux-item to a person. send "1013 93 $attempt3 0 { } 1 { 6 00000000 0 [holl "foo"] }\n" @@ -99,11 +99,11 @@ simple_expect "=1014 2" # Create a text with a modify-only "any" aux-item (fails). send "1015 86 [holl "foo"] 0 { } 1 { 8 00000000 0 [holl "foo"] }\n" -simple_expect "%1015 49 0" +simple_expect "%1015 66 0" # Add a create-only "any" aux-item to a text (fails). send "1016 92 1 0 { } 1 { 7 00000000 0 [holl "foo"] }\n" -simple_expect "%1016 49 0" +simple_expect "%1016 65 0" # Add a modify-only "any" aux-item to a text. send "1017 92 1 0 { } 1 { 8 00000000 0 [holl "foo"] }\n" @@ -111,27 +111,27 @@ simple_expect "=1017" # Add a modify-only "text" aux-item to a conference (fails). send "1018 93 6 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" -simple_expect "%1018 49 0" +simple_expect "%1018 63 0" # Add a modify-only "letterbox" aux-item to a conference (fails). send "1019 93 6 0 { } 1 { 6 00000000 0 [holl "foo"] }\n" -simple_expect "%1019 49 0" +simple_expect "%1019 63 0" # Add a modify-only "text" aux-item to a person (fails). send "1020 93 $attempt3 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" -simple_expect "%1020 49 0" +simple_expect "%1020 63 0" # Add a modify-only "conference" aux-item to a person (fails). send "1021 93 $attempt3 0 { } 1 { 4 00000000 0 [holl "foo"] }\n" -simple_expect "%1021 49 0" +simple_expect "%1021 63 0" # Add a modify-only "conference" aux-item to a text (fails). send "1022 92 1 0 { } 1 { 4 00000000 0 [holl "foo"] }\n" -simple_expect "%1022 49 0" +simple_expect "%1022 63 0" # Add a modify-only "letterbox" aux-item to a text (fails). send "1023 92 1 0 { } 1 { 6 00000000 0 [holl "foo"] }\n" -simple_expect "%1023 49 0" +simple_expect "%1023 63 0" # Shut down. talk_to client 1 diff --git a/src/server/testsuite/lyskomd.0/aux-items-cov.exp b/src/server/testsuite/lyskomd.0/aux-items-cov.exp index 06a6ebe89cac67f2be3ec1ee331d5ac7691d186e..4101f1afbb53ef83f3ff6b1e32118ea8c9c5b59b 100644 --- a/src/server/testsuite/lyskomd.0/aux-items-cov.exp +++ b/src/server/testsuite/lyskomd.0/aux-items-cov.exp @@ -103,7 +103,7 @@ talk_to lyskomd simple_expect "Unmatched \\\[ or \\\[\\^ in validate regexp of aux-item definition 1000 \\(invalid-regexp\\)." simple_expect "Failed to cache regexp validator for \"invalid-regexp\". Rejecting all such items." talk_to client 0 -simple_expect "%1003 48 0" +simple_expect "%1003 64 0" # Create a valid text send "2000 86 [holl "Text"] 1 { 0 1 } 1 { 1001 01000000 0 [holl "FUBAR"] }\n" @@ -144,15 +144,15 @@ simple_expect "=4002 $any_num $any_num $any_num $any_num $any_num $any_num 1 { 1 # Attempt to create item with a broken validation regexp, twice send "5000 95 0 { } 1 { 1000 00000000 0 [holl "ABC"] }\n" -simple_expect "%5000 48 0" +simple_expect "%5000 64 0" send "5001 95 0 { } 1 { 1000 00000000 0 [holl "ABC"] }\n" -simple_expect "%5001 48 0" +simple_expect "%5001 64 0" # Attempt to create an item that is system-only send "5002 95 0 { } 1 { 1005 00000000 0 [holl "FUBAR"] }\n" -simple_expect "%5002 49 0" +simple_expect "%5002 67 0" # Delete aux-item zero is ignored # (this is undocumented behavior and may change) diff --git a/src/server/testsuite/lyskomd.0/bug-572.exp b/src/server/testsuite/lyskomd.0/bug-572.exp index 8151cd62e77408299a667c41362a174c8bf18cb2..a524234b625cbcd794d7bf7bd6c7d8dd877d7c75 100644 --- a/src/server/testsuite/lyskomd.0/bug-572.exp +++ b/src/server/testsuite/lyskomd.0/bug-572.exp @@ -82,7 +82,7 @@ simple_expect "=1011" # Set text 1 as FAQ of conference 6, again. This should fail. send "1012 93 6 0 { } 1 { 14 00000000 1 [holl "1"] }\n" -simple_expect "%1012 48 0" +simple_expect "%1012 68 0" # Shut down. send "1013 42 255\n"