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 1qMBCw-001aLq-I9 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:43:26 +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 1qMBCu-008aCt-U0 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:43:24 +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 1qMBCu-008aCl-KE for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 17:43:24 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMBCr-000Lvs-RQ for pgsql-hackers@postgresql.org; Wed, 19 Jul 2023 17:43:23 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-55b8f1c930eso4664422eaf.3 for ; Wed, 19 Jul 2023 10:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689788601; x=1692380601; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fJQdiE5hBtDA0Bi/hvGiY4CuSSzRf+m1shpayYyPdwQ=; b=GSS0PA0p0vOl+N2Tl790PIqLsCO8oU9dFK94CobHdm+ZbRTrORrMHTtpOl4uwdKdAF hNasYaT9xTli+5hAt0jlRsvKp+8CMsH4y1zSUUs0a91XNPJP34weSxdvocpiSpAD+0rP +QxXYL/hd/RJmvP+gHjwwCEThx0ZwHEfz8RDnphbDS8DHD709VsEOC0sd3rFY6vd0Tk+ Xnakdogrgq412NEB4d/KogjP+Psad9gR9OnkA2j2nlpQx1OOdIOJRTR3wSpEbxpQxucG MBKyp3wtmQti9/Heu4Xf1ftziH1eeDtxgbCGtSmSbTG+LVeX/CWW5R9dzwJYMh27SYVp uFPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689788601; x=1692380601; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fJQdiE5hBtDA0Bi/hvGiY4CuSSzRf+m1shpayYyPdwQ=; b=OkajLyY620Ch2/N1zL1bvEzc1ViAO+PGxVWSU51wrGm1kYkCCAaAWXl7wkG4cfWU4q Bs0DvrPcRWSdnfujVOHuwzgihevY2PcITa5N+3JGvLpVJ4CaE22yYOt1W+NjJmc2EM2k VD6G8vZWdBLxsVqHu7fDqurFfY/KNFL0S1T8cxkHAbK8ZDbNbWthXZyoIosqK5BNigtJ 0SUt2j2MbLPIDDkA8b9gIPqAHEyH1+FmlMojUzmXgv/Ip5Qxjeerm6R7r8FztVz//kLn TjRNeE0wXUpEjgcAdrsmN7eUmscKmdSKDTazGkXoDVWyWt9r432GyUSkIJZ0xnTnrNF+ Kn6A== X-Gm-Message-State: ABy/qLY06fQbcRhnYTPC+NxO4E1EEXOFCRgBlmnnsI/GpD0WNWuJY4kj cqG7JU/917uyy7YnTwCGCOI= X-Google-Smtp-Source: APBJJlEaPLm5VBYj8qX7UZleeMuFzOqqYMjuUZxfdDJDao6yRy89qXHNKiM5k7XLNy9YrNvb3i0Csw== X-Received: by 2002:a05:6358:720d:b0:129:c1dc:e6d8 with SMTP id h13-20020a056358720d00b00129c1dce6d8mr4138832rwa.32.1689788594114; Wed, 19 Jul 2023 10:43:14 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id s13-20020a17090a440d00b00263154aab24sm1390793pjg.57.2023.07.19.10.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 10:43:13 -0700 (PDT) Date: Wed, 19 Jul 2023 10:43:11 -0700 From: Nathan Bossart To: Gurjeet Singh Cc: pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us Subject: Re: harmonize password reuse in vacuumdb, clusterdb, and reindexdb Message-ID: <20230719174311.GA1186744@nathanxps13> References: <20230628045741.GA1813397@nathanxps13> <20230629052409.GB2049807@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230629052409.GB2049807@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 28, 2023 at 10:24:09PM -0700, Nathan Bossart wrote: > On Wed, Jun 28, 2023 at 09:20:03PM -0700, Gurjeet Singh wrote: >> The comment on top of connect_utils.c:connectDatabase() seems pertinent: >> >>> (Callers should not pass >>> * allow_password_reuse=true unless reconnecting to the same database+user >>> * as before, else we might create password exposure hazards.) >> >> The callers of {cluster|reindex}_one_database() (which in turn call >> connectDatabase()) clearly pass different database names in successive >> calls to these functions. So the patch seems to be in conflict with >> the recommendation in the comment. >> >> [ ... ] > > The same commit that added this comment (ff402ae) also set the > allow_password_reuse parameter to true in vacuumdb's connectDatabase() > calls. I found a message from the corresponding thread that provides some > additional detail [0]. I wonder if this comment should instead recommend > against using the allow_password_reuse flag unless reconnecting to the same > host/port/user target. Connecting to different databases with the same > host/port/user information seems okay. Maybe I am missing something... I added Tom here since it looks like he was the original author of this comment. Tom, do you have any concerns with updating the comment for connectDatabase() in src/fe_utils/connect_utils.c like this? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com