($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Paulo Neves <paulo@myneves.com>
To: Joshua Watt <JPEWhacker@gmail.com>, bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel][PATCH] bitbake-hashclient: Warn on bad .netrc
Date: Sat, 13 Apr 2024 10:48:58 +0000	[thread overview]
Message-ID: <31ac36ac-6510-436f-9b7e-7e32d563eef5@myneves.com> (raw)
In-Reply-To: <20240325155632.2002975-1-JPEWhacker@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

What about wget.py@370?

except (FileNotFoundError, netrc.NetrcParseError):
    pass

Locally i added a the diagnostic as well because python added a permission check that will make bitbake silently
skip netrc authentication on a not obvious parsing errors. From the docs[1]:

> Parse errors will raise
[NetrcParseError](https://docs.python.org/3/library/netrc.html#netrc.NetrcParseError)
with diagnostic
> information including the file name, line number, and terminating token.
> If no argument is specified on a POSIX system, the presence of passwords in
> the

.netrc

file will raise a
[NetrcParseError](https://docs.python.org/3/library/netrc.html#netrc.NetrcParseError)
if the file
> ownership or permissions are insecure (owned by a user other than the user
> running the process, or accessible for read or write by any other user).
> This implements security behavior equivalent to that of ftp and other
> programs that use

.netrc

.

Paulo Neves

[1]
https://docs.python.org/3/library/netrc.html#netrc.netrc

On 3/25/24 16:56, Joshua Watt wrote:

> If there is an error parsing .netrc, warn the user on stderr
>
> Signed-off-by: Joshua Watt
> [<JPEWhacker@gmail.com>](mailto:JPEWhacker@gmail.com)
> ---
>  bitbake/bin/bitbake-hashclient | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/bitbake/bin/bitbake-hashclient b/bitbake/bin/bitbake-hashclient
> index 47dd27cd3c2..610787ed2b0 100755
> --- a/bitbake/bin/bitbake-hashclient
> +++ b/bitbake/bin/bitbake-hashclient
> @@ -346,6 +346,8 @@ def main():
>                  login, _, password = auth
>          except FileNotFoundError:
>              pass
> +        except netrc.NetrcParseError as e:
> +            sys.stderr.write(f"Error parsing {e.filename}:{e.lineno}: {e.msg}\n")
>
>      func = getattr(args, 'func', None)
>      if func:
> --
> 2.34.1
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16013):
> https://lists.openembedded.org/g/bitbake-devel/message/16013
> Mute This Topic:
> https://lists.openembedded.org/mt/105140768/4454782
> Group Owner:
> bitbake-devel+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/bitbake-devel/unsub
> [
> paulo@myneves.com
> ]
> -=-=-=-=-=-=-=-=-=-=-=-

[-- Attachment #2: Type: text/html, Size: 3839 bytes --]

      reply	other threads:[~2024-04-13 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 15:56 [bitbake-devel][PATCH] bitbake-hashclient: Warn on bad .netrc Joshua Watt
2024-04-13 10:48 ` Paulo Neves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31ac36ac-6510-436f-9b7e-7e32d563eef5@myneves.com \
    --to=paulo@myneves.com \
    --cc=JPEWhacker@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).