Add the -S flag, for setting the signatures file immutable after creating

it.
This commit is contained in:
elad 2006-09-18 17:47:25 +00:00
parent 6a8419e3ee
commit f8c54c15cf
2 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: veriexecgen.8,v 1.6 2006/09/17 10:27:54 wiz Exp $
.\" $NetBSD: veriexecgen.8,v 1.7 2006/09/18 17:47:25 elad Exp $
.\"
.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,14 +34,14 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd September 17, 2006
.Dd September 18, 2006
.Dt VERIEXECGEN 8
.Sh NAME
.Nm veriexecgen
.Nd generate fingerprints for Veriexec
.Sh SYNOPSIS
.Nm
.Op Fl AaDrv
.Op Fl AaDrSv
.Op Fl d Pa dir
.Op Fl o Pa fingerprintdb
.Op Fl t Ar algorithm
@ -89,6 +89,8 @@ Save the generated fingerprint database to
.Ar fingerprintdb .
.It Fl r
Scan recursively.
.It Fl S
Set the immutable flag on the created signatures file when done writing it.
.It Fl t Ar algorithm
Use
.Ar algorithm

View File

@ -1,4 +1,4 @@
/* $NetBSD: veriexecgen.c,v 1.2 2006/09/16 21:26:02 elad Exp $ */
/* $NetBSD: veriexecgen.c,v 1.3 2006/09/18 17:47:25 elad Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -86,13 +86,13 @@ struct hash {
{ NULL, NULL },
};
int Aflag, aflag, Dflag, Fflag, rflag, vflag;
int Aflag, aflag, Dflag, Fflag, rflag, Sflag, vflag;
static void
usage(void)
{
(void)fprintf(stderr,
"usage: %s [-Aarv] [-D] [-d dir] [-o fingerprintdb]"
"usage: %s [-AaDrSv] [-d dir] [-o fingerprintdb]"
" [-t algorithm]\n", getprogname());
}
@ -297,9 +297,9 @@ main(int argc, char **argv)
char **search_path = NULL;
struct hash *hash = NULL;
Aflag = aflag = Dflag = Fflag = rflag = vflag = 0;
Aflag = aflag = Dflag = Fflag = rflag = Sflag = vflag = 0;
while ((ch = getopt(argc, argv, "AaDd:ho:rt:v")) != -1) {
while ((ch = getopt(argc, argv, "AaDd:ho:rSt:v")) != -1) {
switch (ch) {
case 'A':
Aflag = 1;
@ -330,6 +330,9 @@ main(int argc, char **argv)
case 'r':
rflag = 1;
break;
case 'S':
Sflag = 1;
break;
case 't':
hash = find_hash(optarg);
break;
@ -371,5 +374,8 @@ main(int argc, char **argv)
store_entries(dbfile, hash);
if (chflags(dbfile, SF_IMMUTABLE) != 0)
err(1, "Can't set immutable flag");
return 0;
}