aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-02-20 00:23:48 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-02-20 00:23:48 -0500
commit692bd09ad12a27fda3566787b089fbd394d7b65b (patch)
tree797421fd19d3e0d4f1edb9119132a43ddccdc440
parent09d8d110a604e52216102e73fb8475b7aa88f1d1 (diff)
downloadpostgresql-692bd09ad12a27fda3566787b089fbd394d7b65b.tar.gz
postgresql-692bd09ad12a27fda3566787b089fbd394d7b65b.zip
Use "#ifdef CATALOG_VARLEN" to protect nullable fields of pg_authid.
This gives a stronger guarantee than a mere comment against accessing these fields as simple struct members. Since rolpassword is in fact varlena, it's not clear why these didn't get marked from the beginning, but let's do it now. Michael Paquier
-rw-r--r--src/include/catalog/pg_authid.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h
index e01e6aaaf14..b3f43e14ac2 100644
--- a/src/include/catalog/pg_authid.h
+++ b/src/include/catalog/pg_authid.h
@@ -56,8 +56,10 @@ CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MAC
int32 rolconnlimit; /* max connections allowed (-1=no limit) */
/* remaining fields may be null; use heap_getattr to read them! */
+#ifdef CATALOG_VARLEN /* variable-length fields start here */
text rolpassword; /* password, if any */
timestamptz rolvaliduntil; /* password expiration time, if any */
+#endif
} FormData_pg_authid;
#undef timestamptz