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

Allow non-root users to install this extension #63

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

vadim2404
Copy link
Contributor

Currently, if non-root users try to install the extension create extension pg_idkit it fails with permission denied for language c.

In order to enable it, we need to change the attribute in the control file.

I fixed the template in pgrx some time ago (pgcentralfoundation/pgrx#1056), but, it seems, that you started the development of this extension earlier then I fixed the template.

@t3hmrman
Copy link
Member

t3hmrman commented Mar 5, 2024

Hey @vadim2404 thanks for pointing this out, and linking to the previous PR, that explained some stuff I was confused about (i.e. when I look at the docs for .control files it suggests the opposite).

If I'm understanding this change correctly, we want to force the requirement for superuser as early as possible.

@t3hmrman
Copy link
Member

t3hmrman commented Mar 5, 2024

Would you mind switching your commit message to follow conventional commits? Something like:

feat(security): require superuser in pg_idkit.control

@vadim2404
Copy link
Contributor Author

vadim2404 commented Mar 5, 2024

@t3hmrman, I fixed the commit message. Thanks for pointing out.

We need the superuser privileges, because "C" language is marked as "untrusted" in Postgres. And, therefore, non-root users can't install the extension.

=> select lanname, lanpltrusted from pg_language;
 lanname  | lanpltrusted
----------+--------------
 internal | f
 c        | f
 sql      | t
 plpgsql  | t
(4 rows)

Time: 30.918 ms

@t3hmrman
Copy link
Member

t3hmrman commented Mar 5, 2024

Ahhhh, thank you for the extra explanation! I see now why it's needed! Will merge and trigger a minor release ASAP!

@t3hmrman t3hmrman merged commit 02f2179 into VADOSWARE:main Mar 5, 2024
1 check passed
@vadim2404
Copy link
Contributor Author

I was happy to help! Thanks for the fast reaction!

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.

2 participants