https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40270

Nick Clemens (kidclamp) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #183633|0                           |1
        is obsolete|                            |

--- Comment #3 from Nick Clemens (kidclamp) <[email protected]> ---
Created attachment 185004
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185004&action=edit
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 <[email protected]>
Signed-off-by: Nick Clemens <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to