Koha-clms/C4
Kyle M Hall ac2ece17bd Bug 29264: SIP config allows use of non-branchcode institution ids causes workers to die without responding
If is entirely possible to create an SIP institution whose ID does not match a valid branchcode in Koha's SIP config. In fact, Koha's example SIP config contains an example of this ( kohalibrary / kohalibrary2 ).

If a SIP login uses an institution with an id that doesn't match a valid branchcode, everything will appear to work, but the SIP worker will die anywhere that Koha gets the branch from the userenv and assumes it is valid.

The repercussions of this are that actions such as the checkout message simply die and do not return a response message to the requestor.

At the very least, we should output a warning to the SIP log.

I think we should strongly consider disallowing institution ids in the SIP config that do not match valid branchcodes. In this scenario, attempting to start the SIP server should result in a error message with the SIP server exiting immediately.

Test Plan:
1) Apply this patch
2) Make a sip login that uses an instution whose id is *not* a valid branchcode
3) Start the SIP server
4) Check sip.log, you should see a warning similar to the following:
[2021/10/18 12:18:29] [2068079] [ERROR] ERROR: Institution kohalibrary does does not match a branchcode. This can cause unexpected behavior. C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (220)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8e1f0cfc8d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 95e9bb9b08)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-11-21 22:01:14 +01:00
..
AuthoritiesMarc Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes Bug 26673: Fix perlcritic complains 2020-11-13 21:05:25 +00:00
ClassSortRoutine
…
ClassSplitRoutine Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Creators Bug 25852: Improve C4::Creators::Lib reliability under plack 2020-08-13 16:23:59 +00:00
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Form
…
Heading Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
ILSDI Bug 21301: (follow-up) Remove borrowernumber in issues for GetRecords ILS-DI service 2021-01-20 01:48:09 +00:00
Installer Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Labels Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Linker Bug 28676: Cache and retrieve match_count when searching a cached heading 2021-10-16 01:45:48 +02:00
Members Bug 24447: Changing 'DUE' to example in database that exists. 2021-02-03 22:08:50 +00:00
OAI Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Output
…
Patroncards Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Reports Bug 22001: execute reports in an eval 2020-03-31 17:48:14 +01:00
SIP Bug 29264: SIP config allows use of non-branchcode institution ids causes workers to die without responding 2021-11-21 22:01:14 +01:00
Search Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Serials
…
Utils Bug 29134: (follow-up) Specify which borrowernumber 2021-10-26 23:37:23 +02:00
Accounts.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Acquisition.pm Bug 27203: Calculate tax based on ecost if unitprice not set 2021-05-25 13:15:25 +00:00
Auth.pm Bug 14004: Set the syspref's value to an empty string 2021-02-05 12:30:12 +00:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 20854: (QA follow-up) Improve readability 2021-05-24 15:44:22 +00:00
Auth_with_ldap.pm Bug 20443: Use search_with_library_limits for attribute types 2020-03-23 13:49:22 +00:00
Auth_with_shibboleth.pm Bug 28367: (follow-up) Fix plack condition in C4/Auth_with_shibboleth.pm 2021-05-25 13:56:12 +00:00
AuthoritiesMarc.pm Bug 25313: Add skip_merge to ModAuthority 2020-12-09 21:15:31 +00:00
BackgroundJob.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes.pm
…
Biblio.pm Bug 27837: Always pass permanent location from items editor if it was defined 2021-05-25 14:09:51 +00:00
Boolean.pm
…
Breeding.pm Bug 26528: Z39.50/SRU ignore invalid replies 2021-04-25 16:48:32 +00:00
Budgets.pm Bug 23195: Always count shipping costs as 'spent' 2021-05-24 16:44:16 +00:00
Calendar.pm Bug 25723: (QA follow-up) Handle holiday and exception on same day 2020-07-27 17:40:25 +00:00
Charset.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Circulation.pm Bug 28013: (follow-up) Reset the patron loop 2021-05-24 14:38:12 +00:00
ClassSortRoutine.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
ClassSource.pm
…
ClassSplitRoutine.pm
…
Context.pm Bug 28094: Deal with encoding for overriden sysprefs 2021-04-25 14:22:09 +00:00
Contract.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
CourseReserves.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Creators.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Debug.pm
…
HTML5Media.pm Bug 27422: YouTube videos are HTTPS only 2021-02-18 13:37:34 +00:00
Heading.pm Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
HoldsQueue.pm Bug 27068: (follow-up) Remove local hold priority exclusion-related code for 20.05.x 2021-02-23 18:36:32 +00:00
Images.pm Revert "Bug 21987: Do not generate true color thumbnails if not needed" 2019-11-04 13:21:53 +00:00
ImportBatch.pm Bug 24469: Move the new queries to a dedicated ImportBatch subroutine 2021-02-23 17:48:13 +00:00
ImportExportFramework.pm Bug 27968: Fix framework import if isurl has an incorrect value 2021-05-24 16:53:47 +00:00
InstallAuth.pm Bug 25360: Use secure flag for CGISESSID cookie when using HTTPS 2020-08-31 20:05:05 +00:00
Installer.pm Bug 24883: Add POD entry and remove unused variable 2020-03-27 12:11:32 +00:00
ItemCirculationAlertPreference.pm
…
Items.pm Bug 27837: (follow-up) Do not check subfield unless tag defined 2021-05-25 14:10:04 +00:00
Koha.pm Bug 27746: prevent regexp undefined warning when checking subfield contents ($oclc) 2021-04-25 15:16:05 +00:00
Labels.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Languages.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Letters.pm Bug 7806: [20.05] Fix remaining occurrences of 0000-00-00 2021-03-08 14:26:22 +00:00
Linker.pm
…
Log.pm Bug 23632: Remove C4::Logs::GetLogs 2020-09-04 14:39:36 +00:00
MarcModificationTemplates.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Matcher.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Members.pm Bug 28053: Squash warning in C4::Members 2021-04-24 16:18:17 +00:00
Message.pm
…
NewsChannels.pm Bug 24002: Incorrect DATE value: '00-00-0000' in NewsChannels.pm 2019-11-12 13:49:58 +00:00
Output.pm Bug 11994: OpenSearch plugins needs to be delivered with Content-Type application/opensearchdescription+xml 2020-07-10 16:03:57 +00:00
Overdues.pm Bug 28144: Check if issue_id defined 2021-05-24 18:35:40 +00:00
Patroncards.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
Record.pm Bug 26414: Unable to export Withdrawn status using CSV profile 2020-10-20 13:56:17 +00:00
Reports.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Reserves.pm Bug 28644: Fix calling borrowernumber on undefined value 2021-08-16 20:30:58 +02:00
Ris.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
RotatingCollections.pm Bug 24299: Record 'RotatingCollection' as a transfer trigger 2020-03-20 15:54:55 +00:00
SMS.pm
…
Scheduler.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Scrubber.pm
…
Search.pm Bug 27928: FindDuplicate should use simple_search_compat 2021-04-24 13:54:40 +00:00
Serials.pm Bug 27842: Update serial.biblionumber when a subscription is linked with another record 2021-05-24 18:58:46 +00:00
Service.pm
…
ShelfBrowser.pm Bug 26673: Remove shebangs from Perl modules 2020-11-13 21:04:25 +00:00
SocialData.pm
…
Stats.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Suggestions.pm Bug 7806: [20.05] Fix remaining occurrences of 0000-00-00 2021-03-08 14:26:22 +00:00
TTParser.pm Bug 26673: Remove #!/usr/bin/env perl from .pm modules too 2020-11-13 21:04:52 +00:00
Tags.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Templates.pm Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
TmplToken.pm
…
TmplTokenType.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
UsageStats.pm Bug 25147: (RM follow-up) Update pref references. 2020-04-17 09:03:47 +01:00
XISBN.pm Bug 26364: Don't skip records that match the isbn we passed 2021-01-14 13:11:12 +00:00
XSLT.pm Bug 23406: Don't translate suppressed authorised values 2021-05-25 13:25:21 +00:00