15 November 2026 1.32h: verify_hosts compares each attribute only among
    the hosts (or chroot copies) that recorded it; a host whose set records
    no digest for files its peers digest made another host appear to
    differ. The host whose sets disagree with most peers' is reported.
15 November 2026 1.32g: may-lack: in a verify_hosts host block names
    common paths that host need not have.
15 November 2026 1.32f: verify_hosts compares only the specs each host's
    spec of specs lists, and that match its digests; specs left in the
    central copy after the host removed them (rsync without --delete)
    had been loaded too, making hosts appear to differ from their peers.
    Left-over, mismatched and missing specs are reported.
14 November 2026 1.32e: -s new (or -s uninitialized) with initialize
    works again, initializing only trees without a spec (it had been
    rejected as an invalid set name since 1.17); new and uninitialized
    are refused as set names in set: definitions.
14 November 2026 1.32d: verify_hosts chroot blocks take "mirror: -dir"
    to mirror a directory's contents but not the directory itself (for
    /var/www/bin, group daemon by mtree), and report a mirror: entry that
    matches nothing in a host's copy of the chroot.
14 November 2026 1.32c: verify_hosts no longer reports chroot files
    whose system counterpart is in except: (libc, ld.so) as differing
    between hosts; each copy is still checked against its own host's
    system file.
14 November 2026 1.32b: update and initialize stop before the passphrase
    prompt when the specs are locked with schg and the securelevel is
    above 0 (the test existed but could only be reached when the host
    spec did not exist, so update failed at the first chflags instead).
12 November 2026 1.32a: Fix 1.32's unveil change on OpenBSD: it
    tested for chflags and ls after the first unveil call, so neither was
    unveiled, ls could not be run, and every path's flags were recorded
    as undefined. File tests in the unveil block now come first.
11 November 2026 1.32: Fixes after a review of 1.31 by another
    session. check_file makes its path canonical (trailing /, //, /./,
    .. resolved; .. after a symlink refused), so "check_file dir/" no
    longer records junk paths that update puts in the spec. File names and
    privileged errors are escaped in update output, the spec dir list,
    the extraneous-file list and per-file warnings. changes exits 2 on
    every error, including bad options, and refuses an option given after
    the command. On OpenBSD, chflags and ls are unveiled even with
    immutable-specs: no (flags were recorded as undefined). Under privsep,
    check -v lists extraneous spec-dir files (it said there were none).
    verify_hosts reports a spec that holds a different tree than its name.
10 November 2026 1.31: verify_hosts detail query steps forward past
    snapshots whose spec signatures can't be verified (e.g., GPG-signed
    before the move to signify), hides mtime/ctime changes unless -v,
    and takes -k to name the attributes to show. check stores old and
    new values of changed attributes in the changed file; check's
    summary and changes -v show them, plain changes shows changed
    attribute names per path. changes spec or changes /path shows the
    pending changes in a spec's tree or at/beneath a path, with values
    (check's long form with -v), and reports changes since undone or
    changed again. -k works with changes. Change display shared by
    check, changes, and verify_hosts; modes shown as four octal digits,
    control characters escaped. Fix bugs: partial update or initialize
    left updated trees' paths in the changed file's per-set lists, so
    changes -v still showed them; -m put changed attribute names out of
    step with paths in the summary; check recorded no check time for the
    spec dir, so changes died when the spec dir had changed; update
    could miss removing a tree no longer in the config from the changed
    file. -m now counts changes inside each macOS app ("Inside macOS
    apps") in check's summary and changes rather than omitting them,
    and check -v no longer lists them one by one. check_file checked
    nothing but the spec dir; it now checks the file, or a directory and
    everything beneath it. A check now replaces pending changes only
    for what it checked (the trees in the -s sets, the check_file path,
    or for check_specs just the spec dir), keeping the rest from the
    previous check; before, any check replaced all of them.
8 November 2026 1.30:  No longer delete changed files when empty
    (use for verify_hosts), make changes exit 0 if changes are
    pending, 1 if changed file is empty, other nonzero for errors.
    verify_hosts rollback check walks snapshots between the previous
    and current, verify_hosts with a spec will show what paths
    changed and with a path will compare, if possible to snapshots to
    show an actual diff. Record device numbers for device nodes in specs.
    Do chroot checks with verify_hosts when configured.
8 November 2026 1.29: Add verify_hosts for checking specs from multiple
    hosts vs. each other and backup snapshots.
8 November 2026 1.28a: Fix bug that causes extraneous error messages
    on Linux when checking flags.
7 November 2026 1.28: Improve performance by getting flags in batches,
    add primary- and secondary- versions of exception and exception-tree.
6 November 2026 1.27: Bug fix of bug introduced in previous version where
    a failed read on one file yields no output from an entire check run.
15 October 2026 1.26: Bug fixes and improvements after Claude Opus 5.5 review:
    call Signify::sign and Signify::verify with Signify.pm's named
    arguments and require Signify.pm 1.4 (1.3 can report a successful
    signing with a signify -n key as failed). Privileged parent:
    is_allowed_path rejects ".." components, so the unprivileged process
    can no longer have root open any file via "$tree/../.."; removed the
   /tmp/sigtree.* exception from is_sigtree_managed_file (unused under
    privsep), through which the unprivileged process could have root
    run chflags on a symlink it placed in /tmp; chflags now runs with -h
    so a symlink is never followed; signing and verification use the
    parent's own method and keys, not the request's; the passphrase it
    receives is overwritten after use. A failed signature (signify or
    PGP) now stops initialize and update, and update signs a spec before
    removing its tree from the changed file, so a wrong passphrase no
    longer leaves specs with stale signatures and the changes forgotten.
    initialize and update also sign a throwaway file right after the
    passphrase prompt (in the privileged parent under privsep), so a
    wrong passphrase stops them before any spec is changed.
    initialize and check now treat a worker that died as failed (its
    tree's changes are kept; check does not write a changed file with a
    tree missing) and exit non-zero. chflags/chattr failures are
    reported and fatal, including under privsep, where the request used
    to report success; "Unable to reset" no longer exits 0. Securelevel
    -1 is accepted and treated as 0; sysctl failures are reported.
    update's "Failed to load spec ... skipping" now skips only that tree
    (it ended the update with the spec dir unlocked). An absolute -d
    outside the root dir now works under privsep (the privileged parent
    refused the host spec, which is in the spec dir's parent) and its
    spec dir is in the sigtree set (it had no set). An absolute
    exception or exception-tree path is now a config error (it never
    matched, and with an ignored set gave no warning), and an
    exception-tree for the whole tree says to change the tree's sets
    instead. unveil: the spec
    dir's parent is unveiled when an absolute -d puts it outside the
    root dir; dropped x where nothing is exec'd and /bin/sh for the
    immutable commands (ls is run directly). Removed the Linux-only FD
    ACK (reads are exact-length sysread) and bounded the descriptor wait
    at 30 seconds instead; SIGPIPE is ignored around socket writes; a
    lost or corrupt privsep response is fatal instead of read as
    success. Worker temp changed files are marked by the caller rather
    than by a /tmp/ path prefix, and their temp dir is removed even
    after a worker died with its file half-written. Spec and changed
    file writes check close. yes_or_no treats end of input as no; no passphrase at end of
    input is an error. The passphrase is overwritten at the end of
    initialize and update (the 1 May wipe applied only to an empty
    string). require 5.010, which the code already needed.
1 July 2026: 1.25: Bug fixes and improvements after Claude Opus 4.8 review:
	- Fixed privilege-separation readdir failure: request_readdir read
	the response under key 'entries_b64', but handle_readdir_request
	returns it as 'entries', causing an undef array deref (fatal under
	strict) on any directory the unprivileged user cannot read
	directly (e.g. the 0700 spec dir). Now reads 'entries', with a
	defensive || [].
	- Fixed missing "/" in the host-spec existence
	test in verify_required_dirs
	(was $spec_dir_dir . "$spec_spec"), which had made the host-spec
	readability/writability checks unreachable dead code.
	- Fixed wrong-case hash key in FileAttr::compare: an nlink
	difference stored $fileattr->{nlink} (undef) instead of {NLINK},
	suppressing display of nlink changes even though the change was
	still detected.
	- Fixed ChangedFile::reset_changed_file initializing its hash
	fields with = () (which yields undef) instead of = {}. TIME/USER
	are intentionally left un-reset so the history of prior,
	not-yet-updated checks is preserved.
	- Fixed a dead load-failure check in check_sets that tested
	$changed_file (the filename, always true) instead of $changedfile
	(the object).
	- Hardened privileged and nonprivileged file reads against
	symlink/TOCTOU swaps: added O_NOFOLLOW (and O_NONBLOCK) to read
	opens; special-cased ELOOP/EMLINK to report a file whose type
	changed between stat and open (the nonpriv path warns and skips
	the privileged fallback rather than masking the swap); and added
	an fstat dev/ino comparison against the classifying lstat to catch
	intermediate-directory symlink and inode swaps.  Added a "refusing
	to write through symlink" message on the write path.
	- Removed dead IPC helpers request_write_file/request_read_file,
	which sent WRITE_FILE/READ_FILE request types that no handler
	dispatched.
	- Replaced regex-based exact matching of tree paths
	(grep /^$tree$/) with string eq / quotemeta, to avoid mismatching
	paths that contain regex metacharacters; fixed incomplete (non-/g)
	escaping in tree-path matching.
	- Fixed a fork-count off-by-one that compared $#specified_trees
	(last index) to the requested child count, under-parallelizing by
	one and disabling forking entirely with two trees.
	- Tightened config validation of
	max_child_procs/default_child_procs (anchored the integer regex;
	removed a redundant assignment).
	- Corrected a stale comment in recv_request (the limit is 1MB, not
	10MB).
17 May 2026: 1.24c: Move config permissions check into Config package
	and improve it.
12 May 2026: 1.24b: Correct sysctl location and output parsing for macOS,
	change process names of forked child processes.
4 May 2026: 1.24a: Add interrupt handler for passphrase input.
1 May 2026: 1.24: Security improvements after Claude Security (Opus 4.7) assessment:
	Wipe $pgp_passphrase from memory after use, don't follow symlinks for
	privileged file opens for writing, don't follow symlinks for unprivileged
	file opens for writing, tighten up checks for sigtree managed files and
	don't allow directory traversal within sigtree managed dirs in calls to
	privileged file opens for writing.
16 April 2026: 1.23a: Warn about world-readble/group-readable configs and specs.
13 April 2026: 1.23: Fix bug in critical-log (mtimestasis) handling.
28 February 2026: 1.22e: Remove deprecated pledge for "tmppath."
14 February 2026: 1.22d: Minor cleanup, comments, don't set $PGP_or_GPG to GPG1
	just for privsep workaround for gpg-agent when using GPG2.
7 February 2026: 1.22c: Fix privsep references to $MAIN_PRIV_SOCK,
	remove warning for nonexistent file/dir in request_stat.
	Fix GPG signing with privsep.
4 February 2026: 1.22b: Fix privsep handling of files with non-UTF8
	characters. Add strict/warnings for each package.
1 February 2026: 1.22a: Fix bugs in child changed file handling in
	privilege separation case, remove unnecessary locking,
	add FD passing ACK timeout for Linux. Fix bug in worker
	socket assignment.
31 January 2026: 1.22: Privilege separation and cleanup, better
	error handling. Privsep off by default and not yet fully
	tested on all platforms.
11 January 2026: 1.21c: Some cleanup, more granular use of pledge,
	stop locking the main specdir, move changedfile and spec spec
	location in preparation for privsep implementation.
11 December 2025: 1.21b: Fixed another bug in link target handling.
9 December 2025: 1.21a: Fixed bug in link target handling, only load
	Parallel::ForkManager when needed.
5 November 2025: 1.21: Replaced mktemp calls with File::Temp,
	replaced all backtick shell calls with open pipes. Ignore
	/dev/shm subtree in default Linux config.
28 September 2025: 1.20b: Add "devpts" to nonstandard fs type list,
	don't run create_tree or fork children for unnecessary sets when
	-s is used, add exception to Linux config for /dev/core to ignore.
20 September 2025: 1.20a: Use full references for PGP::Sign and add
	linux.sigtree.conf
13 September 2025: 1.19h: Only load PGP::Sign/Signify when needed,
	don't use Linux runlevel for checking immutable capability,
	don't use lsattr on character special files or files on fuse,
	msdos, or other non-standard filesystems. Updated README.
6 September 2025: 1.19g: set fork_children=0 for initialize_specs.
27 August 2025: 1.19f: sanitize environment, avoid shell in system calls.
21 December 2024: 1.19e: unveil sigtree dirs with rwxc.
12 October 2024: 1.19d: expand unveil to /.
1 September 2024: 1.19c: fix Linux immutability issues.
30 August 2024: 1.19b: fix immutable_file/_get_file_flags bugs.
14 August 2024: 1.19a: -f option for number of child processes, config
	options for max_child_procs and default_child_procs, -m for
	macOS to not show contents of macOS applications, fixed bug
	in filename escaping for immutable flag collection.
10 August 2024: 1.19: Fork children to speed up check and initialize.
	Use Signify.pm and OpenBSD::MkTemp.
7 January 2024: 1.18d: Minor bug fixes in error messages and signify
	signature creation. Use Storable built-in locking.
30 December 2023: 1.18c: Call pledge correctly, not require pgpkeyid when
	using signify.
16 December 2023: 1.18b: Fix bug for OpenBSD: unveil /tmp. Oops.
9 December 2023: 1.18a: Fix unveil for commands to be rx, not x.
3 December 2023: 1.18: Added pledge and unveil for OpenBSD;
	updated config file to not monitor pflog, just pflog.txt
18 October 2023: 1.17d: Continue instead of aborting when fileattr cannot
	be retrieved.
23 January 2022: 1.17c: Fixed all edge cases of the display issue and an
	update issue for extraneous files.
23 January 2022: 1.17b: Removed paren escaping, unnecessary and wrong.
	Fixed a minor cosmetic display issue (added an extra blank line after
	found extraneous files).
22 January 2022: 1.17a: Fix "$" escape, remove extraneous stuff from
	changed file and be more careful about update_sets trying to
	use changed file trees that are no longer in the config.
20 January 2022: 1.17: Escape "$" char in commands to get immutable flags,
	fix error message for signing key-related fields when specified
	file can't be read (change made shortly after 1.16 release).
	Also re-implement escaping of parens from 2012. Warn about
	extraneous files (not in config) in specification dir for check
	commands, remove extraneous files from specification dir for
	initialize/update commands. Allow initialize to use
	-s option with a set name "new" or "uninitialized" to
	initialize all uninitialized trees in the config. Make "new" and
	"uninitialized" a reserved word for sets in configs. Gave the
	README file a long-overdue update.
28 July 2021: 1.16: Added signify as alternative to PGP/GPG.
21 July 2021: 1.15: Don't warn for nonexistent exceptions or exception-trees
	when the primary set has the "ignore" keyword.
23 May 2021: 1.14: Don't prompt for passphrase with GPG 2, remove partial
	implementation of "interactive mode".
3 August 2019: 1.13: Bug fix to allow update to update spec_dir tree.
7 October 2018: 1.13: Bug fix in initialize with -s, improved macOS config.
17 November 2017: 1.12: Bug fixes in flag handling, default config for macOS.
10 October 2015: 1.11: Added SHA-3 and made it the default. Added
	sha3_digest keyword to config, shadigest/sha3digest keyword for sets.
	The internal storage of SHA digests has changed incompatibly,
	requiring all existing specs to be reinitialized.
24 March 2014: 1.11 (still unreleased): Split out tree for /usr/X11R6
	into /usr/X11R6/bin and /usr/X11R6/lib.
30 March 2013: 1.11 Changed CRIT-LOG definition to use mtimestasis-24h,
	and added it to authlog, daemon, lastlog, maillog, messages,
	and secure.
25 March 2013: 1.10 Added mtimestasis-\d{1,2}[smhd] keyword, which
	reports on mtime failure to change for more than \d{1,2}
	seconds/minutes/hours/days.
19 November 2012: 1.9 Fix double error message for nonexistent
	exception-trees, plus typo in error message/inadvertent
	lowercasing of line. Added new secondary sets system (SYS) and
	user (USER) to default config file.
10 November 2012: 1.9 Will die if hostname is undefined.
3 November 2012: 1.8 Using Digest::SHA instead of Digest::SHA1 and
	Digest::SHA2. Removed sha_digest configuration keyword, replaced
	it with sha2_digest keyword which allows values of 256, 384, and 512.
25 December 2011: 1.7 Repackaged the tarball to make it work better as
	an OpenBSD port/package, changed default location of sigtree.pl
	and sigtree.conf, fixed bug in &verify_required_dirs to allow
	creation of new specs when using immutable flag, added option to
	use either system or user immutable flags on BSD, fixed bug in
	&is_immutable that had BSD and Linux options switched.  Default
	location of config file is now /etc/<hostname>.sigtree.conf,
	default location of specs is now /var/db/sigtree.
23 December 2011: 1.6a Repackaged the tarball to make it work better
	as an OpenBSD port/package, changed default location of sigtree.pl
	and sigtree.conf.
23 November 2008: 1.6 Modified to not create trees in sets marked ignore and
	to compute SHA1/SHA2 digests based on keywords in primary set rather
	than based on the global configuration sha_digest field, which is now
	ignored.
5 March 2005: 1.5 Added sha_digest field to global section of config file;
	added support for SHA2 digests (instead of or in addition to SHA1
	digests).
3 September 2004: 1.4a Test for $self->{LINKTARGET_TYPE} being defined
	before using it, for backwards compatibility with old specs.
2 September 2004: 1.4 Test for whether we got file flags results, set to
	"<undefined>" if we didn't.
24 August 2004: Moved file type assignment to separate subroutine.  Added
	new linktarget_type keyword.  Started tracking attributes of link
	targets, except for directory contents.
16 July 2004: 1.3 Fixed bug in check_file command to allow check_file for
	files that don't exist in the file system.  Fixed bug in
	FileAttr::compare that was causing deleted files to sometimes show
	up as added.
14 July 2004: Fixed bug in show_changes subroutine where it was attempting
	to display changed attributes via call to subroutine that requires
	a set as an argument, but supplying a tree.
10 June 2004: 1.2c Fixed bug created by OpenBSD 3.5's move of the
	location of sysctl from /usr/sbin to /sbin.
5 January 2004: 1.2b Fixed bug--stopped calling Digest::SHA1 on dirs
	since it's not supported.
8 April 2003: 1.2a Fixed bug in listing file attributes where special
	characters in file names need to be quoted (now that OpenBSD 3.3
	has a file with a space in its name in the default install).
26 February 2003: 1.2 Fixed bug in file writability check (when file doesn't
	exist), fixed references to directory of spec directories.
25 February 2003: Added better Linux support for file system attributes,
	allow -d paths relative to root_dir, special-cased -d secondary to
	not use PGP or immutable flags and to use a separate changed file.
23 February 2003: Added check for file writability for specifications
	before attempting to write to them.
22 February 2003: Made changes show list of changed attributes for
	each changed path.  Added "new" set code to valid_setlist and
	defined_set in preparation for adding the ability to initialize
	only new sets.  (Need to add code to automatically identify trees
	that don't have specs as members of "new", and to allow initialize
	to work for set new (and only set new) when immutable flags are
	used and securelevel is > 0.  There is a potential problem
	regarding specs for specs.)
22 January 2003: 1.1b Made a change to reset_changed_file.
9 January 2003: 1.1a Fixed bug in changed file support to allow -v support
	for "changes" command to work.
6 January 2003: 1.1 Added file system flags support.  Changed the behavior
	of the "exception:" field for directories (now counts just for the
	directory itself, not any files or directories under it) and added
	"exception-dir:" for the old behavior.  Added -v support to "changes"
	command (it now prints the details that "check" prints).  Allowed "."
	for "exception:" field.
3 March 2001: 1.05 Fixed GPG support and made it the default.
	Host setting will now respect case where no domain name
	is set (pretty much just cosmetic).
2 April 2000: 1.04 Added "ignore" keyword for files that aren't to be
	checked for changes, added "ignored" set in default config file.
28 March 2000: Modified to support chattr +i/-i for Linux immutable
	files.
12 February 2000: 1.03 Added additional documentation to README file.
	Modified Config to make sure that no trees are subtrees of other
	trees. 	Modified to check to make sure that at least one of the
	sets specified with the -s option has members (and warn about
	those that don't).  Added check_file command.  Fixed bug where
	no summary report would be printed if there were no changes,
	only additions or deletions of files.  Added changes command.
11 February 2000:  Modified to correct minor bug in reg exp that validates
	"tree:" fields in conf file.
6 February 2000: 1.02 Modified to correct "new nonexistent added" problem
	which occurred when a file was added after initialization (found
	at time of check) and deleted before update, and to fix problem
	where check summary report wouldn't list sets that had only
	additions and deletions but no changes.
5 February 2000: 1.01 Modified to check existence of files before using
	chflags (added set_immutable_flag subroutine), to record user
	when creating a spec or checking a tree.
30 January 2000:  Version 1.0 created from mtree.pl.
