!process_shared_preload_libraries_in_progress)
elog(FATAL, "cannot create PGC_POSTMASTER variables after startup");
+ /*
+ * Before pljava commit 398f3b876ed402bdaec8bc804f29e2be95c75139
+ * (2015-12-15), two of that module's PGC_USERSET variables facilitated
+ * trivial escalation to superuser privileges. Restrict the variables to
+ * protect sites that have yet to upgrade pljava.
+ */
+ if (context == PGC_USERSET &&
+ (strcmp(name, "pljava.classpath") == 0 ||
+ strcmp(name, "pljava.vmoptions") == 0))
+ context = PGC_SUSET;
+
gen = (struct config_generic *) guc_malloc(ERROR, sz);
memset(gen, 0, sz);