CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Fri Mar 1 07:28:20 UTC 2013 Modified Files: othersrc/external/bsd/mat/dist: frontends.c mat.1 matpax.1 Log Message: Allow the user and group for entries in the archive to be specified from the command line with a new -A user=root -A group=wheel style of invocation. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 othersrc/external/bsd/mat/dist/frontends.c cvs rdiff -u -r1.9 -r1.10 othersrc/external/bsd/mat/dist/mat.1 cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/mat/dist/matpax.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/frontends.c diff -u othersrc/external/bsd/mat/dist/frontends.c:1.7 othersrc/external/bsd/mat/dist/frontends.c:1.8 --- othersrc/external/bsd/mat/dist/frontends.c:1.7 Mon Nov 26 16:00:54 2012 +++ othersrc/external/bsd/mat/dist/frontends.c Fri Mar 1 07:28:20 2013 @@ -157,6 +157,7 @@ mat_tar(int argc, char **argv) char cwd[MAT_PATH_MAX]; char *metalog; char *dir; + char *eq; char *f; int deltemp; int fd; @@ -178,8 +179,17 @@ mat_tar(int argc, char **argv) argv[1] = newarg; } getopt2_init(options); - while ((i = getopt2(options, argc, argv, C:T:Vacf:ps:tvx)) != -1) { + while ((i = getopt2(options, argc, argv, A:C:T:Vacf:ps:tvx)) != -1) { switch(i) { + case 'A': + if ((eq = strchr(options.optarg, '=')) != NULL) { +if (strncmp(options.optarg, user, 4) == 0) { + snprintf(mat.user, sizeof(mat.user), %s, eq + 1); +} else if (strncmp(options.optarg, group, 5) == 0) { + snprintf(mat.group, sizeof(mat.group), %s, eq + 1); +} + } + break; case 'C': dir = options.optarg; break; @@ -328,6 +338,7 @@ mat_pax(int argc, char **argv) char *metalog; char *archive; char *dir; + char *eq; int deltemp; int fd; int ok; @@ -345,8 +356,17 @@ mat_pax(int argc, char **argv) action = list; deltemp = 0; getopt2_init(options); - while ((i = getopt2(options, argc, argv, C:Vaf:lrs:wv)) != -1) { + while ((i = getopt2(options, argc, argv, A:C:Vaf:lrs:wv)) != -1) { switch(i) { + case 'A': + if ((eq = strchr(options.optarg, '=')) != NULL) { +if (strncmp(options.optarg, user, 4) == 0) { + snprintf(mat.user, sizeof(mat.user), %s, eq + 1); +} else if (strncmp(options.optarg, group, 5) == 0) { + snprintf(mat.group, sizeof(mat.group), %s, eq + 1); +} + } + break; case 'C': dir = options.optarg; break; Index: othersrc/external/bsd/mat/dist/mat.1 diff -u othersrc/external/bsd/mat/dist/mat.1:1.9 othersrc/external/bsd/mat/dist/mat.1:1.10 --- othersrc/external/bsd/mat/dist/mat.1:1.9 Sat Jun 25 17:19:55 2011 +++ othersrc/external/bsd/mat/dist/mat.1 Fri Mar 1 07:28:20 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: mat.1,v 1.9 2011/06/25 17:19:55 wiz Exp $ +.\ $NetBSD: mat.1,v 1.10 2013/03/01 07:28:20 agc Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -23,7 +23,7 @@ .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\ -.Dd June 25, 2011 +.Dd February 28, 2013 .Dt MATTAR 1 .Os .Sh NAME @@ -32,6 +32,7 @@ .Sh SYNOPSIS .Nm .Op Fl acptVvx +.Op Fl A Ar key=value .Op Fl C Ar directory .Op Fl f Ar archive .Op Fl s Ar substitution @@ -67,6 +68,13 @@ option using programs such as .Xr diff 1 to see if anything has been modified since the archive contents were extracted. +.It Fl A Ar key=value +allows key values of +.Dq user +and +.Dq group +to be set on the archive entries +from the command line. .It Fl C Ar directory perform an initial .Xr chdir 2 Index: othersrc/external/bsd/mat/dist/matpax.1 diff -u othersrc/external/bsd/mat/dist/matpax.1:1.6 othersrc/external/bsd/mat/dist/matpax.1:1.7 --- othersrc/external/bsd/mat/dist/matpax.1:1.6 Sat Jun 25 17:19:55 2011 +++ othersrc/external/bsd/mat/dist/matpax.1 Fri Mar 1 07:28:20 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: matpax.1,v 1.6 2011/06/25 17:19:55 wiz Exp $ +.\ $NetBSD: matpax.1,v 1.7 2013/03/01 07:28:20 agc Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -23,7 +23,7 @@ .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\ -.Dd June 25, 2011 +.Dd February 28, 2013 .Dt MATPAX 1 .Os .Sh NAME @@ -32,6 +32,7 @@ .Sh SYNOPSIS .Nm .Op Fl alrVvw +.Op Fl A Ar key=value .Op Fl C Ar directory .Op Fl f Ar archive .Op Fl s Ar substitution @@ -65,6 +66,13 @@ so that tools such as .Xr diff 1 can be used to compare packages and installed file system entries to see if anything has been changed. +.It Fl A Ar key=value +allows key values of +.Dq user +and +.Dq group +to be set on the archive entries +from the command line. .It Fl C Ar directory perform an initial .Xr chdir 2
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Mon Nov 26 16:00:54 UTC 2012 Modified Files: othersrc/external/bsd/mat/dist: frontends.c mat.c mat.h Log Message: + unmap the mmap'ed memory in the all cases. + be consistent with the type of integer when printing + add an error count field to the main structure + check error count in the frontends ride previous shlib major bump with thanks to marc balmer for keeping me honest To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/mat/dist/frontends.c \ othersrc/external/bsd/mat/dist/mat.h cvs rdiff -u -r1.7 -r1.8 othersrc/external/bsd/mat/dist/mat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/frontends.c diff -u othersrc/external/bsd/mat/dist/frontends.c:1.6 othersrc/external/bsd/mat/dist/frontends.c:1.7 --- othersrc/external/bsd/mat/dist/frontends.c:1.6 Mon Nov 26 05:49:05 2012 +++ othersrc/external/bsd/mat/dist/frontends.c Mon Nov 26 16:00:54 2012 @@ -287,7 +287,7 @@ mat_tar(int argc, char **argv) if (dir != NULL chdir(cwd) 0) { (void) fprintf(stderr, can't chdir back to '%s'\n, cwd); } - return ok; + return ok mat.errorc == 0; } #ifndef MAT_ARGC_MAX @@ -439,7 +439,7 @@ mat_pax(int argc, char **argv) if (dir != NULL chdir(cwd) 0) { (void) fprintf(stderr, can't chdir back to '%s'\n, cwd); } - return ok; + return ok mat.errorc == 0; } /* varargs version of pax */ Index: othersrc/external/bsd/mat/dist/mat.h diff -u othersrc/external/bsd/mat/dist/mat.h:1.6 othersrc/external/bsd/mat/dist/mat.h:1.7 --- othersrc/external/bsd/mat/dist/mat.h:1.6 Sun Nov 25 20:20:36 2012 +++ othersrc/external/bsd/mat/dist/mat.h Mon Nov 26 16:00:54 2012 @@ -108,6 +108,7 @@ typedef struct mat_t { char from[MAT_PATH_MAX]; /* path to change from */ char to[MAT_PATH_MAX]; /* path to change to */ void *re; /* pointer to compiled regexp */ + unsigned errorc; /* # of errors */ } mat_t; int mat_init(mat_t */*mat*/, const char */*f*/, const char */*mode*/); Index: othersrc/external/bsd/mat/dist/mat.c diff -u othersrc/external/bsd/mat/dist/mat.c:1.7 othersrc/external/bsd/mat/dist/mat.c:1.8 --- othersrc/external/bsd/mat/dist/mat.c:1.7 Mon Nov 26 05:49:05 2012 +++ othersrc/external/bsd/mat/dist/mat.c Mon Nov 26 16:00:54 2012 @@ -185,23 +185,28 @@ static int memwrite(FILE *fp, uint64_t off, const void *p, size_t size) { char *mapped; + int ok; + ok = 1; mapped = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fileno(fp), (off_t)off); if (mapped == MAP_FAILED) { if (write(fileno(fp), p, size) != (ssize_t)size) { - fprintf(stderr, short write %zu chars\n, size); - return 0; + ok = 0; } } else { - lseek(fileno(fp), (off_t)(off + size - 1), SEEK_SET); - if (write(fileno(fp), , 1) != 1) { - fprintf(stderr, short write % PRIu64 chars\n, size); - return 0; + if (lseek(fileno(fp), (off_t)(off + size - 1), SEEK_SET) 0) { + ok = 0; + } else if (write(fileno(fp), , 1) != 1) { + ok = 0; + } else { + memcpy(mapped, p, size); } - memcpy(mapped, p, size); munmap(mapped, size); } - return 1; + if (!ok) { + fprintf(stderr, memwrite: short write %zu chars\n, size); + } + return ok; } /* write to mat archive */ @@ -212,6 +217,7 @@ archive_write(mat_t *mat, const void *p, mat-off += size; return 1; } + mat-errorc += 1; return 0; }
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Mon Nov 26 05:49:06 UTC 2012 Modified Files: othersrc/external/bsd/mat/dist: frontends.c mat.c Log Message: act on feedback from fuzz tests: check arguments to exported functions on entry to those functions To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/mat/dist/frontends.c cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/mat/dist/mat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/frontends.c diff -u othersrc/external/bsd/mat/dist/frontends.c:1.5 othersrc/external/bsd/mat/dist/frontends.c:1.6 --- othersrc/external/bsd/mat/dist/frontends.c:1.5 Wed Aug 3 01:09:58 2011 +++ othersrc/external/bsd/mat/dist/frontends.c Mon Nov 26 05:49:05 2012 @@ -163,6 +163,10 @@ mat_tar(int argc, char **argv) int ok; int i; + if (argc 0 || argv == NULL || argv[0] == NULL || argv[1] == NULL) { + fprintf(stderr, mat_tar: bad args\n); + return 0; + } (void) memset(mat, 0x0, sizeof(mat)); action = NULL; f = NULL; @@ -299,6 +303,10 @@ mat_vtar(char *arg, ...) char *s; int argc; + if (arg == NULL) { + fprintf(stderr, mat_vtar: bad args\n); + return 0; + } argv[0] = arg; va_start(args, arg); for (argc = 1 ; (s = va_arg(args, char *)) != NULL argc MAT_ARGC_MAX ; argc++) { @@ -325,6 +333,10 @@ mat_pax(int argc, char **argv) int ok; int i; + if (argv == NULL) { + fprintf(stderr, mat_pax: bad args\n); + return 0; + } (void) memset(mat, 0x0, sizeof(mat)); dir = NULL; metalog = NULL; @@ -439,6 +451,10 @@ mat_vpax(char *arg, ...) char *s; int argc; + if (arg == NULL) { + fprintf(stderr, mat_vpax: bad args\n); + return 0; + } argv[0] = arg; va_start(args, arg); for (argc = 1 ; (s = va_arg(args, char *)) != NULL argc MAT_ARGC_MAX ; argc++) { Index: othersrc/external/bsd/mat/dist/mat.c diff -u othersrc/external/bsd/mat/dist/mat.c:1.6 othersrc/external/bsd/mat/dist/mat.c:1.7 --- othersrc/external/bsd/mat/dist/mat.c:1.6 Sun Nov 25 20:20:36 2012 +++ othersrc/external/bsd/mat/dist/mat.c Mon Nov 26 05:49:05 2012 @@ -610,6 +610,10 @@ mat_add(mat_t *mat, const char *f) int original; int primary; + if (mat == NULL || f == NULL) { + (void) fprintf(stderr, mat_add: bad args\n); + return 0; + } (void) memset(ent, 0x0, sizeof(ent)); if (*f == '/') { (void) snprintf(dotpath, sizeof(dotpath), .%s, f); @@ -747,6 +751,10 @@ mat_list(mat_t *mat, const char *pat, FI int list; int cc; + if (mat == NULL || fp == NULL) { + (void) fprintf(stderr, mat_list: bad args\n); + return 0; + } if (!mat_verify(mat)) { return 0; } @@ -931,6 +939,10 @@ mat_extract(mat_t *mat, const char *pat) matent_t ent; char *name; + if (mat == NULL) { + (void) fprintf(stderr, mat_extract: bad args\n); + return 0; + } if (!mat_verify(mat)) { return 0; } @@ -991,6 +1003,10 @@ mat_init(mat_t *mat, const char *f, cons struct stat st; matheader_t header; + if (mat == NULL || mode == NULL) { + (void) fprintf(stderr, mat_init: bad args\n); + return 0; + } mat-recursing = 1; /* default behavior */ if (strcmp(mat-action = mode, create) == 0) { if (f == NULL || strcmp(f, -) == 0) { @@ -1026,6 +1042,10 @@ mat_init(mat_t *mat, const char *f, cons int mat_end(mat_t *mat) { + if (mat == NULL) { + (void) fprintf(stderr, mat_init: bad args\n); + return 0; + } if (mat-mapped) { munmap(mat-mapped, mat-size); } @@ -1054,6 +1074,10 @@ mat_audit(mat_t *mat, const char *pat, F int cc; int ok; + if (mat == NULL) { + (void) fprintf(stderr, mat_init: bad args\n); + return 0; + } if (!mat_verify(mat)) { return 0; }
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Sun Aug 12 01:42:24 UTC 2012 Modified Files: othersrc/external/bsd/mat/dist: mat.c Log Message: if the mmap(2) fails, read the file with multiple read(2)s if it succeeds, use the memory array instead. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/mat/dist/mat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/mat.c diff -u othersrc/external/bsd/mat/dist/mat.c:1.4 othersrc/external/bsd/mat/dist/mat.c:1.5 --- othersrc/external/bsd/mat/dist/mat.c:1.4 Thu Oct 13 17:20:47 2011 +++ othersrc/external/bsd/mat/dist/mat.c Sun Aug 12 01:42:24 2012 @@ -256,11 +256,11 @@ digest_file(uint8_t *dig, const char *f) size = (size_t)st.st_size; mapped = mmap(NULL, size, PROT_READ, MAP_FILE, fileno(fp), 0); if (mapped == MAP_FAILED) { - SHA256_Update(sha256, mapped, size); - } else { while ((cc = read(fileno(fp), buf, sizeof(buf))) 0) { SHA256_Update(sha256, (const uint8_t *)buf, (size_t)cc); } + } else { + SHA256_Update(sha256, mapped, size); } SHA256_Final(dig, sha256); if (mapped != MAP_FAILED) {
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Thu Oct 13 17:20:47 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: mat.c mat.h Log Message: provide namespace protection for header file fix an error message To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/mat/dist/mat.c cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/mat/dist/mat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/mat.c diff -u othersrc/external/bsd/mat/dist/mat.c:1.3 othersrc/external/bsd/mat/dist/mat.c:1.4 --- othersrc/external/bsd/mat/dist/mat.c:1.3 Sat Jun 25 17:05:34 2011 +++ othersrc/external/bsd/mat/dist/mat.c Thu Oct 13 17:20:47 2011 @@ -523,7 +523,7 @@ extract_special(mat_t *mat, extract_t *a return 0; } if (mknod(name, ent-meta.mode 0, ent-meta.dev) 0) { - (void) fprintf(stderr, can't mkdir '%s'\n, name); + (void) fprintf(stderr, can't mknod '%s'\n, name); return 0; } if (archive-preserve !fpreserve(-1, NULL, name, ent)) { Index: othersrc/external/bsd/mat/dist/mat.h diff -u othersrc/external/bsd/mat/dist/mat.h:1.4 othersrc/external/bsd/mat/dist/mat.h:1.5 --- othersrc/external/bsd/mat/dist/mat.h:1.4 Sat Jun 25 17:05:34 2011 +++ othersrc/external/bsd/mat/dist/mat.h Thu Oct 13 17:20:47 2011 @@ -30,6 +30,18 @@ #include inttypes.h #include stdio.h +#ifndef __BEGIN_DECLS +# if defined(__cplusplus) +# define __BEGIN_DECLS extern C { +# define __END_DECLS } +# else +# define __BEGIN_DECLS +# define __END_DECLS +# endif +#endif + +__BEGIN_DECLS + enum { MAT_MAGIC = 0x19980626, MAT_NAME_LEN = 32, @@ -52,6 +64,9 @@ typedef struct matmeta_t { uint32_t namelen; /* size of name */ uint32_t linklen; /* size of link target */ uint32_t flags; /* fs flags */ +#if 0 + uint32_t xasize; /* extattr size */ +#endif char type; /* single char type */ } matmeta_t; @@ -60,6 +75,9 @@ typedef struct matent_t { matmeta_t meta; /* meta data */ char *name; /* name of entry */ uint8_t *data; /* associated data */ +#if 0 + uint8_t *extattrs; /* extended attributes */ +#endif uint8_t digest[MAT_DIGEST_LEN]; /* sha256 */ } matent_t; @@ -68,7 +86,7 @@ typedef struct matlink_t { uint64_t ino; /* inode number */ char *name; /* name of primary */ uint32_t namelen; /* length of name */ - uint8_t digest[MAT_DIGEST_LEN]; /* sha256 */ + uint8_t digest[MAT_DIGEST_LEN]; /* digest of contents */ } matlink_t; /* the header for the archive file */ @@ -110,4 +128,6 @@ int mat_vtar(char */*arg*/, ...); int mat_pax(int /*argc*/, char **/*argv*/); int mat_vpax(char */*arg*/, ...); +__END_DECLS + #endif
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: agc Date: Wed Aug 3 01:09:59 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: frontends.c Log Message: check for 'f' argument being given without a corresponding file To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/mat/dist/frontends.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/frontends.c diff -u othersrc/external/bsd/mat/dist/frontends.c:1.4 othersrc/external/bsd/mat/dist/frontends.c:1.5 --- othersrc/external/bsd/mat/dist/frontends.c:1.4 Fri Jul 15 05:33:42 2011 +++ othersrc/external/bsd/mat/dist/frontends.c Wed Aug 3 01:09:58 2011 @@ -219,6 +219,10 @@ (void) fprintf(stderr, No action specified\n); return 0; } + if (f == NULL) { + (void) fprintf(stderr, No file specified\n); + return 0; + } if (reading(action) strcmp(f, -) == 0) { /* read archive from stdin */ if ((fd = dostdin(TMPDIR, f = temp, sizeof(temp))) 0) { @@ -365,6 +369,10 @@ (void) fprintf(stderr, Unknown flag \%c\\n, i); } } + if (archive == NULL) { + (void) fprintf(stderr, No file specified\n); + return 0; + } if (reading(action) strcmp(archive, -) == 0) { /* read archive from stdin */ if ((fd = dostdin(TMPDIR, archive = temp, sizeof(temp))) 0) {
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: wiz Date: Sat Jun 25 17:19:56 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: mat.1 matpax.1 Log Message: Spelling. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 othersrc/external/bsd/mat/dist/mat.1 cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/mat/dist/matpax.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/mat.1 diff -u othersrc/external/bsd/mat/dist/mat.1:1.8 othersrc/external/bsd/mat/dist/mat.1:1.9 --- othersrc/external/bsd/mat/dist/mat.1:1.8 Sat Jun 25 17:05:34 2011 +++ othersrc/external/bsd/mat/dist/mat.1 Sat Jun 25 17:19:55 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mat.1,v 1.8 2011/06/25 17:05:34 agc Exp $ +.\ $NetBSD: mat.1,v 1.9 2011/06/25 17:19:55 wiz Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -91,14 +91,14 @@ Setuid and setgid bits are only preserved if the program is run with an effective uid of 0. -.It Fl s Ar substition +.It Fl s Ar substitution The pathnames on entry or exit to the archive, depending on whether the archive is being created or used to extract components, are modified using an .Dv old and .Dv new -subsitution pattern, in a similar manner to +substitution pattern, in a similar manner to .Xr sed 1 The first non-whitespace character of the pattern is taken to be the delimiter for the patterns, which itself can be escaped using the backslash character. Index: othersrc/external/bsd/mat/dist/matpax.1 diff -u othersrc/external/bsd/mat/dist/matpax.1:1.5 othersrc/external/bsd/mat/dist/matpax.1:1.6 --- othersrc/external/bsd/mat/dist/matpax.1:1.5 Sat Jun 25 17:05:34 2011 +++ othersrc/external/bsd/mat/dist/matpax.1 Sat Jun 25 17:19:55 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: matpax.1,v 1.5 2011/06/25 17:05:34 agc Exp $ +.\ $NetBSD: matpax.1,v 1.6 2011/06/25 17:19:55 wiz Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -34,7 +34,7 @@ .Op Fl alrVvw .Op Fl C Ar directory .Op Fl f Ar archive -.Op Fl s Ar substition +.Op Fl s Ar substitution .Op Ar file ... .Sh DESCRIPTION The @@ -84,14 +84,14 @@ list the archive .It Fl r extract the named components from the archive. -.It Fl s Ar substition +.It Fl s Ar substitution The pathnames on entry or exit to the archive, depending on whether the archive is being created or used to extract components, are modified using an .Dv old and .Dv new -subsitution pattern, in a similar manner to +substitution pattern, in a similar manner to .Xr sed 1 The first non-whitespace character of the pattern is taken to be the delimiter for the patterns, which itself can be escaped using the backslash character.
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: wiz Date: Tue Jun 21 09:38:15 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: mat.1 Log Message: Fix typo in option letter. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/mat/dist/mat.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/mat.1 diff -u othersrc/external/bsd/mat/dist/mat.1:1.5 othersrc/external/bsd/mat/dist/mat.1:1.6 --- othersrc/external/bsd/mat/dist/mat.1:1.5 Tue Jun 21 04:21:24 2011 +++ othersrc/external/bsd/mat/dist/mat.1 Tue Jun 21 09:38:15 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mat.1,v 1.5 2011/06/21 04:21:24 agc Exp $ +.\ $NetBSD: mat.1,v 1.6 2011/06/21 09:38:15 wiz Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -56,7 +56,7 @@ perform an initial .Xr chdir 2 into the specified directory before attempting to resolve any filenames. -.It Fl c +.It Fl a audit the contents of the archive against the installed versions of the file system. The output is the same as would be output using the .Fl t
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: wiz Date: Mon Jun 20 15:09:18 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: mat.1 Log Message: Reinstate my changes which got lost in mattar conversion. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/mat/dist/mat.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/mat.1 diff -u othersrc/external/bsd/mat/dist/mat.1:1.3 othersrc/external/bsd/mat/dist/mat.1:1.4 --- othersrc/external/bsd/mat/dist/mat.1:1.3 Mon Jun 20 14:58:53 2011 +++ othersrc/external/bsd/mat/dist/mat.1 Mon Jun 20 15:09:18 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mat.1,v 1.3 2011/06/20 14:58:53 agc Exp $ +.\ $NetBSD: mat.1,v 1.4 2011/06/20 15:09:18 wiz Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -31,10 +31,10 @@ .Nd minimalist archive tool program .Sh SYNOPSIS .Nm -.Op Fl Vcptvx +.Op Fl cptVvx .Op Fl C Ar directory -.Op Fl T Ar template .Op Fl f Ar archive +.Op Fl T Ar template .Op Ar file ... .Sh DESCRIPTION The @@ -56,15 +56,8 @@ perform an initial .Xr chdir 2 into the specified directory before attempting to resolve any filenames. -.It Fl T Ar template -takes the names of the entries to be included in the archive -from the template file provided. -This template file is expected to be in the -.Dv METALOG -format, as generated during the -.Nx -.Dv build.sh -phase. +.It Fl c +create the archive .It Fl f Ar archive Use the .Xr libmat 3 @@ -76,12 +69,6 @@ or will be read from .Dv stdin depending on the action specified. -.It Fl V -verify the archive does not contain dangerous -entries which could compromise a machine if the archive -is extracted or listed. -.It Fl c -create the archive .It Fl p when extracting the components of the archive, preserve the file owner and group information, @@ -89,17 +76,32 @@ Setuid and setgid bits are only preserved if the program is run with an effective uid of 0. +.It Fl T Ar template +takes the names of the entries to be included in the archive +from the template file provided. +This template file is expected to be in the +.Dv METALOG +format, as generated during the +.Nx +.Dv build.sh +phase. .It Fl t list the contents of the archive on stdout. +.It Fl V +verify the archive does not contain dangerous +entries which could compromise a machine if the archive +is extracted or listed. .It Fl v perform operations in a verbose manner. -This option can be repeated to provide higher +This option can be repeated to provide higher levels of verbosity. For instance, when listing entries, a verbosity level of 2 will also show the .Xr SHA256 3 digests associated with the archive component. +.It Fl x +extract the contents of the archive. .El .Pp .Nm @@ -111,7 +113,7 @@ but without some of the constraints and limits inherent in those archivers. In addition, -digests are used to make sure that the +digests are used to make sure that the contents of the archive remain the same as when the archive was made. To protect against malicious archives, a sanity check,
CVS commit: othersrc/external/bsd/mat/dist
Module Name:othersrc Committed By: wiz Date: Mon Jun 20 15:15:25 UTC 2011 Modified Files: othersrc/external/bsd/mat/dist: matpax.1 Log Message: Same fixes as for mattar, since the contents are nearly the same. XXX: should describe differences in options (I guess) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/mat/dist/matpax.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/mat/dist/matpax.1 diff -u othersrc/external/bsd/mat/dist/matpax.1:1.1 othersrc/external/bsd/mat/dist/matpax.1:1.2 --- othersrc/external/bsd/mat/dist/matpax.1:1.1 Mon Jun 20 14:58:53 2011 +++ othersrc/external/bsd/mat/dist/matpax.1 Mon Jun 20 15:15:25 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: matpax.1,v 1.1 2011/06/20 14:58:53 agc Exp $ +.\ $NetBSD: matpax.1,v 1.2 2011/06/20 15:15:25 wiz Exp $ .\ .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org .\ All rights reserved. @@ -31,10 +31,10 @@ .Nd minimalist archive tool program with pax frontend .Sh SYNOPSIS .Nm -.Op Fl Vcptvx +.Op Fl cptVvx .Op Fl C Ar directory -.Op Fl T Ar template .Op Fl f Ar archive +.Op Fl T Ar template .Op Ar file ... .Sh DESCRIPTION The @@ -56,15 +56,8 @@ perform an initial .Xr chdir 2 into the specified directory before attempting to resolve any filenames. -.It Fl T Ar template -takes the names of the entries to be included in the archive -from the template file provided. -This template file is expected to be in the -.Dv METALOG -format, as generated during the -.Nx -.Dv build.sh -phase. +.It Fl c +create the archive .It Fl f Ar archive Use the .Xr libmat 3 @@ -76,12 +69,6 @@ or will be read from .Dv stdin depending on the action specified. -.It Fl V -verify the archive does not contain dangerous -entries which could compromise a machine if the archive -is extracted or listed. -.It Fl c -create the archive .It Fl p when extracting the components of the archive, preserve the file owner and group information, @@ -89,17 +76,32 @@ Setuid and setgid bits are only preserved if the program is run with an effective uid of 0. +.It Fl T Ar template +takes the names of the entries to be included in the archive +from the template file provided. +This template file is expected to be in the +.Dv METALOG +format, as generated during the +.Nx +.Dv build.sh +phase. .It Fl t list the contents of the archive on stdout. +.It Fl V +verify the archive does not contain dangerous +entries which could compromise a machine if the archive +is extracted or listed. .It Fl v perform operations in a verbose manner. -This option can be repeated to provide higher +This option can be repeated to provide higher levels of verbosity. For instance, when listing entries, a verbosity level of 2 will also show the .Xr SHA256 3 digests associated with the archive component. +.It Fl x +extract the contents of the archive. .El .Pp .Nm @@ -111,7 +113,7 @@ but without some of the constraints and limits inherent in those archivers. In addition, -digests are used to make sure that the +digests are used to make sure that the contents of the archive remain the same as when the archive was made. To protect against malicious archives, a sanity check,