FreeBSD Bugzilla – Attachment 174064 Details for
Bug 186497
ports-mgmt/pkg: local overrides for pkg audit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to allow sysadmin to list vuxml entries to ignore
patch-pkg_audit.c (text/plain), 1.04 KB, created by
Tim Zingelman
on 2016-08-25 15:19:52 UTC
(
hide
)
Description:
Patch to allow sysadmin to list vuxml entries to ignore
Filename:
MIME Type:
Creator:
Tim Zingelman
Created:
2016-08-25 15:19:52 UTC
Size:
1.04 KB
patch
obsolete
>--- libpkg/pkg_audit.c.orig 2014-10-29 03:48:12.000000000 -0500 >+++ libpkg/pkg_audit.c 2014-12-30 15:37:05.000000000 -0600 >@@ -140,6 +140,8 @@ > bool loaded; > void *map; > size_t len; >+ void *ignore; >+ size_t ignore_len; > }; > > >@@ -802,6 +804,10 @@ > if (fnmatch(e->pkgname, pkg->name, 0) != 0) > continue; > >+ /* ignore by id in /usr/local/etc/portaudit.conf */ >+ if (audit->ignore_len && strnstr(audit->ignore,e->id,audit->ignore_len)) >+ continue; >+ > if (pkg->version == NULL) { > /* > * Assume that all versions should be checked >@@ -872,6 +878,21 @@ > audit->len = st.st_size; > audit->loaded = true; > >+ audit->ignore = 0; >+ audit->ignore_len = 0; >+ if (stat("/usr/local/etc/portaudit.conf", &st) == -1) >+ return (EPKG_OK); >+ if ((fd = open("/usr/local/etc/portaudit.conf", O_RDONLY)) == -1) >+ return (EPKG_OK); >+ if ((mem = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) { >+ close(fd); >+ return (EPKG_OK); >+ } >+ close(fd); >+ >+ audit->ignore = mem; >+ audit->ignore_len = st.st_size; >+ > return (EPKG_OK); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 186497
: 174064