Bugzilla – Attachment 176056 Details for
Bug 38810
SIP account level system preference overrides not properly cleared between requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38810 - SIP account level system preference overrides not properly cleared between requests
Bug-38810---SIP-account-level-system-preference-ov.patch (text/plain), 1.87 KB, created by
Kyle M Hall (khall)
on 2025-01-02 14:37:59 UTC
(
hide
)
Description:
Bug 38810 - SIP account level system preference overrides not properly cleared between requests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-01-02 14:37:59 UTC
Size:
1.87 KB
patch
obsolete
>From aa33ac65056cf7874b92dfd93d8eae952ea4acd1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 2 Jan 2025 09:34:24 -0500 >Subject: [PATCH] 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. >--- > C4/SIP/Sip/MsgType.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index f8583ff8acb..d5a024298a5 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -339,7 +339,7 @@ sub handle { > # Set system preference overrides, first global, then account level > # Clear overrides from previous message handling first > foreach my $key ( keys %ENV ) { >- delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0; >+ delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') == 0; > } > foreach my $key ( keys %{ $config->{'syspref_overrides'} } ) { > $ENV{"OVERRIDE_SYSPREF_$key"} = $config->{'syspref_overrides'}->{$key}; >-- >2.39.5 (Apple Git-154)
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 38810
:
176056
|
176096
|
176153
|
176198