Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-24519] Add test case for PL/CSQL test cases 15 (feature/plcsql-p1) #1901

Open
wants to merge 14 commits into
base: feature/plcsql-p1
Choose a base branch
from

Conversation

swi0110
Copy link
Contributor

@swi0110 swi0110 commented Oct 8, 2024


===================================================
Grants for DBA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hgryoo
이 결과는 dba에 grant를 수행한 후, show grants for dba를 수행한 결과입니다.
DBA는 권한을 부여할 필요가 없으니 결과상 문제는 없는 것 같은데, 의도하신 바가 맞는지 확인 부탁드립니다.

GRANT EXECUTE ON PROCEDURE t1.sp2 TO dba;
SHOW GRANTS FOR DBA;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문주셨던 부분이 OUTDATED 되어 있어서요. 현재 코드에서 어떤 부분일까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 파일명이 바뀌면서 Outdated가 되었네요
테스트 쿼리 전문을 comment로 남기겠습니다.
아래의 테스트 쿼리는 '01_grant_plcsql.sql' 테스트 파일의 쿼리 일부 입니다.

  1. t1 계정을 만들고, t1.sp2()를 생성합니다.
  2. 이 t1.sp2()에 GRANT EXECUTE ON PROCEDURE t1.sp2 TO dba;를 수행합니다.
  3. 이후 SHOW GRANTS FOR DBA;를 수행하면, '01_grant_plcsql.answer'파일의 27번째 라인과 같이 dba에 부여된 grant 계정의 결과를 확인할 수 없습니다.

-- 테스트 쿼리
CREATE USER t1 GROUPS dba;

CREATE OR REPLACE FUNCTION t1.sp2() return varchar as
begin
return 't1 hello';
end;
GRANT EXECUTE ON PROCEDURE t1.sp2 TO dba;

SHOW GRANTS FOR DBA;

-- 결과
Grants for DBA

@ssihil
Copy link
Collaborator

ssihil commented Oct 10, 2024

sql/_05_plcsql/_01_testspec/_04_expression/_22_grant/answers/02_grant_javasp.answer 가 비어있습니다.

@swi0110
Copy link
Contributor Author

swi0110 commented Oct 10, 2024

sql/_05_plcsql/_01_testspec/_04_expression/_22_grant/answers/02_grant_javasp.answer 가 비어있습니다.

추가했습니다.
리뷰 감사합니다

@swi0110 swi0110 requested a review from kwonhoil October 11, 2024 05:08
@swi0110 swi0110 requested a review from kwonhoil October 14, 2024 08:35
GRANT EXECUTE ON u1.tbl1 TO u1;

-- Execute OK. but no operate because u2 does not have permission on tb1
GRANT EXECUTE ON u1.tbl1 TO u2;
Copy link
Contributor

@kwonhoil kwonhoil Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

권한이 없는 u1.tbl1에 대해서 자기자신에게 권한을 부여하는 경우 에러인지? 정상처리가 맞는 것인지 개발팀에 확인 필요 ( 바로 아래 procedure 권한 부여하는 것도 동일 )
확인후에 bug 표시 작성여부 판단

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 확인해서, 공유하도록 하겠습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 문제는 legacy issue로 http://jira.cubrid.org/browse/CBRD-25585 에서 진행합니다.

SHOW GRANTS FOR u2;
-- ERROR: Cannot revoke privileges from self
REVOKE EXECUTE ON PROCEDURE u1.test1 FROM u2;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에러케이스 추가
"show grant for 없는user명;" 에러발생 및 메세지 확인
grant / revoke 오탈자 명령 실행에 따른 에러메세지 확인

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

몇가지 scenario를 추가해봤습니다.
혹시 추가로 아이디어 있으시면, 공유 부탁드립니다.

@swi0110 swi0110 requested a review from kwonhoil October 16, 2024 05:40
@@ -35,7 +35,7 @@ grantor_name grantee_name object_type object_name owner_name auth

===================================================
grantor_name grantee_name object_type object_name owner_name auth_type is_grantable
DBA U2 FUNCTION test1 U1 EXECUTE NO
U1 U2 FUNCTION test1 U1 EXECUTE NO
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongmin-won
dba 계정으로 grant를 수행했는데 grantor_name이 U1이 됐습니다
확인 부탁드립니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 grantor_name이 소유자(U1)으로 들어가는게 맞습니다.

CUBRID/cubrid#5551

해당 이슈에서 DBA 및 멤버(Owner, DBA)가 권한을 부여 할 때, grantor를 소유자로 변경 했으며,
권한을 회수 할 때도 DBA 및 멤버(Owner, DBA)는 소유자로 동작하도록 수정 됐습니다.

Error:-163
EXECUTE authorization failure.
Error:-1364
Only DBA and the owner can grant the EXECUTE privilege.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongmin-won
public 계정에서 'GRANT EXECUTE ON PROCEDURE u1.test1 TO u2;'를 수행한 내용입니다.
의도하신 error가 맞는지 확인 부탁드립니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 의도한 error가 맞습니다.

현재 Stored Procedure은 WITH GRANT OPTION이 없기 때문에, DBA 및 Owner 만 권한을 부여할 수 있습니다.
(DBA, Owner 멤버도 포함)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants