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

Jake Deery <[email protected]> changed:

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

--- Comment #6 from Jake Deery <[email protected]> ---
Created attachment 176153
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176153&action=edit
Bug 38810 - SIP account level system preference overrides not properly cleared
between requests

Account level syspref overrides in SIP will "leak" between SIP requests.

Basically an account level system preference override will may be set by a
given request, but those overrides will never be cleared for the life of that
SIP process thus "contaminating" that process until it reaches end of life".

This is because the code
    # Clear overrides from previous message handling first
    foreach my $key ( keys %ENV ) {
        delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
    }
is checking if the env key contains the substring OVERRIDE_SYSPREF_ at an index
greater than 0. The problem is that for all overrides the subtring *starts at
0* since it's always the first part of the string. If the substring is not part
of the string index will return -1. TLDR we have an "off by one" error. We need
to check that the return value is zero instead of any positive value.

1) Set your SIP server params so that only one SIP process should run,
  <server-params
    min_servers='1'
    min_spare_servers='0'
    max_spare_servers='0'
    max_servers='0'
    custom_tcp_keepalive='0'
    custom_tcp_keepalive_time='7200'
    custom_tcp_keepalive_intvl='75'
  />
2) Set noissuescharge to $5
3) Create two SIP accounts
4) Set an account level override for noissuescharge to $500
5) Create a patron that owes $10 in fines
6) Run a patron information request on the "normal" SIP account for the
   patron, the patron flags should show the patron being not able to
   check out items
7) Run a patron information request of the "overridden" SIp account for
   the patron, the patron flags should show the patron being allowed to
   check out items
8) Run a second patron information request on the "normal" SIP account
   for the patron, the patron flags should show the patron being able to
   check out even though they should not be able to check out
9) Apply this patch
10) Restart all the things!
11) Repeast steps 6-8
12) The flags should be correct!

Signed-off-by: Jake Deery <[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