Skip to content

Commit 3436c5e

Browse files
committed
Remove ACLDEBUG #define and associated code.
In the footsteps of aaf069a, remove ACLDEBUG, which was the only other remaining undocumented symbol in pg_config_manual.h. The fact that nobody had bothered to document it in seventeen years is a good clue to its usefulness. In practice, none of the tracing logic it enabled would be of any value without additional effort. Discussion: https://postgr.es/m/6631.1587565046@sss.pgh.pa.us
1 parent ee88ef5 commit 3436c5e

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

src/backend/catalog/aclchk.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,6 @@ static void recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid
141141
Acl *new_acl);
142142

143143

144-
#ifdef ACLDEBUG
145-
static void
146-
dumpacl(Acl *acl)
147-
{
148-
int i;
149-
AclItem *aip;
150-
151-
elog(DEBUG2, "acl size = %d, # acls = %d",
152-
ACL_SIZE(acl), ACL_NUM(acl));
153-
aip = ACL_DAT(acl);
154-
for (i = 0; i < ACL_NUM(acl); ++i)
155-
elog(DEBUG2, " acl[%d]: %s", i,
156-
DatumGetCString(DirectFunctionCall1(aclitemout,
157-
PointerGetDatum(aip + i))));
158-
}
159-
#endif /* ACLDEBUG */
160-
161-
162144
/*
163145
* If is_grant is true, adds the given privileges for the list of
164146
* grantees to the existing old_acl. If is_grant is false, the
@@ -178,9 +160,6 @@ merge_acl_with_grant(Acl *old_acl, bool is_grant,
178160

179161
modechg = is_grant ? ACL_MODECHG_ADD : ACL_MODECHG_DEL;
180162

181-
#ifdef ACLDEBUG
182-
dumpacl(old_acl);
183-
#endif
184163
new_acl = old_acl;
185164

186165
foreach(j, grantees)
@@ -219,10 +198,6 @@ merge_acl_with_grant(Acl *old_acl, bool is_grant,
219198
/* avoid memory leak when there are many grantees */
220199
pfree(new_acl);
221200
new_acl = newer_acl;
222-
223-
#ifdef ACLDEBUG
224-
dumpacl(new_acl);
225-
#endif
226201
}
227202

228203
return new_acl;
@@ -3861,21 +3836,13 @@ pg_class_aclmask(Oid table_oid, Oid roleid,
38613836
IsSystemClass(table_oid, classForm) &&
38623837
classForm->relkind != RELKIND_VIEW &&
38633838
!superuser_arg(roleid))
3864-
{
3865-
#ifdef ACLDEBUG
3866-
elog(DEBUG2, "permission denied for system catalog update");
3867-
#endif
38683839
mask &= ~(ACL_INSERT | ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE | ACL_USAGE);
3869-
}
38703840

38713841
/*
38723842
* Otherwise, superusers bypass all permission-checking.
38733843
*/
38743844
if (superuser_arg(roleid))
38753845
{
3876-
#ifdef ACLDEBUG
3877-
elog(DEBUG2, "OID %u is superuser, home free", roleid);
3878-
#endif
38793846
ReleaseSysCache(tuple);
38803847
return mask;
38813848
}

src/backend/utils/adt/acl.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,6 @@ aclparse(const char *s, AclItem *aip)
246246

247247
Assert(s && aip);
248248

249-
#ifdef ACLDEBUG
250-
elog(LOG, "aclparse: input = \"%s\"", s);
251-
#endif
252249
s = getid(s, name);
253250
if (*s != '=')
254251
{
@@ -358,11 +355,6 @@ aclparse(const char *s, AclItem *aip)
358355

359356
ACLITEM_SET_PRIVS_GOPTIONS(*aip, privs, goption);
360357

361-
#ifdef ACLDEBUG
362-
elog(LOG, "aclparse: correctly read [%u %x %x]",
363-
aip->ai_grantee, privs, goption);
364-
#endif
365-
366358
return s;
367359
}
368360

src/include/pg_config_manual.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,3 @@
348348
* Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
349349
*/
350350
/* #define TRACE_SYNCSCAN */
351-
352-
/*
353-
* Other debug #defines (documentation, anyone?)
354-
*/
355-
/* #define ACLDEBUG */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy