summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2014-11-09 01:52:24 +0000
committeragc <agc@pkgsrc.org>2014-11-09 01:52:24 +0000
commit47ae800b1c5bd4a66548fb963ae2f651f52a19f1 (patch)
treecba37d5da6090f59d65df22fd4f182cbf8ba94ed
parent7c1faf79d999ff7e700e70d1cddf954b61865d93 (diff)
downloadpkgsrc-47ae800b1c5bd4a66548fb963ae2f651f52a19f1.tar.gz
Initial import of libsafec, providing bounds checking memory and string
functions per ISO/IEC TR24731, into the packages collection. The Safe C Library provides bound checking memory and string functions per ISO/IEC TR24731. These functions are alternative functions to the existing standard C library that promote safer, more secure programming. The ISO/IEC Programming languages -- C spec, C11, now includes the bounded APIs in Appendix K, "Bounds-checking interfaces".
-rw-r--r--devel/libsafec/DESCR7
-rw-r--r--devel/libsafec/Makefile19
-rw-r--r--devel/libsafec/PLIST8
-rw-r--r--devel/libsafec/distinfo8
-rw-r--r--devel/libsafec/patches/patch-src__safeclib__strcasestr_s.c15
-rw-r--r--devel/libsafec/patches/patch-tests__perf_memcpy32_s.c33
-rw-r--r--devel/libsafec/patches/patch-tests__perf_memcpy_s.c24
7 files changed, 114 insertions, 0 deletions
diff --git a/devel/libsafec/DESCR b/devel/libsafec/DESCR
new file mode 100644
index 00000000000..31793904df9
--- /dev/null
+++ b/devel/libsafec/DESCR
@@ -0,0 +1,7 @@
+The Safe C Library provides bound checking memory and string functions
+per ISO/IEC TR24731. These functions are alternative functions to the
+existing standard C library that promote safer, more secure
+programming.
+
+The ISO/IEC Programming languages -- C spec, C11, now includes the
+bounded APIs in Appendix K, "Bounds-checking interfaces".
diff --git a/devel/libsafec/Makefile b/devel/libsafec/Makefile
new file mode 100644
index 00000000000..95e05adff80
--- /dev/null
+++ b/devel/libsafec/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+#
+
+DISTNAME= libsafec-10052013
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=safeclib/}
+
+MAINTAINER= agc@NetBSD.org
+HOMEPAGE= http://sourceforge.net/projects/safeclib
+COMMENT= C bounds checking memory and string functions library
+LICENSE= mit
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= pkg-config
+
+AUTO_MKDIRS= yes
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/libsafec/PLIST b/devel/libsafec/PLIST
new file mode 100644
index 00000000000..849390849f5
--- /dev/null
+++ b/devel/libsafec/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+include/libsafec/safe_lib.h
+include/libsafec/safe_lib_errno.h
+include/libsafec/safe_mem_lib.h
+include/libsafec/safe_str_lib.h
+include/libsafec/safe_types.h
+lib/libsafec-1.0.la
+lib/pkgconfig/safec-1.0.pc
diff --git a/devel/libsafec/distinfo b/devel/libsafec/distinfo
new file mode 100644
index 00000000000..06fbe0e83fb
--- /dev/null
+++ b/devel/libsafec/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+
+SHA1 (libsafec-10052013.tar.gz) = daf86aa303259a713ffdb3854fff497c59cc9466
+RMD160 (libsafec-10052013.tar.gz) = 93bdb27a8748fee3d32a7fd613ed1927a7b5c3af
+Size (libsafec-10052013.tar.gz) = 1957012 bytes
+SHA1 (patch-src__safeclib__strcasestr_s.c) = 5a37c2f5ac6d4fc6426399811af97ee88355869b
+SHA1 (patch-tests__perf_memcpy32_s.c) = a72a3168cf5b71228785d9433ef41babfc1838ea
+SHA1 (patch-tests__perf_memcpy_s.c) = a67f195d5b09539746b3899c1b5363e28ea2efab
diff --git a/devel/libsafec/patches/patch-src__safeclib__strcasestr_s.c b/devel/libsafec/patches/patch-src__safeclib__strcasestr_s.c
new file mode 100644
index 00000000000..43a3ac9f68d
--- /dev/null
+++ b/devel/libsafec/patches/patch-src__safeclib__strcasestr_s.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src__safeclib__strcasestr_s.c,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+
+patch for ctype macro args - how was this "safe" in the first place?
+
+--- src/safeclib/strcasestr_s.c 2014/11/09 01:39:40 1.1
++++ src/safeclib/strcasestr_s.c 2014/11/09 01:40:08
+@@ -153,7 +153,7 @@
+ while (dest[i] && dlen) {
+
+ /* not a match, not a substring */
+- if (toupper(dest[i]) != toupper(src[i])) {
++ if (toupper((unsigned char)dest[i]) != toupper((unsigned char)src[i])) {
+ break;
+ }
+
diff --git a/devel/libsafec/patches/patch-tests__perf_memcpy32_s.c b/devel/libsafec/patches/patch-tests__perf_memcpy32_s.c
new file mode 100644
index 00000000000..29562ba7c97
--- /dev/null
+++ b/devel/libsafec/patches/patch-tests__perf_memcpy32_s.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-tests__perf_memcpy32_s.c,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+
+set but unused rc
+
+--- tests/perf_memcpy32_s.c 2014/11/09 01:43:33 1.1
++++ tests/perf_memcpy32_s.c 2014/11/09 01:44:41
+@@ -31,7 +31,7 @@
+
+ static void timing_loop (uint32_t len, uint32_t loops)
+ {
+- errno_t rc;
++ /* errno_t rc; */
+ uint32_t i;
+
+ clock_t clock_start;
+@@ -56,7 +56,7 @@
+ */
+ clock_start = clock();
+ for (i=0;i<loops; i++) {
+- rc = memcpy32_s(mem1, len, mem2, len);
++ /* rc = */ memcpy32_s(mem1, len, mem2, len);
+ }
+ clock_end = clock();
+
+@@ -73,7 +73,7 @@
+ */
+ clock_start = clock();
+ for (i=0;i<loops; i++) {
+- rc = memcpy16_s(mem3, len, mem4, len);
++ /* rc = */ memcpy16_s(mem3, len, mem4, len);
+ //memcpy(mem1, mem2, len);
+ }
+ clock_end = clock();
diff --git a/devel/libsafec/patches/patch-tests__perf_memcpy_s.c b/devel/libsafec/patches/patch-tests__perf_memcpy_s.c
new file mode 100644
index 00000000000..1d390490eb9
--- /dev/null
+++ b/devel/libsafec/patches/patch-tests__perf_memcpy_s.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-tests__perf_memcpy_s.c,v 1.1.1.1 2014/11/09 01:52:24 agc Exp $
+
+set but unused rc
+
+--- tests/perf_memcpy_s.c 2014/11/09 01:43:33 1.1
++++ tests/perf_memcpy_s.c 2014/11/09 01:45:02
+@@ -28,7 +28,7 @@
+
+ static void timing_loop (uint32_t len, uint32_t loops)
+ {
+- errno_t rc;
++ /* errno_t rc; */
+ uint32_t i;
+
+ clock_t clock_start;
+@@ -51,7 +51,7 @@
+ */
+ clock_start = clock();
+ for (i=0;i<loops; i++) {
+- rc = memcpy_s(mem1, len, mem2, len);
++ /* rc = */memcpy_s(mem1, len, mem2, len);
+ }
+ clock_end = clock();
+