| From: | Robert Haas <robertmhaas(at)gmail(dot)com> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER | 
| Date: | 2022-07-26 19:06:08 | 
| Message-ID: | CA+TgmoYBTVZzchPhwmfgNhMMvVvon4EFA0e+p-7hdkMO4jKQdw@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Tue, Jul 26, 2022 at 2:59 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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);
Oops. Will fix.
-- 
Robert Haas
EDB: http://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2022-07-26 19:10:22 | pgsql: Remove the restriction that the relmap must be 512 bytes. | 
| Previous Message | Tom Lane | 2022-07-26 18:59:24 | Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER |