Add a file descriptor in struct url for netrc
authorbapt <bapt@FreeBSD.org>
Mon, 20 Feb 2017 00:14:31 +0000 (00:14 +0000)
committerbapt <bapt@FreeBSD.org>
Mon, 20 Feb 2017 00:14:31 +0000 (00:14 +0000)
commit44a7c6585089db70eff6095404c7a968e5598b96
tree64424ef80289d108c33eefd3b304034377707e16
parentfdb26eba34c8fc28546b458d229d1d0fed143228
Add a file descriptor in struct url for netrc

When using libfetch in an application that drops privileges when fetching
like pkg(8) then user complain because the application does not read anymore
${HOME}/.netrc. Now a caller can prepare a fd to the said file and manually
assign it to the structure.

It is also a first step to allow to capsicumize libfetch applications

Reviewed by: allanjude, des
Approved by: des
Differential Revision: https://reviews.freebsd.org/D9678
lib/libfetch/common.c
lib/libfetch/fetch.c
lib/libfetch/fetch.h