git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee88ef5)
Remove ACLDEBUG #define and associated code.
2020年4月23日 19:38:04 +0000 (15:38 -0400)
2020年4月23日 19:38:04 +0000 (15:38 -0400)
In the footsteps of aaf069aa3, 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


diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 06687c53a60f6e96a85015b1959761bb8b177a1f..cb2c4972ade94b601a414f9ab3654d5ba8b5077a 100644 (file)
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -141,24 +141,6 @@ static void recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid
Acl *new_acl);
-#ifdef ACLDEBUG
-static void
-dumpacl(Acl *acl)
-{
- int i;
- AclItem *aip;
-
- elog(DEBUG2, "acl size = %d, # acls = %d",
- ACL_SIZE(acl), ACL_NUM(acl));
- aip = ACL_DAT(acl);
- for (i = 0; i < ACL_NUM(acl); ++i)
- elog(DEBUG2, " acl[%d]: %s", i,
- DatumGetCString(DirectFunctionCall1(aclitemout,
- PointerGetDatum(aip + i))));
-}
-#endif /* ACLDEBUG */
-
-
/*
* If is_grant is true, adds the given privileges for the list of
* 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,
modechg = is_grant ? ACL_MODECHG_ADD : ACL_MODECHG_DEL;
-#ifdef ACLDEBUG
- dumpacl(old_acl);
-#endif
new_acl = old_acl;
foreach(j, grantees)
@@ -219,10 +198,6 @@ merge_acl_with_grant(Acl *old_acl, bool is_grant,
/* avoid memory leak when there are many grantees */
pfree(new_acl);
new_acl = newer_acl;
-
-#ifdef ACLDEBUG
- dumpacl(new_acl);
-#endif
}
return new_acl;
@@ -3861,21 +3836,13 @@ pg_class_aclmask(Oid table_oid, Oid roleid,
IsSystemClass(table_oid, classForm) &&
classForm->relkind != RELKIND_VIEW &&
!superuser_arg(roleid))
- {
-#ifdef ACLDEBUG
- elog(DEBUG2, "permission denied for system catalog update");
-#endif
mask &= ~(ACL_INSERT | ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE | ACL_USAGE);
- }
/*
* Otherwise, superusers bypass all permission-checking.
*/
if (superuser_arg(roleid))
{
-#ifdef ACLDEBUG
- elog(DEBUG2, "OID %u is superuser, home free", roleid);
-#endif
ReleaseSysCache(tuple);
return mask;
}
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index bce1f1e0b16cc5137556d1517363218d532bf4e7..de3f49637e22ecb0848b0964fa5ef8d70a6f3dea 100644 (file)
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -246,9 +246,6 @@ aclparse(const char *s, AclItem *aip)
Assert(s && aip);
-#ifdef ACLDEBUG
- elog(LOG, "aclparse: input = \"%s\"", s);
-#endif
s = getid(s, name);
if (*s != '=')
{
@@ -358,11 +355,6 @@ aclparse(const char *s, AclItem *aip)
ACLITEM_SET_PRIVS_GOPTIONS(*aip, privs, goption);
-#ifdef ACLDEBUG
- elog(LOG, "aclparse: correctly read [%u %x %x]",
- aip->ai_grantee, privs, goption);
-#endif
-
return s;
}
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 35d8215a929205f527f5d6999e55ed62a8f3c466..8f3ec6bde183759a2a5f58bc09d9ecf7fd7b942b 100644 (file)
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -348,8 +348,3 @@
* Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
*/
/* #define TRACE_SYNCSCAN */
-
-/*
- * Other debug #defines (documentation, anyone?)
- */
-/* #define ACLDEBUG */
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /