Pullup ticket 3356 - requested by aymeric functionality fix Revisions pulled up: - pkgsrc/pkgtools/pkg_install/files/admin/audit.c 1.17 - pkgsrc/pkgtools/pkg_install/files/lib/version.h 1.161 ----------------------------------------------------------------------------- Module Name: pkgsrc Committed By: aymeric Date: Fri Feb 18 15:59:52 UTC 2011 Modified Files: pkgsrc/pkgtools/pkg_install/files/admin: audit.c pkgsrc/pkgtools/pkg_install/files/lib: version.h Log Message: . fix audit-history subcommand to include patterns making use of [x-y] notation . bump version to 20110215 To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/pkg_install/files/admin/audit.c cvs rdiff -u -r1.160 -r1.161 pkgsrc/pkgtools/pkg_install/files/lib/version.hdiff -r1.16 -r1.16.6.1 pkgsrc/pkgtools/pkg_install/files/admin/audit.c
(spz)
@@ -1,23 +1,23 @@ | @@ -1,23 +1,23 @@ | |||
1 | /* $NetBSD: audit.c,v 1.16 2010/06/16 23:02:48 joerg Exp $ */ | 1 | /* $NetBSD: audit.c,v 1.16.6.1 2011/02/20 21:41:59 spz Exp $ */ | |
2 | 2 | |||
3 | #if HAVE_CONFIG_H | 3 | #if HAVE_CONFIG_H | |
4 | #include "config.h" | 4 | #include "config.h" | |
5 | #endif | 5 | #endif | |
6 | #include <nbcompat.h> | 6 | #include <nbcompat.h> | |
7 | #if HAVE_SYS_CDEFS_H | 7 | #if HAVE_SYS_CDEFS_H | |
8 | #include <sys/cdefs.h> | 8 | #include <sys/cdefs.h> | |
9 | #endif | 9 | #endif | |
10 | __RCSID("$NetBSD: audit.c,v 1.16 2010/06/16 23:02:48 joerg Exp $"); | 10 | __RCSID("$NetBSD: audit.c,v 1.16.6.1 2011/02/20 21:41:59 spz Exp $"); | |
11 | 11 | |||
12 | /*- | 12 | /*- | |
13 | * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. | 13 | * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. | |
14 | * All rights reserved. | 14 | * All rights reserved. | |
15 | * | 15 | * | |
16 | * Redistribution and use in source and binary forms, with or without | 16 | * Redistribution and use in source and binary forms, with or without | |
17 | * modification, are permitted provided that the following conditions | 17 | * modification, are permitted provided that the following conditions | |
18 | * are met: | 18 | * are met: | |
19 | * | 19 | * | |
20 | * 1. Redistributions of source code must retain the above copyright | 20 | * 1. Redistributions of source code must retain the above copyright | |
21 | * notice, this list of conditions and the following disclaimer. | 21 | * notice, this list of conditions and the following disclaimer. | |
22 | * 2. Redistributions in binary form must reproduce the above copyright | 22 | * 2. Redistributions in binary form must reproduce the above copyright | |
23 | * notice, this list of conditions and the following disclaimer in | 23 | * notice, this list of conditions and the following disclaimer in | |
@@ -374,28 +374,35 @@ fetch_pkg_vulnerabilities(int argc, char | @@ -374,28 +374,35 @@ fetch_pkg_vulnerabilities(int argc, char | |||
374 | if (close(fd) == -1) | 374 | if (close(fd) == -1) | |
375 | err(EXIT_FAILURE, "Cannot close pkg-vulnerability file after write"); | 375 | err(EXIT_FAILURE, "Cannot close pkg-vulnerability file after write"); | |
376 | 376 | |||
377 | free(buf); | 377 | free(buf); | |
378 | 378 | |||
379 | exit(EXIT_SUCCESS); | 379 | exit(EXIT_SUCCESS); | |
380 | } | 380 | } | |
381 | 381 | |||
382 | static int | 382 | static int | |
383 | check_pkg_history_pattern(const char *pkg, const char *pattern) | 383 | check_pkg_history_pattern(const char *pkg, const char *pattern) | |
384 | { | 384 | { | |
385 | const char *delim, *end_base; | 385 | const char *delim, *end_base; | |
386 | 386 | |||
387 | if ((delim = strchr(pattern, '*')) != NULL) { | 387 | if (strpbrk(pattern, "*[") != NULL) { | |
388 | if ((end_base = strrchr(pattern, '-')) == NULL) | 388 | end_base = NULL; | |
389 | for (delim = pattern; | |||
390 | *delim != '\0' && *delim != '['; delim++) { | |||
391 | if (*delim == '-') | |||
392 | end_base = delim; | |||
393 | } | |||
394 | ||||
395 | if (end_base == NULL) | |||
389 | errx(EXIT_FAILURE, "Missing - in wildcard pattern %s", | 396 | errx(EXIT_FAILURE, "Missing - in wildcard pattern %s", | |
390 | pattern); | 397 | pattern); | |
391 | if ((delim = strchr(pattern, '>')) != NULL || | 398 | if ((delim = strchr(pattern, '>')) != NULL || | |
392 | (delim = strchr(pattern, '<')) != NULL) | 399 | (delim = strchr(pattern, '<')) != NULL) | |
393 | errx(EXIT_FAILURE, | 400 | errx(EXIT_FAILURE, | |
394 | "Mixed relational and wildcard patterns in %s", | 401 | "Mixed relational and wildcard patterns in %s", | |
395 | pattern); | 402 | pattern); | |
396 | } else if ((delim = strchr(pattern, '>')) != NULL) { | 403 | } else if ((delim = strchr(pattern, '>')) != NULL) { | |
397 | end_base = delim; | 404 | end_base = delim; | |
398 | if ((delim = strchr(pattern, '<')) != NULL && delim < end_base) | 405 | if ((delim = strchr(pattern, '<')) != NULL && delim < end_base) | |
399 | errx(EXIT_FAILURE, "Inverted operators in %s", | 406 | errx(EXIT_FAILURE, "Inverted operators in %s", | |
400 | pattern); | 407 | pattern); | |
401 | } else if ((delim = strchr(pattern, '<')) != NULL) { | 408 | } else if ((delim = strchr(pattern, '<')) != NULL) { |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: version.h,v 1.160 2010/12/12 13:18:38 wiz Exp $ */ | 1 | /* $NetBSD: version.h,v 1.160.2.1 2011/02/20 21:41:59 spz Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Thomas Klausner. All rights reserved. | 4 | * Copyright (c) 2001 Thomas Klausner. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -17,16 +17,16 @@ | @@ -17,16 +17,16 @@ | |||
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
25 | */ | 25 | */ | |
26 | 26 | |||
27 | #ifndef _INST_LIB_VERSION_H_ | 27 | #ifndef _INST_LIB_VERSION_H_ | |
28 | #define _INST_LIB_VERSION_H_ | 28 | #define _INST_LIB_VERSION_H_ | |
29 | 29 | |||
30 | #define PKGTOOLS_VERSION 20101212 | 30 | #define PKGTOOLS_VERSION 20110215 | |
31 | 31 | |||
32 | #endif /* _INST_LIB_VERSION_H_ */ | 32 | #endif /* _INST_LIB_VERSION_H_ */ |