Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mg7k0-0007d5-Qg for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 15:54:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mg7jz-0004U9-Eh for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Oct 2021 15:54:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mg7Oy-0007vp-Ve for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 15:33:13 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mg7Ow-0001Jo-QV for pgsql-bugs@lists.postgresql.org; Thu, 28 Oct 2021 15:33:11 +0000 Received: by mail-qk1-x731.google.com with SMTP id bi29so6186943qkb.5 for ; Thu, 28 Oct 2021 08:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kapitaltrading-com.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ggrR12sfQhIKYDlWBGCTbeDsR2hM9zMvGVkxKmd1KyQ=; b=sk5FkWRKV2aCaXpXpBk3DhVETPnIzvqY6xoaqnhKTuEaeWEvf0kSTZlXsRjgWnUPOI 42PbTGbd+/39f6GpVuFg//TQQK0m403dWTyYWhX90x6Ywlm4Ojz8LH2wPPgmfrSbqQfB tC7yYF6kb2xF+f/nxp9mzFf07nlbMM+JXNRc2RxQjq4+RCCBPyTm6SQ3ucnnhxLYNbBy gNjephm5UfwOZb1MBn8r1VZdTaHP7OEr9nY5Y75I4oFgEykVhtttMN70bsXo4nieAE0R WDy9AO2quARxye09KP9t8808+6wO9aNKWA531mGB57wVSdA9gI9vIPbP0umUB9ZwC9v4 mGqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=ggrR12sfQhIKYDlWBGCTbeDsR2hM9zMvGVkxKmd1KyQ=; b=Dz8n/FNKSpcuWB/eok7IkgrYrKfxJgXkKvTzFwNCLhfrwnF+DKvdWeRR2z3IHAdZjj sB7rCk2oS0nMujhFWymL8/RO8dA30iVKL+3hJH7KwhO3mF7QsuC60Ci32f6xR9Yr/o/6 84oEMzLTzOuy1d1PGKqrzI8HvnGDLqrZJs8IVRHQtnh+pkowr/NEEg4UucmBveCSw1ZT ivnv9STE9W9intALxspFGhv9iVhKqTiNtlVvdSklYZ4RWCBlR7maZMSevwjOG0CVvemq GnCA5wII2XoZj65j3pecMSF99S62XKzlDesI4cn6mB4bQaZJyromWPhMf6gZ6Yo9OVPO l1vQ== X-Gm-Message-State: AOAM531GPmawREUGTQnaz2qv2IOwE2HTh34VASTri4zQe6tAe21WT3RX Uil1P4v54NTWziGrdCPSFasVhIqmR4khjvcI X-Google-Smtp-Source: ABdhPJwAzwhjunmZ8UFvS7jkHS0wihWVpVp7nCPi+lvvYeQTOAQyny+4ab0jrXwcQzFtXFPT2AjbEw== X-Received: by 2002:a05:620a:4442:: with SMTP id w2mr4338741qkp.320.1635435189831; Thu, 28 Oct 2021 08:33:09 -0700 (PDT) Received: from [192.168.96.21] ([38.89.235.100]) by smtp.gmail.com with ESMTPSA id u20sm2040480qtw.20.2021.10.28.08.33.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Oct 2021 08:33:09 -0700 (PDT) Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4 To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <17249-c2fa2b1085dfb2f7@postgresql.org> <287305.1635380278@sss.pgh.pa.us> From: David Hillman Organization: Kapital Trading Message-ID: Date: Thu, 28 Oct 2021 10:33:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <287305.1635380278@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/27/21 7:17 PM, Tom Lane wrote: > Notice it says "peer authentication", not "password authentication". > So the password was never asked for, and the problem is that you're > not logged in as "valid_user" (rather, it looks like, as "root"). This is still a bug, since per your description, the -U flag doesn't work correctly -- or is meaningless.  And, the -U flag works differently depending on which other flags are set ( -h in his case ), as my example does show, and that's not documented anywhere, as far as I know. > This is evidently going to a different pg_hba.conf line, which > might or might not be selecting password auth --- we can't see it. There exist no such lines which pertain to "valid_user" here. Furthermore, if I remove .pgpass, this case's result changes. root@dbserver:~# cat ~/.pgpass cat: /root/.pgpass: No such file or directory root@dbserver:~# psql -d postgres -U valid_user -h localhost Password for user valid_user: Clearly, .pgpass is being utilized in the second example, and not in the first, contrary to the apparent intent and the documentation. -- David Hillman david@kapitaltrading.com