pg.ddx.io  pgaudit/pgaudit GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
13+ messages / 2 participants
[nested] [flat]

* [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 09:12  "df7cb (@df7cb)" <noreply+df7cb@github.com>
  0 siblings, 0 replies; 13+ messages in thread

From: df7cb (@df7cb) @ 2026-07-30 09:12 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

Use the current user name. The temp cluster was created using it.

Close #329.

inline patch 1: t/010_check_stack.pl (+7/-3 lines) download inline-1.patchdiff --git a/t/010_check_stack.pl b/t/010_check_stack.pl index 5563671..4ea1761 100644 --- a/t/010_check_stack.pl +++ b/t/010_check_stack.pl @@ -136,7 +136,7 @@ sub read_until_ready # Open a raw socket to the node and complete startup (trust auth, no password). sub pg_connect { - my ($node) = @_; + my ($node, $user) = @_; my $host = $node->host; my $sock; @@ -154,7 +154,7 @@ sub pg_connect $sock->autoflush(1); binmode($sock); - print $sock startup_msg(user => 'postgres', database => 'postgres'); + print $sock startup_msg(user => $user, database => 'postgres'); read_until_ready($sock); return $sock; @@ -171,6 +171,10 @@ sub pg_connect $node->append_conf('postgresql.conf', "logging_collector = off"); $node->start; +# initdb created the cluster with the current operating system user as its +# bootstrap superuser, which is not necessarily postgres +my $superuser = $node->safe_psql('postgres', 'SELECT current_user'); + # One scenario per command tag that pgaudit_ProcessUtility_hook() allows to # remain on the stack. Each statement returns more than one row, so the # row-limited Execute below suspends its portal and leaves the tag behind. @@ -216,7 +220,7 @@ sub pg_connect { # Connect and begin transaction my $name = $test->{name}; - my $sock = pg_connect($node); + my $sock = pg_connect($node, $superuser); my $offset = -s $node->logfile; print $sock query_msg('BEGIN');
^ permalink raw [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 09:45  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 09:45 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele requested a review.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 09:45  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 09:45 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele assigned @dwsteele.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 09:45  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 09:45 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele applied label "enhancement".

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 09:46  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 09:46 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele renamed this.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 10:02  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 10:02 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@df7cb Would you be OK with 1f49978d2a736 instead? I think it would be a bit more robust.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 10:22  "df7cb (@df7cb)" <noreply+df7cb@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: df7cb (@df7cb) @ 2026-07-30 10:22 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

Sure, anything that makes the tests pass is good. :smile: 

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:09  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 12:09 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

> anything that makes the tests pass is good

Well, the tests certainly pass in our env but do they in yours? :) Please confirm and I'll commit and release beta3.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330 (approved): Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:18  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 12:18 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>



^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:32  "df7cb (@df7cb)" <noreply+df7cb@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: df7cb (@df7cb) @ 2026-07-30 12:32 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

Yes, looks good.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:50  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 12:50 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele merged this (commit 52a325367115).

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:50  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 12:50 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele closed this.

^ permalink  raw  [nested|flat] 13+ messages in thread

* Re: [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test.
@ 2026-07-30 12:50  "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  11 siblings, 0 replies; 13+ messages in thread

From: dwsteele (@dwsteele) @ 2026-07-30 12:50 UTC (permalink / raw)
  To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>

@dwsteele renamed this.

^ permalink  raw  [nested|flat] 13+ messages in thread


end of thread, other threads:[~2026-07-30 12:50 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-30 09:12 [pgaudit/pgaudit] PR #330: Do not hard-code the postgres user in the stack check test. "df7cb (@df7cb)" <noreply+df7cb@github.com>
2026-07-30 09:45 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 09:45 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 09:45 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 09:46 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 10:02 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 10:22 ` "df7cb (@df7cb)" <noreply+df7cb@github.com>
2026-07-30 12:09 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 12:18 ` Re: [pgaudit/pgaudit] PR #330 (approved): Do not hard-code the postgres user in the stack check test. "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 12:32 ` "df7cb (@df7cb)" <noreply+df7cb@github.com>
2026-07-30 12:50 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 12:50 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-07-30 12:50 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox