mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Set GUC "is_superuser" in all processes that set AuthenticatedUserId.
It was always false in single-user mode, in autovacuum workers, and in background workers. This had no specifically-identified security consequences, but non-core code or future work might make it security-relevant. Back-patch to v11 (all supported versions). Jelte Fennema-Nio. Reported by Jelte Fennema-Nio.
This commit is contained in:
		@@ -797,6 +797,14 @@ InitializeSessionUserIdStandalone(void)
 | 
			
		||||
	AuthenticatedUserIsSuperuser = true;
 | 
			
		||||
 | 
			
		||||
	SetSessionUserId(BOOTSTRAP_SUPERUSERID, true);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * XXX This should set SetConfigOption("session_authorization"), too.
 | 
			
		||||
	 * Since we don't, C code will get NULL, and current_setting() will get an
 | 
			
		||||
	 * empty string.
 | 
			
		||||
	 */
 | 
			
		||||
	SetConfigOption("is_superuser", "on",
 | 
			
		||||
					PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user