-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify APIs to return palloc'ed values and catalog lookup to validate…
… the user in get_physical_user_name (#2960) Earlier in Babelfish, The get_*_role_name() and get_*_schema_name() APIs returned constant values or string literal for few cases and palloc'ed copy for other cases. The get_physical_user_name() used to return the user_name after appending the db_name to the user_name without any checks to verify its existence/validity. With this change, We return Palloc'ed values for the API every time. In get_physical_user_name() if the user or role is not found in the sys.babelfish_authid_user_ext catalog, then an error is thrown. Additionally, In multidb.c, made changes to the APIs like get_role_name() and get_schema_name() to return palloc'ed values instead of constant values. Implemented a catalog lookup in get_physical_user_name() to verify if the user or role is found in the sys.babelfish_authid_user_ext catalog. The 'suppress_role_error' flag indicates if it is ok for the user or role to be absent from the catalog (required for cases when a new user/role is created and it can't be found in the catalog). Checked all the functions where the APIs are called and pfree the variables containing values from the above APIs after they are no longer used. Task: BABEL-4933 Signed-off-by: P Aswini Kumar <[email protected]>
- Loading branch information
Showing
14 changed files
with
324 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.