View | Details | Raw Unified | Return to bug 186497
Collapse All | Expand All

(-)libpkg/pkg_audit.c (+21 lines)
Lines 140-145 Link Here
140
	bool loaded;
140
	bool loaded;
141
	void *map;
141
	void *map;
142
	size_t len;
142
	size_t len;
143
	void *ignore;
144
	size_t ignore_len;
143
};
145
};
144
146
145
147
Lines 802-807 Link Here
802
			if (fnmatch(e->pkgname, pkg->name, 0) != 0)
804
			if (fnmatch(e->pkgname, pkg->name, 0) != 0)
803
				continue;
805
				continue;
804
806
807
			/* ignore by id in /usr/local/etc/portaudit.conf */
808
			if (audit->ignore_len && strnstr(audit->ignore,e->id,audit->ignore_len))
809
				continue;
810
805
			if (pkg->version == NULL) {
811
			if (pkg->version == NULL) {
806
				/*
812
				/*
807
				 * Assume that all versions should be checked
813
				 * Assume that all versions should be checked
Lines 872-877 Link Here
872
	audit->len = st.st_size;
878
	audit->len = st.st_size;
873
	audit->loaded = true;
879
	audit->loaded = true;
874
880
881
	audit->ignore = 0;
882
	audit->ignore_len = 0;
883
	if (stat("/usr/local/etc/portaudit.conf", &st) == -1)
884
		return (EPKG_OK);
885
	if ((fd = open("/usr/local/etc/portaudit.conf", O_RDONLY)) == -1)
886
		return (EPKG_OK);
887
	if ((mem = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) == MAP_FAILED) {
888
		close(fd);
889
		return (EPKG_OK);
890
	}
891
	close(fd);
892
893
	audit->ignore = mem;
894
	audit->ignore_len = st.st_size;
895
875
	return (EPKG_OK);
896
	return (EPKG_OK);
876
}
897
}
877
898

Return to bug 186497