Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jun 2001 01:06:28 -0400 (EDT)
From:      Mike Barcroft <mike@q9media.com>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        audit@FreeBSD.org
Subject:   Re: src/usr.bin warns patch (also Re: src/usr.sbin warns patch)
Message-ID:  <200106240506.f5O56S790146@coffee.q9media.com>

next in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav <des@ofug.org> writes:

> Not so fast.  Please patch your /usr/share/mk/bsd.sys.mk to add
> -fno-builtin to CFLAGS when WARNS is greater than zero; some of the
> programs your patch marks as WARNS-safe (basename(1), for one) will
> then break due to calling exit(1) without including <stdlib.h>.
> 
> Same goes for your usr.sbin warns patch.

Thanks for spotting that.  The patch at the end of this e-mail and
also available at:
http://testbed.q9media.net/freebsd/include.20010624.patch
addresses this problem.  It should be applied before the usr.bin
and usr.sbin patches.  The other patches I sent to -audit weren't
missing any includes.

Best regards,
Mike Barcroft

-----------------------------------------------------------------------

include.20010624.patch

o Include missing headers for which gcc has built-in equivalents.


Index: basename/basename.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/basename/basename.c,v
retrieving revision 1.7
diff -u -r1.7 basename.c
--- basename/basename.c	2001/05/20 06:18:37	1.7
+++ basename/basename.c	2001/06/24 04:30:08
@@ -46,6 +46,7 @@
 #include <err.h>
 #include <libgen.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
Index: dirname/dirname.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/dirname/dirname.c,v
retrieving revision 1.7
diff -u -r1.7 dirname.c
--- dirname/dirname.c	2000/09/06 07:28:02	1.7
+++ dirname/dirname.c	2001/06/24 04:30:09
@@ -46,6 +46,7 @@
 #include <err.h>
 #include <libgen.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 void usage __P((void));
Index: fsync/fsync.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fsync/fsync.c,v
retrieving revision 1.2
diff -u -r1.2 fsync.c
--- fsync/fsync.c	2000/07/24 20:35:19	1.2
+++ fsync/fsync.c	2001/06/24 04:30:09
@@ -32,6 +32,7 @@
 #include <err.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sysexits.h>
 #include <unistd.h>
 
Index: gencat/gencat.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/gencat/gencat.c,v
retrieving revision 1.6
diff -u -r1.6 gencat.c
--- gencat/gencat.c	2001/02/08 16:38:16	1.6
+++ gencat/gencat.c	2001/06/24 04:30:10
@@ -37,6 +37,8 @@
 #include <sys/stat.h>
 #include <err.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include "gencat.h"
 
Index: keyinfo/keyinfo.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/keyinfo/keyinfo.c,v
retrieving revision 1.1
diff -u -r1.1 keyinfo.c
--- keyinfo/keyinfo.c	2000/08/10 22:53:49	1.1
+++ keyinfo/keyinfo.c	2001/06/24 04:30:10
@@ -28,6 +28,7 @@
 
 #include <sys/param.h>
 #include <stdio.h>
+#include <string.h>
 #include <skey.h>
 #include <unistd.h>
 #include <err.h>
Index: keylogout/keylogout.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/keylogout/keylogout.c,v
retrieving revision 1.3
diff -u -r1.3 keylogout.c
--- keylogout/keylogout.c	1999/08/28 01:02:29	1.3
+++ keylogout/keylogout.c	2001/06/24 04:30:10
@@ -41,6 +41,8 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <rpc/key_prot.h>
 
Index: leave/leave.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/leave/leave.c,v
retrieving revision 1.7
diff -u -r1.7 leave.c
--- leave/leave.c	2001/05/30 02:38:10	1.7
+++ leave/leave.c	2001/06/24 04:30:11
@@ -49,6 +49,7 @@
 #include <ctype.h>
 #include <locale.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <time.h>
 #include <unistd.h>
 
Index: mkfifo/mkfifo.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mkfifo/mkfifo.c,v
retrieving revision 1.5
diff -u -r1.5 mkfifo.c
--- mkfifo/mkfifo.c	1999/08/28 01:04:06	1.5
+++ mkfifo/mkfifo.c	2001/06/24 04:30:12
@@ -51,6 +51,7 @@
 #include <err.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
Index: unexpand/unexpand.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/unexpand/unexpand.c,v
retrieving revision 1.5
diff -u -r1.5 unexpand.c
--- unexpand/unexpand.c	1999/08/28 01:07:04	1.5
+++ unexpand/unexpand.c	2001/06/24 04:30:13
@@ -50,6 +50,7 @@
  */
 #include <err.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 char	genbuf[BUFSIZ];
Index: lastlogin.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/lastlogin/lastlogin.c,v
retrieving revision 1.2
diff -u -r1.2 lastlogin.c
--- lastlogin.c	2000/12/10 20:57:23	1.2
+++ lastlogin.c	2001/06/24 04:31:10
@@ -39,6 +39,7 @@
 #include <err.h>
 #include <pwd.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <time.h>
 #include <utmp.h>
 #include <unistd.h>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106240506.f5O56S790146>