Bugzilla – Attachment 64101 Details for
Bug 18755
Allow empty password fields in Patron Info requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch enabling the option
0001-Bug-18755-Allow-empty-passwords-in-Patron-Info-to-re.patch (text/plain), 2.59 KB, created by
Colin Campbell
on 2017-06-08 12:18:57 UTC
(
hide
)
Description:
Patch enabling the option
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2017-06-08 12:18:57 UTC
Size:
2.59 KB
patch
obsolete
>From 34dfaea93e693d06a13adb3321316b52ba8bae87 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 8 Jun 2017 12:59:55 +0100 >Subject: [PATCH] Bug 18755 Allow empty passwords in Patron Info to return OK > >With this patch a parameter 'allow_empty_passwords="1" can be added to a >login in the SIP configuration file to allow the behaviour as was normal >before the patch for bug 16610 was applied. Some sip clients rely on >this behaviour sending an empty password field when they wish to >validate to user but do not have the password. >If a password is supplied it will be validated > >A test has been added to Message.t to confirm this behaviour >--- > C4/SIP/Sip/MsgType.pm | 3 +++ > t/db_dependent/SIP/Message.t | 9 ++++++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 7a1a1e3..ede80c3 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -961,6 +961,9 @@ sub handle_patron_info { > > # If patron password was provided, report whether it was right or not. > $password_rc = $patron->check_password($patron_pwd); >+ if ( $patron_pwd eq q{} && $server->{account}->{allow_empty_passwords} ) { >+ $password_rc = 1; >+ } > $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ) ); > } > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 088829a..217f328 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -70,7 +70,7 @@ subtest 'Testing Patron Status Request V2' => sub { > > subtest 'Testing Patron Info Request V2' => sub { > $schema->storage->txn_begin; >- plan tests => 16; >+ plan tests => 17; > $C4::SIP::Sip::protocol_version = 2; > test_request_patron_info_v2(); > $schema->storage->txn_rollback; >@@ -196,6 +196,13 @@ sub test_request_patron_info_v2 { > $msg->handle_patron_info( $server ); > $respcode = substr( $response, 0, 2 ); > check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'code CQ should be N for empty AD' ); >+ # Test empty password is OK if account configured to allow >+ $server->{account}->{allow_empty_passwords} = 1; >+ $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ undef $response; >+ $msg->handle_patron_info( $server ); >+ $respcode = substr( $response, 0, 2 ); >+ check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'Y', 'code CQ should be Y if empty AD allowed' ); > > # Finally, we send a wrong card number > $schema->resultset('Borrower')->search({ cardnumber => $card })->delete; >-- >2.9.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18755
:
64101
|
64762
|
64797