Re: per user/database connections limit again - Mailing list pgsql-patches

From Stephen Frost
Subject Re: per user/database connections limit again
Date
Msg-id 20050702235546.GK24207@ns.snowman.net
Whole thread Raw
In response to per user/database connections limit again  (Petr Jelinek <pjmodos@parba.cz>)
Responses Re: per user/database connections limit again
List pgsql-patches
* Petr Jelinek (pjmodos@parba.cz) wrote:
> +     if (!(superuser()
> +         || ((Form_pg_database) GETSTRUCT(tuple))->datdba == GetUserId()))
> +         aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_DATABASE,
> +                        stmt->dbname);

This should almost certainly be a pg_database_ownercheck() call instead.

The rest needs to be updated for roles, but looks like it should be
pretty easy to do.  Much of it just needs to be repatched, the parts
that do need to be changed look to be pretty simple changes.

I believe the use of SessionUserId is probably correct in this patch.
This does mean that this patch will only be for canlogin roles, but that
seems like it's probably correct.  Handling roles w/ members would
require much more thought.

    Thanks,

        Stephen

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Dbsize backend integration
Next
From: Michael Fuhr
Date:
Subject: contrib/pgcrypto patch for OpenSSL 0.9.8