diff options
author | Marc G. Fournier <scrappy@hub.org> | 1997-03-12 20:48:48 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1997-03-12 20:48:48 +0000 |
commit | e4949f9fe55223dac74b0075b5483ad15e8e318c (patch) | |
tree | 0eebc8861f09df6d575a5834278176c04fe8ce16 /src/backend/commands/copy.c | |
parent | c00c511b7bb85e8c3fa2424a25cb9cea3d5f4b33 (diff) |
From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] better access control error messages
This patch replaces the 'no such class or insufficient privilege' with
distinct error messages that tell you whether the table really doesn't
exist or whether access was denied.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index f46a848d424..12ee1c28f17 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.21 1997/01/10 17:46:33 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.22 1997/03/12 20:47:32 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -102,13 +102,15 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, Relation rel; extern char *UserName; /* defined in global.c */ const AclMode required_access = from ? ACL_WR : ACL_RD; + int result; rel = heap_openr(relname); if (rel == NULL) elog(WARN, "COPY command failed. Class %s " "does not exist.", relname); - - if (!pg_aclcheck(relname, UserName, required_access)) - elog(WARN, "%s %s", relname, ACL_NO_PRIV_WARNING); + + result = pg_aclcheck(relname, UserName, required_access); + if(result != ACLCHECK_OK) + elog(WARN, "%s: %s", relname, aclcheck_error_strings[result]); /* Above should not return */ else if (!superuser() && !pipe) elog(WARN, "You must have Postgres superuser privilege to do a COPY " |