summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ar/ar.19
-rw-r--r--usr.bin/ar/ar.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1
index 6998c04..9d9a860 100644
--- a/usr.bin/ar/ar.1
+++ b/usr.bin/ar/ar.1
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 24, 2015
+.Dd June 16, 2016
.Dt AR 1
.Os
.Sh NAME
@@ -205,7 +205,12 @@ When used in combination with the
.Fl r
or
.Fl q
-option, insert 0's instead of the real mtime, uid and gid values
+option,
+with the
+.Fl s
+option without other options, or when invoked as
+.Nm ranlib ,
+insert 0's instead of the real mtime, uid and gid values
and 0644 instead of file mode from the members named by arguments
.Ar .
This ensures that checksums on the resulting archives are reproducible
diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c
index b93c968..c1050aa 100644
--- a/usr.bin/ar/ar.c
+++ b/usr.bin/ar/ar.c
@@ -283,7 +283,8 @@ main(int argc, char **argv)
}
/* Set determinstic mode for -D, and by default without -U. */
- if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r')))
+ if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r' ||
+ (bsdar->mode == '\0' && bsdar->options & AR_S))))
bsdar->options |= AR_D;
if (bsdar->options & AR_A)
OpenPOWER on IntegriCloud