projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 2.1.4.
[u/mdw/catacomb]
/
dsig.c
diff --git
a/dsig.c
b/dsig.c
index
4847ac8
..
a7fa5a9
100644
(file)
--- a/
dsig.c
+++ b/
dsig.c
@@
-733,6
+733,13
@@
static int sign(int argc, char *argv[])
/*----- Signature verification --------------------------------------------*/
/*----- Signature verification --------------------------------------------*/
+static int checkjunk(const char *path, const struct stat *st, void *p)
+{
+ if (!st) printf("JUNK (error %s) %s\n", strerror(errno), path);
+ else printf("JUNK %s %s\n", describefile(st), path);
+ return (0);
+}
+
static int verify(int argc, char *argv[])
{
#define f_bogus 1u
static int verify(int argc, char *argv[])
{
#define f_bogus 1u
@@
-760,9
+767,10
@@
static int verify(int argc, char *argv[])
{ "progress", 0, 0, 'p' },
{ "quiet", 0, 0, 'q' },
{ "nocheck", 0, 0, 'C' },
{ "progress", 0, 0, 'p' },
{ "quiet", 0, 0, 'q' },
{ "nocheck", 0, 0, 'C' },
+ { "junk", 0, 0, 'j' },
{ 0, 0, 0, 0 }
};
{ 0, 0, 0, 0 }
};
- int i = mdwopt(argc, argv, "+vpqC", opts, 0, 0, 0);
+ int i = mdwopt(argc, argv, "+vpqC
j
", opts, 0, 0, 0);
if (i < 0)
break;
switch (i) {
if (i < 0)
break;
switch (i) {
@@
-779,6
+787,9
@@
static int verify(int argc, char *argv[])
case 'C':
f |= f_nocheck;
break;
case 'C':
f |= f_nocheck;
break;
+ case 'j':
+ f |= FHF_JUNK;
+ break;
default:
f |= f_bogus;
break;
default:
f |= f_bogus;
break;
@@
-931,6
+942,8
@@
static int verify(int argc, char *argv[])
}
}
done:
}
}
done:
+ if ((f & FHF_JUNK) && fhash_junk(&fh, checkjunk, 0))
+ f |= f_bogus;
fhash_free(&fh);
bdestroy(&b);
dstr_destroy(&d);
fhash_free(&fh);
bdestroy(&b);
dstr_destroy(&d);