Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qq6vI-008C2o-SD for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Oct 2023 07:12:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qq6vG-00597M-9P for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Oct 2023 07:12:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qq6vF-00597E-Td for pgsql-hackers@lists.postgresql.org; Tue, 10 Oct 2023 07:12:54 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qq6vE-000uh2-D7 for pgsql-hackers@lists.postgresql.org; Tue, 10 Oct 2023 07:12:53 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5041bb9ce51so6729645e87.1 for ; Tue, 10 Oct 2023 00:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696921970; x=1697526770; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rUetOwpnzKwK3Gxdo1HVeF9D+UIlDuF6B3xg3n585cE=; b=Phh1LX9rPTHDOBTx7zGEsvLIJfRGnGV8TV6mt4s9zvMQG0BfapsmdRoGcFjli49l8q dqdhxCHFyYIr/epEkpwIJl/gU+O4lQBEhISHAcS4vvZHmDxmwzlZp5BBi/KbuUQH65LA IUXK9gLvJ3vTXd9bcqt7sw6AEfKd1sZ/vsvpghgFRN1VztVxr76ojSJa7O6V/5+WTh5p 923VjW93W6c2J9yuhn90+WFhI+cHJ61tcM3EUxS0h0X+DcepHGj5Zoo+E6iVDtrDOwKn GFsRUgXe4M59ZY04iIursJL1xboXYTbw0fQgFYWLSPpaAUOwHhHphfUDvr9R63ajejN+ Q+XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696921970; x=1697526770; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rUetOwpnzKwK3Gxdo1HVeF9D+UIlDuF6B3xg3n585cE=; b=YlVA0T1Q5Fd0noB2LgEv/WErFStugjHcTSwyk7AEqxIAURL8yyrZ5BGLjXps3YSAxW 218C9ulIJC8BSGktcuimwRddu1T5mwYCFUJ4bcjdiUEwth+ai8DQmUS8N2/VNKlSYoiJ NF/D2olhRX/WD66B9xPyIdr9CL1qhYByL7+R0LjnHwjkcTxQo+TI9TzVAlKVNne/AXyl 5I4KRVrZoe5hiiVNFzN4R85YjEr7YKbs6nQjr8efYKNB3pf75/6UWbEsL5HiNQYBHQJG qtg3boSDbJfjigpSpcNePRpbruBBhVplmq6uxvVJMa7SpvuguRsFUaBt7jFhHfeuSIZ6 F+0g== X-Gm-Message-State: AOJu0YwMyhvMyKNUuHS1M2NXIE73rCi4iWc7qDMthMrIlLg01mhe3k+p Vr7JGUeTPxgD1TILZyUTre4= X-Google-Smtp-Source: AGHT+IFODpANTl7Ym3qQBzKTHAcTNB9Yyruyy8K/2VDCuGic6YhoPPeZNMnkdt3DUJD4M6rqdowB4g== X-Received: by 2002:a05:6512:39d1:b0:500:ac71:8464 with SMTP id k17-20020a05651239d100b00500ac718464mr17425830lfu.66.1696921970173; Tue, 10 Oct 2023 00:12:50 -0700 (PDT) Received: from ?IPV6:2a01:cb11:55e:1700:e9e9:5f0a:7c38:8bc0? ([2a01:cb11:55e:1700:e9e9:5f0a:7c38:8bc0]) by smtp.gmail.com with ESMTPSA id f17-20020a1c6a11000000b004063ea92492sm13146400wmc.22.2023.10.10.00.12.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Oct 2023 00:12:49 -0700 (PDT) Message-ID: <2b530754-56c0-4272-a326-11d30a0bca55@gmail.com> Date: Tue, 10 Oct 2023 09:12:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag Content-Language: en-US To: Michael Paquier Cc: Bharath Rupireddy , PostgreSQL Hackers References: <566c1686-c80b-4d4a-b496-b00ac428a095@gmail.com> <83f72bb9-f3cf-4344-8d4d-45e128813d58@gmail.com> <26e7cd6a-6dd1-4b08-975b-62603eeb6f3f@gmail.com> <06124373-5fdd-4925-9424-9d036d481f3b@gmail.com> <590ec36a-13cb-4253-934b-b6a220d1026e@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 10/10/23 7:58 AM, Michael Paquier wrote: > On Tue, Oct 10, 2023 at 06:57:05AM +0200, Drouvot, Bertrand wrote: >> Please find attached v9 (v8 rebase due to f483b2090). > > I was looking at v8 just before you sent this v9, and still got > annoyed by the extra boolean argument added to InitPostgres(). Arf, I did not look at it as I had in mind to look at it once this one is in. > So > please let me propose to bite the bullet and refactor that, as of the > 0001 attached that means less diff footprints in all the callers of > InitPostgres() (I am not wedded to the flag names). Thanks for having looked at it! + bits32 init_flags = 0; /* never honor session_preload_libraries */ Also a few word about datallowconn in the comment? (as the flag deals with both). > > It looks like 0002 had the same issues as f483b209: the worker that > could not be started because of the login restriction could be > detected as stopped by worker_spi_launch(), causing the script to fail > hard. > > 0002 is basically your v9, able to work with the refactoring from > 0001. Thanks! #define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002 +#define INIT_PG_BYPASS_ROLE_LOGIN 0x0004 Any reason why INIT_PG_BYPASS_ROLE_LOGIN is not 0x0003? Except that it does look good to me. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com