pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER
Date: Tue, 26 Jul 2022 14:59:24 -0400
Message-ID: <2511599.1658861964@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaR7TV-2NeMbkLx8LnUru=o6vqawjCMLm6H_CK77A0jkQ@mail.gmail.com>
References: <CA+TgmoZirCwArJms_fgvLBFrC6b=HdxmG7iAhv+kt_=NBA7tEw@mail.gmail.com>
	<39752.1658420887@sss.pgh.pa.us>
	<CA+TgmoY8rJ3SsE3rJndLqFK1PSVfZe+hV9nM=rs-7nMRZzVVOw@mail.gmail.com>
	<75372.1658422970@sss.pgh.pa.us>
	<20220721172726.GA3779763@nathanxps13>
	<CA+TgmoaR7TV-2NeMbkLx8LnUru=o6vqawjCMLm6H_CK77A0jkQ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> Reaction to this patch seems tentatively positive so far, so I have
> committed it. Maybe someone will still show up to complain ... but I
> think it's a good change, so I hope not.

I had not actually read the patch, but now that I have, it's got
a basic typing error:

+       bool    should_be_super = BoolGetDatum(boolVal(dissuper->arg));
+
+       if (!should_be_super && roleid == BOOTSTRAP_SUPERUSERID)
+           ereport(ERROR,

The result of BoolGetDatum is not bool, it's Datum.  This is
probably harmless, but it's still a typing violation.
You want something like

	bool    should_be_super = boolVal(dissuper->arg);
	...
	new_record[Anum_pg_authid_rolsuper - 1] = BoolGetDatum(should_be_super);

			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <2511599.1658861964@sss.pgh.pa.us>
Permalink:  ../2511599.1658861964@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2511599.1658861964@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, nathandbossart@gmail.com
  Subject: Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER
  In-Reply-To: <2511599.1658861964@sss.pgh.pa.us>
  References: <CA+TgmoZirCwArJms_fgvLBFrC6b=HdxmG7iAhv+kt_=NBA7tEw@mail.gmail.com> <39752.1658420887@sss.pgh.pa.us> <CA+TgmoY8rJ3SsE3rJndLqFK1PSVfZe+hV9nM=rs-7nMRZzVVOw@mail.gmail.com> <75372.1658422970@sss.pgh.pa.us> <20220721172726.GA3779763@nathanxps13> <CA+TgmoaR7TV-2NeMbkLx8LnUru=o6vqawjCMLm6H_CK77A0jkQ@mail.gmail.com> <2511599.1658861964@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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