On Mon, Feb 06, 2017 at 09:18:09AM -0800, jungle Boogie wrote:
> On 6 February 2017 at 04:41, Marc Espie <[email protected]> wrote:
> > On Sat, Feb 04, 2017 at 08:31:45PM -0800, jungle boogie wrote:
> >> On 02/04/2017 05:45 PM, Philip Guenther wrote:
> >> >On Sat, 4 Feb 2017, jungle boogie wrote:
> >> >>What's happening here?
> >> >>
> >> >>$ doas pkg_add -u
> >> >>Error from http://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
> >> >>ftp: connect: Invalid argument
> >> >
> >> >Running that under ktrace -i might help see the problem, ala
> >> >     doas ktrace -i pkg_add -u
> >> >
> >> >then kdump | less and look for a failed connect call.  Should be able to
> >> >search for "connect -1 errno" and then go backwards to see the connect()
> >> >call and the sockaddr passed to it.
> >> >
> >> >
> >>
> >> Here's where it actually lits the URL:
> >
> > perl doesn't do network connects in that context.
> > just run
> > ftp -o - http://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
> > it should dump the html list of packages.
> >
> > if it doesn't, your network is broken.
> 
> Ah, that's a good trick! I'll keep that in mind if there's a next time.

Another important point: it's run as the _pkgfetch user.
So if you have any kind of local pf rules that varies depending on user,
that might be an issue.

You should properly do something like
doas -u _pkgfetch env -i ftp -o - 
http://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/

(unless you have proxy settings, in which case you should pass the proxy env
variables thru as well)

drop_privileges_and_setup_env is the routine
that does it in PackageRepository.pm, and you can see
it's quite picky about the part of the environment it lets thru...

Reply via email to