babelfish-for-postgresql / babelfish_extensions

Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
https://babelfishpg.org/
Apache License 2.0
277 stars 93 forks source link

Login with mapped user should not use guest user privilege… #3116

Closed shalinilohia50 closed 1 week ago

shalinilohia50 commented 1 week ago

Description

Previously, a guest users always remain member of a login even if login has a mapped user in a particular database. Due to this any database user is able to access the objects which are accessible to guest user which is undesirable.

Fixed this issue by only keeping one user member of a login at a time, which means, guest will be a member of login only if there is no mapped user to that login otherwise only that mapped user will be a member of login.

Issue Resolved

Task: BABEL-5389

Co-authored-by: Rishabh Tanwar ritanwar@amazon.com Signed-off-by: Shalini Lohia lshalini@amazon.com

Test Scenarios Covered

Check List

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 11820976991

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/rolecmds.c 22 42 52.38%
<!-- Total: 42 62 67.74% -->
Totals Coverage Status
Change from base Build 11819503946: -0.01%
Covered Lines: 43060
Relevant Lines: 58437

💛 - Coveralls