From patchwork Thu Dec 3 11:46:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 107195 Received: from mail.fris.de (mail.fris.de [116.203.77.234]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.12287.1796298395023570361 for ; Thu, 03 Dec 2026 03:46:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@fris.de header.s=mail header.b=ld2f4ukC; spf=pass (domain: fris.de, ip: 116.203.77.234, mailfrom: frieder@fris.de) From: Frieder Schrempf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fris.de; s=mail; t=1796298392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Jq6FDt0n5Wjyi747RAtyv5H7Aq37oV5tE/Jtxo9SI7I=; b=ld2f4ukCqW0gOYP4Yh6mS8fvfnvXRfGLybXa79SSlcR7xtGxkaOfyuJu7qtSx+esa00j8Z S+V161h2AfjSkImh15LFYIafyzEGG0VJxo/iTEuojgFZ9YyS4vaY6jrOwVhpr0puama8rS 8IwF1j8A7vljJvaC1EX0cfVVCU8WykyfpKerRxoKgE16MW0f+pvMjzffUxnA9L1FnPKyK8 sWNjyfEtVrw6XMhshmuREe9WPDe9U3QN4F4DSictPTbz44loVGXzg6R0pd9yLTqsPDwiGt R8Ev13NSeCqprOhRIR6gHwL89SkiWqytXoblEVj+oEikPeMO7ejwerNKXN5T5A== To: bitbake-devel@lists.openembedded.org Cc: Eberhard Stoll , Frieder Schrempf Subject: [PATCH] fetch/wget: Fix netrc auth under pseudo Date: Thu, 3 Dec 2026 12:46:22 +0100 Message-ID: <20261203114622.2237041-1-frieder@fris.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 11:46:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/20526 From: Eberhard Stoll checkstatus() calls netrc.netrc() without a path, so Python checks that ~/.netrc is owned by getuid(). Under pseudo getuid() is 0, the check fails, the NetrcParseError is ignored and no auth is sent. Fakeroot setscene tasks then get HTTP 401 from an authenticated sstate mirror ("No sstate archive obtainable"). Pass the path explicitly to skip the owner and permission checks, which the wget binary doesn't do either. Tested with an authenticated sstate mirror on Yocto 6.0: fakeroot setscene tasks now fetch. AI-Generated: Uses Claude Code Signed-off-by: Eberhard Stoll Signed-off-by: Frieder Schrempf --- lib/bb/fetch/wget.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch/wget.py b/lib/bb/fetch/wget.py index 4db047f94..b2f440608 100644 --- a/lib/bb/fetch/wget.py +++ b/lib/bb/fetch/wget.py @@ -481,7 +481,10 @@ class Wget(FetchMethod): try: import netrc - auth_data = netrc.netrc().authenticators(urllib.parse.urlparse(uri).hostname) + # Explicit path: skip the owner check, which fails under + # pseudo where getuid() is 0 + netrc_path = os.path.join(os.path.expanduser("~"), ".netrc") + auth_data = netrc.netrc(netrc_path).authenticators(urllib.parse.urlparse(uri).hostname) if auth_data: login, _, password = auth_data add_basic_auth("%s:%s" % (login, password), r)