Commit Graph

25 Commits

Author SHA1 Message Date
Ceri Davies
64e6e1e463 secure/caroot, certctl: Rename secure/caroot/blacklisted
Old certctl commands still work for compatability, but are deprecated.

Approved by:	secteam (gordon)
Differential Revision: https://reviews.freebsd.org/D30807
2021-06-18 13:38:07 +01:00
John Baldwin
5eb9c93a20 etcupdate: Add -D destdir to usage for 'extract'.
Reported by:	Mark Millard <marklmi@yahoo.com>
MFC after:	1 week
2021-04-26 09:49:34 -07:00
John Baldwin
b0df36580d etcupdate: Remove the old pre-world tree when rotating for -p.
This fixes a bug in an earlier change to move tree rotation to
the end of the update where the step to make room for the new
preworld tree was deleting the old "current" tree instead of
the old "preworld" tree.

Reported by:	olivier, dhw
Fixes:		0611aec3cf
MFC after:	2 weeks
2021-04-23 09:44:18 -07:00
John Baldwin
ba30215ae0 etcupdate: Add a revert mode to restore one or more stock files.
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29846
2021-04-20 13:23:08 -07:00
John Baldwin
ada7fd17d5 etcupdate: Trim trailing whitespace.
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29845
2021-04-20 13:22:24 -07:00
John Baldwin
1f7afa9364 etcupdate: Gracefully handle SIGINT when building trees.
Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29844
2021-04-20 13:22:11 -07:00
John Baldwin
0611aec3cf etcupdate: Always extract to a temporary tree.
etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by:	dim, np (and many others)
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29843
2021-04-20 13:21:42 -07:00
Kyle Evans
0da4b4089c Unbreak etcupdate(8) and mergemaster(8) after r352950
r352950 introduced improper case fall-through for shell scripts. Fix it with
a pipe.

Reported by:	lwhsu, David Wolfskill
2019-10-02 12:46:28 +00:00
Kyle Evans
bbb8014f09 [3/3] etcupdate and mergemaster support for certctl
This commit add support for certctl in mergemaster and etcupdate. Both will
either rehash or prompt for rehash as new certificates are
trusted/blacklisted.

This work was done primarily by allanjude@, with minor contributions by
myself.

No objection from:	secteam
Differential Revision:	https://reviews.freebsd.org/D17389
2019-10-02 01:06:37 +00:00
Baptiste Daroussin
45a13fd899 Move back group, master.passwd and shells to etc directory
Use the .PATH mechanism instead so keep installing them from lib/libc/gen

While here revert 347961 and 347893 which are no longer needed

Discussed with:	manu
Tested by:	manu
ok manu@
2019-05-23 18:37:05 +00:00
Emmanuel Vadot
d0ba99d943 etcupdate: Add missing directory when building the tree
Missed in 348151

Reported by:	lwshu, ci
2019-05-23 14:05:42 +00:00
Emmanuel Vadot
6f4c12f301 etcupdate: Fix -p after the move of the passwd related files
Since PREWORLD_FILES only contain files that needs to be copied into /etc
copy directly those files there.

Reported by:	many
2019-05-23 07:59:16 +00:00
Brad Davis
11f8f36fb9 Fix mergemaster after r347638 and the master.passwd / group move.
Check the legacy directory and use it instead if present.

Install these first if using beinstall.

UPDATING entry to follow.

Approved by:	allanjude (mentor, in person)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20279
2019-05-16 21:50:12 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Eric van Gyzen
1a04446f08 etcupdate: preserve the metadata of the destination file
When using diff3 to perform a three-way merge, etcupdate lost the destination
file's metadata. The metadata from the temporary file were used instead.
This was unpleasant for rc.d scripts, which require execute permission.
Use "cat >" to overwrite the destination file's contents while preserving its
metadata.

Reviewed by:	bapt
Sponsored by:	Dell Technologies
Differential Revision:	https://reviews.freebsd.org/D7817
2016-09-08 15:53:49 +00:00
Baptiste Daroussin
a7212e5721 etcupdate: directly use diff3(1) instead of merge(1)
During the last attempt to rmeove GNU rcs, 2 blockers were spotted:
We need an ident(1) and etcupdate(8) uses merge(1).

Now nothing should prevent to remove rcs from base

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D7401
2016-08-05 19:22:33 +00:00
Bryan Drewery
ffe0dde6c6 META_MODE: Don't require filemon(4) for mergemaster(8)/etcupdate(8)
New .meta files will be created without filemon data, but any future build
that wants filemon data will force a rebuild due to the missing data
due to use of bmake's .MAKE.MODE=missing-filemon=yes feature.

Reported by:	np
Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 days
2016-07-12 19:47:01 +00:00
Edward Tomasz Napierala
3c9ac704ee tzsetup(1) -> tzsetup(8)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:24:34 +00:00
John Baldwin
179fa75e6e Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week
2015-04-23 14:22:20 +00:00
John Baldwin
385d6d4738 Generate /var/db/services.db during 'make distribution' so that it is
present during new installs.  Update etcupdate and mergemaster to
ignore the generated file.

Tested by:	gjb (release build)
MFC after:	1 month
2014-01-22 16:59:53 +00:00
John Baldwin
3e920822b7 - Refresh /etc/localtime after each update using tzsetup -r.
- Regenerate /var/db/services.db when /etc/services changes.

MFC after:	1 week
2013-12-09 19:31:30 +00:00
John Baldwin
8cc81f38e9 Fix a couple of issues with -F:
- Fix ALWAYS_INSTALL to take precedence over the FreeBSD ID checks.
  In particular, always install a file where the only change was
  the FreeBSD ID even if -F is specified.
- Fix the -F option in the case that the only upstream change is a
  change in the FreeBSD ID and the local file is removed.
- Add tests for these two cases.
2013-11-15 20:01:07 +00:00
John Baldwin
11a90beea4 Escape a newline added in the previous commit when verifying the flags
passed to the build, diff, or status commands.
2013-11-13 16:50:19 +00:00
John Baldwin
21d1f635ee Add a pre-world mode of updating similar to the -p option that can be
passed to mergemaster.  In this mode, only changes to /etc/master.passwd
and /etc/group are merged to /etc.  In addition, it uses a temporary
tree to stage these changes rather than overwriting the existing
'current' and 'previous' trees so that a full update can be run after
a normal installworld has completed.

MFC after:	2 weeks
2013-11-12 19:44:18 +00:00
John Baldwin
6f9cd2a9dc The etcupdate utility is a tool for managing updates to files that are
not updated as part of `make installworld' such as files in /etc.  It
manages updates by doing a three-way merge of changes made to these files
against the local versions.  It is also designed to minimize the amount
of user intervention with the goal of simplifying upgrades for clusters
of machines.

The primary difference from mergemaster is that etcupdate requires less
manual work.  The primary difference from etcmerge is that etcupdate
updates files in-place similar to mergemaster rather than building a
separate /etc tree.

Requested by:	obrien, kib, theraven, joeld (among others)
2012-07-13 13:23:48 +00:00