Re: New patch for Column-level privileges

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New patch for Column-level privileges
Date: 2009-01-03 21:28:43
Message-ID: 34d269d40901031328m3f2df2f6w1ac5da3569805fc0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 2, 2009 at 16:11, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Stephen Frost (sfrost(at)snowman(dot)net) wrote:
>> Please find attached an updated patch for column-level privileges
>> which incorporates Alvaro's suggested changes and is updated to the
>> latest CVS HEAD.

Hi!

This gives me
aclchk.c: In function 'ExecuteGrantStmt':
aclchk.c:276: warning: 'errormsg_col' may be used uninitialized in this function

Now it looks bogos but why not just move errmsg_col down to where we
actually use it? Or am I missing something?

*** a/src/backend/catalog/aclchk.c
--- b/src/backend/catalog/aclchk.c
***************
*** 273,279 **** ExecuteGrantStmt(GrantStmt *stmt)
InternalGrant istmt;
ListCell *cell;
const char *errormsg;
- const char *errormsg_col;
AclMode all_privileges;

/*
--- 273,278 ----
***************
*** 324,330 **** ExecuteGrantStmt(GrantStmt *stmt)
case ACL_OBJECT_RELATION:
all_privileges = ACL_ALL_RIGHTS_RELATION | ACL_ALL_RIGHTS_SEQUENCE;
errormsg = gettext_noop("invalid privilege type %s for relation");
- errormsg_col = gettext_noop("invalid privilege type %s for column");
break;
case ACL_OBJECT_SEQUENCE:
all_privileges = ACL_ALL_RIGHTS_SEQUENCE;
--- 323,328 ----
***************
*** 362,368 **** ExecuteGrantStmt(GrantStmt *stmt)
/* keep compiler quiet */
all_privileges = ACL_NO_RIGHTS;
errormsg = NULL;
- errormsg_col = NULL;
elog(ERROR, "unrecognized GrantStmt.objtype: %d",
(int) stmt->objtype);
}
--- 360,365 ----
***************
*** 404,409 **** ExecuteGrantStmt(GrantStmt *stmt)
--- 401,408 ----
{
/* Column-level privileges given. */
ListCell *cell_obj;
+ const char *errormsg_col = gettext_noop("invalid privilege type
%s for column");
+

/* Must be of objtype ACL_OBJECT_RELATION for column
* level privileges */

Attachment Content-Type Size
fixwarning.patch application/octet-stream 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-01-03 21:34:40 Re: parallel restore
Previous Message Guillaume Lelarge 2009-01-03 21:21:57 Re: Latest version of Hot Standby patch