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

Build PG17 #28

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
pg-version: [11, 12, 13, 14, 15, 16]
pg-version: [11, 12, 13, 14, 15, 16, 17]
steps:
- id: install
run: |
Expand All @@ -25,7 +25,7 @@ jobs:
# Get the postgresql gpg key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8
# Setup the Postgres repositories
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main ${{ matrix.pg-version }}" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
# Install build deps
sudo apt-get install -y postgresql-server-dev-${{ matrix.pg-version }}
Expand Down
10 changes: 8 additions & 2 deletions src/aiven_gatekeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@

PG_MODULE_MAGIC;

/* session_auth_is_superuser was renamed to current_role_is_superuser */
#if PG17_GTE
#define CURRENT_ROLE_IS_SUPERUSER current_role_is_superuser
#else
#define CURRENT_ROLE_IS_SUPERUSER session_auth_is_superuser
#endif

void _PG_init(void);
void _PG_fini(void);

Expand Down Expand Up @@ -139,9 +146,8 @@ is_elevated(void)
}

is_superuser = superuser_arg(currentUserId);

/* elevated to supersuser when the session auth user does not have superuser privileges */
return is_superuser && !session_auth_is_superuser;
return is_superuser && !CURRENT_ROLE_IS_SUPERUSER;
}

static bool
Expand Down
2 changes: 2 additions & 0 deletions src/aiven_gatekeeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define PG13_GTE (PG_VERSION_NUM >= 130000)
#define PG14_GTE (PG_VERSION_NUM >= 140000)
#define PG16_GTE (PG_VERSION_NUM >= 160000)
#define PG17_GTE (PG_VERSION_NUM >= 170000)


/* The process_utility_hook function changed in PG13 and again in PG14
* versions from introduction (PG9) through PG12 have the same 7 argument structure
Expand Down
Loading