Commit Graph

97 Commits

Author SHA1 Message Date
Baptiste Daroussin
1da56163f2 Remove some unneeded headers 2016-01-13 17:59:12 +00:00
Baptiste Daroussin
4c79e0d6c1 Remove extra debug that crept in 2015-09-08 22:24:20 +00:00
Baptiste Daroussin
61acb4582f Implement pubkey support for the bootstrap
Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To genrate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR:		202622
MFC after:	1 week
2015-09-08 21:25:36 +00:00
Baptiste Daroussin
b50756c759 Fix indentation, no functional changes 2015-09-08 19:25:15 +00:00
Xin LI
f595a30ba0 Plug a possible memory leak.
MFC after:	2 weeks
2015-08-27 06:28:42 +00:00
Xin LI
48f9270689 Issue warning and refuse to proceed further if the configured
repository signature_type is unsupported by bootstrap pkg(7).

Previously, when signature_type specified an unsupported method,
the bootstrap pkg(7) would proceed like when signature_type is
"none".  MITM attackers may be able to use this vulnerability and
bypass validation and install their own versions of pkg(8).

At this time, only fingerprint and none are supported by the
bootstrap pkg(7).

FreeBSD's official pkg(8) repository uses the fingerprint method
and is therefore unaffected.

Errata candidate.

Discussed with:	bapt@
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
2015-08-19 18:24:39 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
cc36fe4926 Allow fetching pkg(8) even if servers/proxies are not passing Content-length 2015-04-03 17:35:30 +00:00
Baptiste Daroussin
79fe80ef10 Test the return of fetchParseURL(3)
CID:		1125811
MFC after:	1 week
2015-02-04 00:18:06 +00:00
Baptiste Daroussin
92947daacf Plug resources leak
CID:		1125813
CID:		1125807
CID:		1125808
MFC after:	1 week
2015-02-04 00:10:57 +00:00
Baptiste Daroussin
c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty
488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Nathan Whitehorn
ffcaf4d24f Remove spurious libelf dependency.
Submitted by:	pluknet
2014-10-28 14:11:54 +00:00
Nathan Whitehorn
60b9a1fcf3 Use pkg-1.4-style platform identifiers based on MACHINE_ARCH (e.g.
FreeBSD:11:amd64 instead of freebsd:11:x86:64) when bootstrapping pkg.
Thanks to portmgr for providing symlinks so both styles work.

Reviewed by:	bapt
MFC after:	3 weeks
2014-10-27 23:19:51 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
d029c3aa25 Rework privatelib/internallib
Make sure everything linking to a privatelib and/or an internallib does it directly
from the OBJDIR rather than DESTDIR.
Add src.libnames.mk so bsd.libnames.mk is not polluted by libraries not existsing
in final installation
Introduce the LD* variable which is what ld(1) is expecting (via LDADD) to link to
internal/privatelib
Directly link to the .so in case of private library to avoid having to complexify
LDFLAGS.

Phabric:	https://phabric.freebsd.org/D553
Reviewed by:	imp, emaste
2014-08-06 22:17:26 +00:00
Gavin Atkinson
4622bc4e31 When we fail to extract the pkg binaries (for example, / is read-only),
give a more helpful error message.

MFC after:	1 week
2014-07-16 00:12:57 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Baptiste Daroussin
b04a7a0baf Import libucl 0.4.0
Adapt pkg(7) to the new libucl API
2014-04-22 22:02:06 +00:00
Bryan Drewery
4d3b6a7866 Add missing LIBM to DPADD from r263650
Reported by:	jilles
2014-03-24 13:13:52 +00:00
Bryan Drewery
825ab35431 Fix build with libucl 20140321 2014-03-22 22:20:43 +00:00
Bryan Drewery
197372c28d Fix ASSUME_ALWAYS_YES not being parsed properly from config after UCL conversion.
Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2014-03-14 17:37:38 +00:00
Bryan Drewery
97c3a76638 Fix ABI from /usr/local/etc/pkg.conf not being respected.
Regression from r259266.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2014-03-14 17:20:45 +00:00
Baptiste Daroussin
d8cfb94376 Remove a useless newline, warnx already appends a newline 2014-02-23 23:49:10 +00:00
Baptiste Daroussin
0ad5dbac61 Update my copyright 2014-02-23 22:04:03 +00:00
Baptiste Daroussin
8a7d859ebf Switch pkg(7) from libyaml to libucl 2014-02-23 21:55:07 +00:00
Baptiste Daroussin
a351c93d95 Implicit include of sys/queue.h instead of relying on gelf.h/libelf.h to bring it
Newer version of gelf.h and libelf.h does not include sys/queue.h anymore

Submitted by:	kaiw
MFC after:	3 days
2014-01-20 22:54:11 +00:00
Baptiste Daroussin
1efc897026 Fix yet another typo
Reported by:	kib
2013-12-23 17:47:04 +00:00
Baptiste Daroussin
e9d9ee5218 Fix typos
Reported by:	bryanv
2013-12-23 17:26:56 +00:00
Baptiste Daroussin
575c4095bf Do not print a question in non-interractive mode but explain why boostrapping
has failed and how to allow it to happen

Reported by:	jmmv
2013-12-23 17:16:44 +00:00
Bryan Drewery
eb31a57474 Fix multi-repository support by properly respecting 'enabled' flag.
This will read the REPOS_DIR env/config setting (default is /etc/pkg
and /usr/local/etc/pkg/repos) and use the last enabled repository.

This can be changed in the environment using a comma-separated list,
or in /usr/local/etc/pkg.conf with JSON array syntax of:
    REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]

Approved by:	bapt
MFC after:	1 week
2013-12-12 17:59:09 +00:00
Baptiste Daroussin
d8d2111e85 Do not create pkg.conf, as it is not necessary anymore and packagesite is deprecated
Reported by:	glebius
MFC after:	3 days
2013-11-25 11:31:42 +00:00
Bryan Drewery
d6ea27390b Follow-up to r258227 and document 'enabled' as a boolean instead of
a string.

Approved by:	bapt
MFC after:	2 days
X-MFC-With:	r258227
2013-11-19 15:43:27 +00:00
Baptiste Daroussin
46b67ede12 argc is now used
MFC after:	2 days
2013-11-16 15:48:49 +00:00
Bryan Drewery
0e088eec8f Remove useless checks for NULL pointer before free(3)
Reported by:		eadler
Approved by:		eadler
2013-11-11 21:42:31 +00:00
Gleb Smirnoff
d2201d13a7 Do not use just freed memory.
Sponsored by:	Nginx, Inc.
2013-11-11 07:44:09 +00:00
Bryan Drewery
5494cb5f12 Remove condition which can never be true as the previous loop
is never exited while remote == NULL.

Reported by:	Coverity
Approved by:	bapt
MFC after:	2 days
2013-11-05 13:36:05 +00:00
Bryan Drewery
cecc016791 Use proper capitalization for FreeBSD.org
Approved by:	bapt
MFC after:	2 days
2013-11-05 02:22:04 +00:00
Bryan Drewery
5212e8bacf Add -f support to 'pkg bootstrap' and 'pkg add' to force installation
of pkg(8) even if already installed.

This is useful if you somehow messup pkg(8) and need to reinstall from
remote with it already being registered in the pkg(8) /var/db/pkg database.

Also add some sanity checks to 'pkg add'.

Approved by:	bapt
MFC after:	2 days
2013-11-01 12:37:36 +00:00
Joel Dahl
7660932692 A few minor mdoc improvements. 2013-10-30 21:49:38 +00:00
Bryan Drewery
5eb90b9ac3 Add a pkg(7) manpage for bootstrap
Approved by:	bapt
MFC after:	2 days
2013-10-30 10:39:14 +00:00
Bryan Drewery
c3e8a27aab Add a 'pkg bootstrap' command which will bootstrap pkg(8) without
forwarding any command to it after installation.

This is useful if the only goal is to install pkg(8) without any extra
output.

Requested by:	cperciva
Approved by:	bapt
MFC after:	2 days
2013-10-30 10:17:16 +00:00
Bryan Drewery
c2788c07bf Fix build with GCC.
BIO_new_mem_buf takes a void* buf, but internally it never modifies the
buf. It assigns the buffer to another pointer and then marks it as
read-only. So deconsting it should be safe here.

Also fix warning about 'buf' possibly being unused in parse_cert()

Approved by:	bapt
MFC after:	2 days
X-MFC-With:	r257147
2013-10-26 19:59:42 +00:00
Bryan Drewery
029df170ca Link in libcrypto as well to fix build in some cases.
Approved by:	bapt
MFC after:	2 days
Reported by:	many
2013-10-26 13:38:49 +00:00
Bryan Drewery
52cb76fe60 Add support to check the signature of a local pkg.txz file being
added with "pkg add". If the pkg.conf is configured to check for
signature, then the pkg.txz.sig file will be expected and validated
per r257147

Approved by:	bapt
MFC after:	2 days
2013-10-26 03:47:49 +00:00