Skip to content

[master] Fix granting of privileges on Postgres functions#65839

Merged
dwoz merged 5 commits intosaltstack:masterfrom
elpavel:function_privilege
Jan 30, 2026
Merged

[master] Fix granting of privileges on Postgres functions#65839
dwoz merged 5 commits intosaltstack:masterfrom
elpavel:function_privilege

Conversation

@elpavel
Copy link
Contributor

@elpavel elpavel commented Jan 10, 2024

What does this PR do?

The Postgres module code for granting privileges on functions has issues.
This PR adds a test for grants on Postgres functions, and fixes the issue.
It also fixes a minor issue in revoking privileges on tables.

Previous Behavior

Granting a privilege on ALL functions would run

GRANT EXECUTE ON FUNCTION ALL TO "user"

Revoking a privilege from a table would run

REVOKE SELECT ON TABLE public.badly-named-table FROM ...

New Behavior

GRANT EXECUTE ON ALL FUNCTIONS TO "user"
REVOKE SELECT ON TABLE public."badly-named-table" FROM ...

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@elpavel elpavel requested a review from a team as a code owner January 10, 2024 20:53
@elpavel elpavel requested review from dwoz and removed request for a team January 10, 2024 20:53
@welcome
Copy link

welcome bot commented Jan 10, 2024

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Add tests for granting privileges on Postgres functions [master] Add tests for granting privileges on Postgres functions Jan 10, 2024
@elpavel elpavel changed the title [master] Add tests for granting privileges on Postgres functions [master] Fix granting of privileges on Postgres functions Jan 11, 2024
@dwoz dwoz added this to the Argon v3008.0 milestone Feb 5, 2024
@dwoz dwoz requested a review from a team as a code owner March 16, 2025 22:09
@welcome
Copy link

welcome bot commented Jan 30, 2026

Congratulations on your first PR being merged! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants