summaryrefslogtreecommitdiff
path: root/dev-util/rats
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-util/rats
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-util/rats')
-rw-r--r--dev-util/rats/Manifest9
-rw-r--r--dev-util/rats/files/rats-2.1-add-getopt-trailing-null.patch11
-rw-r--r--dev-util/rats/files/rats-2.1-fix-null-pointers.patch128
-rw-r--r--dev-util/rats/metadata.xml13
-rw-r--r--dev-util/rats/rats-2.1-r2.ebuild36
-rw-r--r--dev-util/rats/rats-2.4.ebuild37
6 files changed, 234 insertions, 0 deletions
diff --git a/dev-util/rats/Manifest b/dev-util/rats/Manifest
new file mode 100644
index 000000000000..40da0a85b020
--- /dev/null
+++ b/dev-util/rats/Manifest
@@ -0,0 +1,9 @@
+AUX rats-2.1-add-getopt-trailing-null.patch 367 SHA256 53ea4b679683af99ddfe1eb997038786caee9e69a3bcbb0f4bc9815a2eb3327d SHA512 50a246a36b7d26d228d5350bbde260792ff7cfcf168038efe284d6c138d25b112f209778fbeb0b118af7c96debadddc59719d73fc373a7e5ce8d1ce3ebec6b36 WHIRLPOOL 2bb5dff198c80641b2a67d549902a961a397a45eaabf8c24934724ffafa1150117388ccb4de9f426523684bd06318a80f6fce0b936317220ed7149e14dac5044
+AUX rats-2.1-fix-null-pointers.patch 3600 SHA256 30753ace2b091bfe802350693279842774d59eb80ccc17a50182b102e01d5a76 SHA512 a1b332a5a436cb4e3b27b8c97f1da582c93ca783b89fc0b0523825fa9046af1916bcfa95704cc3aca3588130139eb61b8c4fd40fba3536997370065387e2e3cf WHIRLPOOL 6d25aa69d9a09361800890d5c0d271a5d8bb587c38bf4be08147dd44fdd292bbe9ba5af0908ccc840b304eb31016576ebedd0d2ac0c8866dd364ba504a501ec5
+DIST rats-2.1.tar.gz 326930 SHA256 ec9fac2765b655c03cede8c5920de3226581f1e626be314bce95f4d0ac9aadd9 SHA512 2fdb670dc9559c453a6c69ee2d411e2626c0ee4cca4b59ceda878142008e136dfd11f8265c0719383212b38b0358a9cab1a29f1cc92a986fc800dd0c46bdf0d3 WHIRLPOOL 376a79cf05aad274296a7a17944ad4f4523e82c0db4c09f201dbcdc306ba803a8e8824cadc2526a05cb448c91ea35020dcd0b3ef56fc71976216b38b50758822
+DIST rats-2.4.tgz 393114 SHA256 2163ad111070542d941c23b98d3da231f13cf065f50f2e4ca40673996570776a SHA512 f402717fc935a2f9c2464e1623807575044258fd998cabc8f115c063141004b5978bad739021f109cbbd1abd84231155eb59671ae202aefb40e1fd6733d8ac6d WHIRLPOOL 78d0f0e1f18db8a4cabc77e50576c8f3040ecba2200b522b9bea0cad3518dba12cec66c539a46eed38fed50963694a68213a3e7874645d751621eb3261cafafb
+EBUILD rats-2.1-r2.ebuild 1017 SHA256 ef9788bcd1b8a8235b1006ba3ce90a90b257eff748e3e871d2b0552caaf5bd95 SHA512 322954d36971597725bd6c5facb436c06ccafd93df788a93ebec2b0ec92900960bf8acfeb22c180c546def22cdea0528831032079d4fa23e3e538617763b1bb6 WHIRLPOOL 8d2f2f1eeacb85a834daf5440a74d84d1637a8e1b95c26f56ee279225c40e9800b8f908687f9380beb2f510794e6e5b7acba68d842d806ad148bcc1eb8564faf
+EBUILD rats-2.4.ebuild 1162 SHA256 43b621578d9006cdbac1cfae3fcb9b93458787e25258fb78308a92e0b6722615 SHA512 96ffe97c9003989173278654195aabceef2562834c215f7d8ca33f6e215fc5dfddb4a3007cf0009c85db6f27d573ea6c4c9c548534baa355a0dfaf7ad690d423 WHIRLPOOL 1846e123dcc7788c3a49a12b6a1ebb93a35035d20ce750614d5b4482f21dd54098ffa2b86e2b65c22d5c4bc7361f64add61c6425ca97c19abe462e82897ac93b
+MISC ChangeLog 2451 SHA256 dda8d48317421c1295dabd0a07032d1d8dbb3ab85a1b984f192e5326283f1c06 SHA512 dfcdcc951962547bc14c98c4b454888682de0c21d4d4230e62c4cb57203347ceaedc39212ba8c3f38e5e9149da85426beebaaeb15535cf231fcb52251b921823 WHIRLPOOL 3c18093eeeb45474fbb500af7d5b886ef3ada187a9cbdd14deb8fde8d1afead211b4f854e6a0709a630d5ee388e44fcd5a07e5d68549d84cd06c7c1a99be127b
+MISC ChangeLog-2015 2522 SHA256 daa7e67f8753502c2c9d2f09cafc7669b8ff5e19f20b768b7da9b818562f3e22 SHA512 b40e9a053c836187040e4a2df14dedd5f0549df249c5ac294560cd3f8794dc54d6bac34001e860ce05a70516a87c338181590983a436f6e1afb581bf0aa9b3de WHIRLPOOL 9d1b445776cdc37f67fc485bc51f5629011bdb2d3f24476b270bbd0272df4504df427ec298bd834c0f8ecf228e59d5fdbccd34100df208c95362c5f0db7887b5
+MISC metadata.xml 604 SHA256 eba11894dcaa042fbb5f42641a807d740b87ccedbf8b71d0fd20ec972133036c SHA512 14edf04ecb58d9fd69c549b9cd64713338aaa8dab9230ddc00824dfaaa3b2e77090deeb0dc7f87fc875ebb3851ea3bae4765ee8e140b8695ad4088f1eb1fbdad WHIRLPOOL b7822209a31ca2aee6a2ede34bd710d824eee3263f21a543279deb19f9e438e8144b1c5c919a62578c4a069c5ea7be83518535f3f9bec5bfda60f6918dc685a2
diff --git a/dev-util/rats/files/rats-2.1-add-getopt-trailing-null.patch b/dev-util/rats/files/rats-2.1-add-getopt-trailing-null.patch
new file mode 100644
index 000000000000..65ea6df1f456
--- /dev/null
+++ b/dev-util/rats/files/rats-2.1-add-getopt-trailing-null.patch
@@ -0,0 +1,11 @@
+diff -Nuar --exclude '*~' rats-2.1.orig/main.c rats-2.1/main.c
+--- rats-2.1.orig/main.c 2002-09-16 21:05:43.000000000 -0700
++++ rats-2.1/main.c 2006-05-21 21:56:29.578601459 -0700
+@@ -278,6 +278,7 @@
+ {"columns", 0,0,0},
+ {"context", 0,0,0},
+ {"all-static", 0,0,0},
++ {NULL,0,0,0}
+ };
+ progname = argv[0];
+ flags|=RECURSIVE_FILE_SCAN;
diff --git a/dev-util/rats/files/rats-2.1-fix-null-pointers.patch b/dev-util/rats/files/rats-2.1-fix-null-pointers.patch
new file mode 100644
index 000000000000..0d4c701f0bfc
--- /dev/null
+++ b/dev-util/rats/files/rats-2.1-fix-null-pointers.patch
@@ -0,0 +1,128 @@
+diff -Nuar rats-2.1.orig/report.c rats-2.1/report.c
+--- rats-2.1.orig/report.c 2002-09-16 21:05:43.000000000 -0700
++++ rats-2.1/report.c 2006-05-21 23:16:16.323046789 -0700
+@@ -122,9 +122,15 @@
+ return result;
+ }
+
+-
+-
+-
++/* Exclusively for debugging vulnerabilities.
++ * - robbat2@gentoo.org 21/05/2006 */
++static void debug_vuln_dump(vulnerability_t *ptr) {
++ fprintf(stderr,"vuln_dump: this=%x f=%s l=%d c=%d d=%x t=%d s=%d u=%x p=(%x,%x)\n",
++ ptr,
++ ptr->filename,ptr->lineno,ptr->column,
++ ptr->data,ptr->type,ptr->severity,
++ ptr->uses,ptr->next,ptr->prev);
++}
+
+ static void
+ replace_cfname(char *filename)
+@@ -317,6 +323,27 @@
+ insert_vulnerability(log);
+ }
+
++/* These are special static vulnerabilities because we don't
++ * want NULL data elements in the vulnerability_t->data
++ * field, because the HTML and XML output formats use that
++ * pointer without checking it for being null first.
++ * - robbat2@gentoo.org 21/05/2006 */
++static struct Vuln_t vuln_PerlBacktick = {
++ .Name = "Perl Backtick"
++};
++static struct Vuln_t vuln_PhpBacktick = {
++ .Name = "PHP Backtick"
++};
++static struct Vuln_t vuln_PythonBacktick = {
++ .Name = "Python Backtick"
++};
++static struct Vuln_t vuln_StaticLocalBuffer = {
++ .Name = "Static Local Buffer"
++};
++static struct Vuln_t vuln_StaticGlobalBuffer = {
++ .Name = "Static Global Buffer"
++};
++
+ void log_perlbacktick(int lineno, int column, Severity_t severity)
+ {
+ vulnerability_t * log;
+@@ -325,7 +352,7 @@
+ log->filename = current_file;
+ log->column = column;
+ log->lineno = lineno;
+- log->data = (Vuln_t *)NULL;
++ log->data = &vuln_PerlBacktick;
+ log->type = PerlBacktick;
+ log->severity = severity;
+ log->uses = (toctou_use_t *)NULL;
+@@ -342,7 +369,7 @@
+ log->filename = current_file;
+ log->column = column;
+ log->lineno = lineno;
+- log->data = (Vuln_t *)NULL;
++ log->data = &vuln_PhpBacktick;
+ log->type = PhpBacktick;
+ log->severity = severity;
+ log->uses = (toctou_use_t *)NULL;
+@@ -358,7 +385,7 @@
+ log->filename = current_file;
+ log->column = column;
+ log->lineno = lineno;
+- log->data = (Vuln_t *)NULL;
++ log->data = &vuln_PythonBacktick;
+ log->type = PythonBacktick;
+ log->severity = severity;
+ log->uses = (toctou_use_t *)NULL;
+@@ -374,7 +401,16 @@
+ log->filename = current_file;
+ log->column = column;
+ log->lineno = lineno;
+- log->data = (Vuln_t *)NULL;
++ switch(type) {
++ case StaticLocalBuffer:
++ log->data = &vuln_StaticLocalBuffer;
++ break;
++ case StaticGlobalBuffer:
++ log->data = &vuln_StaticGlobalBuffer;
++ break;
++ default:
++ log->data = (Vuln_t *)NULL;
++ }
+ log->type = type;
+ log->severity = severity;
+ log->uses = (toctou_use_t *)NULL;
+@@ -432,6 +468,10 @@
+ static void build_xml_vulnerability(vulnerability_t *ptr) {
+ int i;
+
++ /* Debugging - robbat2@gentoo.org 21/05/2006 */
++ if(ptr->data == NULL)
++ debug_vuln_dump(ptr);
++
+ printf("<vulnerability>\n");
+
+ /* Output the severity */
+@@ -593,6 +633,8 @@
+ void report_vulnerability(vulnerability_t *ptr)
+ {
+ int i;
++ if(ptr->data == NULL)
++ debug_vuln_dump(ptr);
+
+ switch (ptr->type)
+ {
+@@ -890,8 +932,10 @@
+
+ static void build_html_vulnerability(vulnerability_t *ptr) {
+ int i;
+-
+-
++
++ /* Debugging - robbat2@gentoo.org 21/05/2006 */
++ if(ptr->data == NULL)
++ debug_vuln_dump(ptr);
+
+ /* Output the severity */
+ printf(" <b>Severity: %s</b><br/>\n",
diff --git a/dev-util/rats/metadata.xml b/dev-util/rats/metadata.xml
new file mode 100644
index 000000000000..d7aaff12cec9
--- /dev/null
+++ b/dev-util/rats/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+<longdescription>RATS - Rough Auditing Tool for Security - is an open source
+ tool developed and maintained by Secure Software security engineers. RATS
+ is a tool for scanning C, C++, Perl, PHP and Python source code and
+ flagging common security related programming errors such as buffer
+ overflows and TOCTOU (Time Of Check, Time Of Use) race conditions.
+</longdescription>
+</pkgmetadata>
diff --git a/dev-util/rats/rats-2.1-r2.ebuild b/dev-util/rats/rats-2.1-r2.ebuild
new file mode 100644
index 000000000000..161aeea514e1
--- /dev/null
+++ b/dev-util/rats/rats-2.1-r2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+inherit eutils
+
+DESCRIPTION="RATS - Rough Auditing Tool for Security"
+HOMEPAGE="http://www.fortifysoftware.com/security-resources/rats.jsp"
+SRC_URI="http://www.fortifysoftware.com/servlet/downloads/public/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE=""
+
+DEPEND="dev-libs/expat"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-add-getopt-trailing-null.patch
+ epatch "${FILESDIR}"/${P}-fix-null-pointers.patch
+}
+
+src_configure() {
+ econf --datadir="${EPREFIX}/usr/share/${PN}/"
+}
+
+src_install () {
+ einstall SHAREDIR="${ED}/usr/share/${PN}" MANDIR="${ED}/usr/share/man"
+ dodoc README README.win32
+}
+
+pkg_postinst() {
+ ewarn "Please be careful when using this program with it's force language"
+ ewarn "option, '--language <LANG>' it may take huge amounts of memory when"
+ ewarn "it tries to treat binary files as some other type."
+}
diff --git a/dev-util/rats/rats-2.4.ebuild b/dev-util/rats/rats-2.4.ebuild
new file mode 100644
index 000000000000..1c49b7c4df49
--- /dev/null
+++ b/dev-util/rats/rats-2.4.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+inherit eutils
+
+DESCRIPTION="RATS - Rough Auditing Tool for Security"
+HOMEPAGE="https://code.google.com/p/rough-auditing-tool-for-security/"
+SRC_URI="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rough-auditing-tool-for-security/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE=""
+
+DEPEND="dev-libs/expat"
+
+src_prepare() {
+ edos2unix $(find "${S}" -name '*.[chl]' -o -name '*.in' -o -name '*.am')
+ #epatch "${FILESDIR}"/${PN}-2.1-add-getopt-trailing-null.patch
+ #epatch "${FILESDIR}"/${PN}-2.1-fix-null-pointers.patch
+}
+
+src_configure() {
+ econf --datadir="${EPREFIX}/usr/share/${PN}/"
+}
+
+src_install () {
+ einstall SHAREDIR="${ED}/usr/share/${PN}" MANDIR="${ED}/usr/share/man"
+ dodoc README README.win32
+}
+
+pkg_postinst() {
+ ewarn "Please be careful when using this program with it's force language"
+ ewarn "option, '--language <LANG>' it may take huge amounts of memory when"
+ ewarn "it tries to treat binary files as some other type."
+}