Koha-clms/C4
Tomas Cohen Arazi 3de53001d4
Bug 40270: Fix uninitialized value warnings in SIP logging
The SIP server generates warnings when logging account information
for failed logins:

Use of uninitialized value $args[0] in sprintf at /kohadevbox/koha/C4/SIP/Sip.pm line 314
Use of uninitialized value $args[1] in sprintf at /kohadevbox/koha/C4/SIP/Sip.pm line 314

This occurs when $self->{account}->{id} or $self->{account}->{institution}
are undefined during failed authentication attempts.

This patch fixes the issue by:
1. Adding a safer sprintf implementation in siplog that handles undefined values
2. Providing default values for undefined account information in logging calls

To test:
1. Start SIP server
2. Attempt to connect with invalid credentials using sip_cli_emulator.pl:
   ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su invaliduser -sp wrongpass -l kohalibrary2 --patron koha -m patron_information
3. Check /var/log/koha/kohadev/sip-output.log
=> FAIL: 'Use of uninitialized value...' warns
4. Apply this patch
5. Repeat 2
=> SUCCESS: No "Use of uninitialized value" warnings appear
=> SUCCESS: Logging shows 'undef/undef' for failed logins instead of empty strings
6. Try a valid login
=> SUCCESS: Still works correctly for valid logins
7. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9cad25967d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 4e1cd02932)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-09-19 14:33:55 +02:00
..
AuthoritiesMarc
…
Barcodes Bug 19113: Barcode value builder not working with numeric branchcode 2025-07-31 10:27:42 +02:00
ClassSortRoutine
…
ClassSplitRoutine Bug 40388: Remove warning from t/Labels.t 2025-08-01 14:29:57 +02:00
Creators
…
External
…
Form Bug 34776: Add unit tests for sub restore_form_values 2025-07-28 10:22:07 +02:00
Heading Bug 39415: (follow-up) Add 651g to bib heading fields as well 2025-05-26 20:17:03 +02:00
ILSDI
…
Installer
…
Labels Bug 34157: Exporting labels as a barcode range can cause 500 error 2025-07-31 16:15:12 +02:00
Linker
…
Members
…
OAI
…
Output
…
Patroncards Bug 39295: Prevent infinite loop on line wrapping 2025-06-19 11:06:57 +02:00
Reports Bug 37784: Do not show forbidden columns in reports dictionary 2025-03-24 17:59:09 +01:00
SIP Bug 40270: Fix uninitialized value warnings in SIP logging 2025-09-19 14:33:55 +02:00
Search
…
Serials
…
Utils/DataTables
…
Accounts.pm
…
Acquisition.pm
…
Auth.pm Bug 38826: Make check_api_auth $sessionID consistent 2025-03-24 18:12:56 +01:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm
…
Auth_with_ldap.pm
…
Auth_with_shibboleth.pm
…
AuthoritiesMarc.pm Bug 40119: (QA follow-up) Small additional comment 2025-07-25 14:28:18 +02:00
Barcodes.pm
…
Biblio.pm Bug 40403: Remove warning from Circulation_holdsqueue.t 2025-08-01 11:45:38 +02:00
Breeding.pm
…
Budgets.pm
…
Calendar.pm
…
Charset.pm
…
Circulation.pm Bug 39180: Catch exception when updating patron lastseen date 2025-09-17 17:01:21 +02:00
ClassSortRoutine.pm
…
ClassSource.pm
…
ClassSplitRoutine.pm
…
Context.pm Bug 36081: Use multivalue_preference 2025-02-24 20:43:20 +01:00
Contract.pm
…
CourseReserves.pm
…
Creators.pm
…
HTML5Media.pm
…
Heading.pm Bug 38483: C4::Heading::preferred_authorities is not used 2025-03-24 18:12:14 +01:00
HoldsQueue.pm
…
ImportBatch.pm
…
ImportExportFramework.pm
…
InstallAuth.pm
…
Installer.pm
…
ItemCirculationAlertPreference.pm
…
Items.pm Bug 14907: Sort item search by cn_sort when sorting by callnumber 2025-04-22 23:01:31 +02:00
Koha.pm Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues() 2025-07-28 11:03:55 +02:00
Labels.pm
…
Languages.pm Bug 38646: (follow-up) Ensure consistent ordering of languages 2025-04-22 23:01:30 +02:00
Letters.pm Bug 36008: Use notice_email_address instead of email for SendAlerts issue type 2025-08-06 09:56:59 +00:00
Linker.pm
…
Log.pm
…
MarcModificationTemplates.pm
…
Matcher.pm
…
Members.pm
…
Message.pm
…
Output.pm
…
Overdues.pm Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook 2025-04-25 11:27:58 +02:00
Patroncards.pm
…
Record.pm
…
Reports.pm
…
Reserves.pm Bug 40034: Only check notforloan on itemtype if it exists 2025-07-09 14:58:38 +00:00
Ris.pm
…
RotatingCollections.pm
…
SMS.pm
…
Scheduler.pm
…
Scrubber.pm Bug 40079: (follow-up) Improve test coverage and fix undef handling 2025-07-25 16:49:49 +02:00
Search.pm
…
Serials.pm
…
Service.pm
…
ShelfBrowser.pm
…
SocialData.pm
…
Stats.pm
…
Suggestions.pm
…
TTParser.pm
…
Tags.pm
…
Templates.pm
…
TmplToken.pm
…
TmplTokenType.pm
…
UsageStats.pm Bug 38104: Always update when hea cronjob is run 2025-04-22 23:02:27 +02:00
XISBN.pm
…
XSLT.pm
…