aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2023-02-15 05:37:12 +0000
committerCy Schubert <cy@FreeBSD.org>2023-02-15 16:55:03 +0000
commitd74ee97ef91d49d94749cc595ddc7ee9f37571ad (patch)
treefb9216430408278f132739ef1a8f055b1c23ff70
parentf40f8b877c3a162dbcc72acf2290732129fcbe93 (diff)
downloadports-d74ee97ef91d49d94749cc595ddc7ee9f37571ad.tar.gz
ports-d74ee97ef91d49d94749cc595ddc7ee9f37571ad.zip
security/cops: Permanently fix LLVM15 errors
Fix: src/addto.c:48:17: error: incompatible pointer to integer conversion assigning to 'char' from 'void *' [-Wint-conversion] keypending[0] = NULL; ^ ~~~~
-rw-r--r--security/cops/Makefile1
-rw-r--r--security/cops/files/patch-src_addto.c54
2 files changed, 54 insertions, 1 deletions
diff --git a/security/cops/Makefile b/security/cops/Makefile
index 6671a944a655..1b661dd334fd 100644
--- a/security/cops/Makefile
+++ b/security/cops/Makefile
@@ -14,7 +14,6 @@ USE_PERL5= run
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION:S/.//g}+
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= reconfig
-CFLAGS= -Wno-format-security -Wno-int-conversion
MAKEFILE= makefile
MAKE_ARGS= EXECUTABLE="${EXECUTABLE}" C_SRC="${C_SRC}"
MAKE_JOBS_UNSAFE= yes
diff --git a/security/cops/files/patch-src_addto.c b/security/cops/files/patch-src_addto.c
new file mode 100644
index 000000000000..bfc47966a323
--- /dev/null
+++ b/security/cops/files/patch-src_addto.c
@@ -0,0 +1,54 @@
+--- src/addto.c.orig 1992-03-26 16:14:28.000000000 -0800
++++ src/addto.c 2023-02-14 21:35:27.391968000 -0800
+@@ -26,6 +26,8 @@
+ #define LINELEN 600 /* Max chars in a line. */
+ #define SUCCESS "Success" /* Filename to put success messages. */
+
++#define NUL '\0'
++
+ main(argc, argv)
+ int argc;
+ char *argv[];
+@@ -45,13 +47,13 @@
+
+ tmpfile = NULL;
+
+- keypending[0] = NULL;
++ keypending[0] = NUL;
+ strcat(keypending, key);
+ strcat(keypending, " ");
+ /*
+ * If the uid is known, print out the comments and exit.
+ */
+- filename[0] = NULL;
++ filename[0] = NUL;
+ strcat(filename, type);
+ strcat(filename, ".k");
+ if ((tmpfile = fopen(filename, "r")) == NULL) {
+@@ -82,7 +84,7 @@
+ /*
+ * If a duplicate, don't add it.
+ */
+- filename[0] = NULL;
++ filename[0] = NUL;
+ strcat(filename, type);
+ strcat(filename, ".p");
+ if (freopen(filename, "r", tmpfile) == NULL) {
+@@ -97,7 +99,7 @@
+ /*
+ * Add the goal to the pending file.
+ */
+- filename[0] = NULL;
++ filename[0] = NUL;
+ strcat(filename, type);
+ strcat(filename, ".p");
+ if (freopen(filename, "a", tmpfile) == NULL) {
+@@ -109,7 +111,7 @@
+ /*
+ * Add the goal to the next goal (type) file.
+ */
+- filename[0] = NULL;
++ filename[0] = NUL;
+ strcat(filename, type);
+ strcat(filename, ".n");
+ if (freopen(filename, "a", tmpfile) == NULL) {