8000 Fixed loophole in privilege check. · utPLSQL/utPLSQL@e25c375 · GitHub
[go: up one dir, main page]

Skip to content

Commit e25c375

Browse files
committed
Fixed loophole in privilege check.
1 parent 07250a3 commit e25c375

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

source/core/types/ut_executable_test.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ create or replace type body ut_executable_test as
5656
l_fail_message := 'Expected one of exceptions ('||l_expected_error_codes||') but nothing was raised.';
5757
else
5858
l_actual_error_no := regexp_substr(self.error_stack, '^[a-zA-Z]{3}(-[0-9]+)', subexpression=>1);
59-
if not l_actual_error_no member of a_expected_error_codes then
59+
if not l_actual_error_no member of a_expected_error_codes or l_actual_error_no is null then
6060
l_fail_message := 'Actual: '||l_actual_error_no||' was expected to ';
6161
if cardinality(a_expected_error_codes) > 1 then
6262
l_fail_message := l_fail_message || 'be one of: ('||l_expected_error_codes||')';

source/core/ut_metadata.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ create or replace package body ut_metadata as
123123
function user_has_execute_any_proc return boolean is
124124
l_ut_owner varchar2(250) := ut_utils.ut_owner;
125125
begin
126-
return is_object_visible(l_ut_owner||'.ut_utils');
126+
return is_object_visible(l_ut_owner||'.ut_utils') and sys_context('userenv','current_schema') != l_ut_owner;
127127
end;
128128

129129
function is_object_visible(a_object_name varchar2) return boolean is

source/core/ut_suite_manager.pkb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ create or replace package body ut_suite_manager is
373373
a_owner_name varchar2
374374
) return boolean is
375375
begin
376-
return sys_context( 'userenv', 'current_schema' ) = a_owner_name or ut_metadata.user_has_execute_any_proc() or ut_trigger_check.is_alive();
376+
return sys_context( 'userenv', 'current_schema' ) = a_owner_name or ut_metadata.user_has_execute_any_proc()
377+
or ( ut_trigger_check.is_alive()
378+
and ut_annotation_cache_manager.get_cache_schema_info(a_owner_name, 'PACKAGE').full_refresh_time is not null
379+
);
377380
end;
378381

379382
procedure build_and_cache_suites(

0 commit comments

Comments
 (0)
0