From fc964cbf4e295b98ab5ebb6cbfb00743cdee0489 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 29 Jul 2015 13:36:17 +0000 Subject: [PATCH] ar: enable deterministic mode by default Ar cannot handle UIDs with more than 6 digits, and storing the mtime, uid, gid and mode provides little to negative value anyhow for ar's uses. Turn on deterministic (-D) mode by default; it can be disabled by the user with -U. PR: 196929 Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3190 --- usr.bin/ar/ar.1 | 1 + usr.bin/ar/ar.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1 index 02e99f1a92c9..6998c04e0d9c 100644 --- a/usr.bin/ar/ar.1 +++ b/usr.bin/ar/ar.1 @@ -210,6 +210,7 @@ and 0644 instead of file mode from the members named by arguments .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +This option is enabled by default. If multiple .Fl D and diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c index 3d5e2b87667b..104d55ce85ca 100644 --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -104,6 +104,8 @@ main(int argc, char **argv) bsdar = &bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + /* Enable deterministic mode by default. */ + bsdar->options |= AR_D; if ((bsdar->progname = getprogname()) == NULL) bsdar->progname = "ar";