bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cleanup patch to isolate "safer" functions within coreutils


From: Jim Meyering
Subject: Re: cleanup patch to isolate "safer" functions within coreutils
Date: Sun, 03 Jul 2005 11:42:23 +0200

Paul Eggert <address@hidden> wrote:
> I installed this:
>
> 2005-07-02  Paul Eggert  <address@hidden>
>
>       Cleanup to isolate "safer" functions to a small part of the code.
>       * lib/fcntl--.h, lib/stdio--.h, lib/stdlib--.h, lib/unistd--.h:
>       * lib/fcntl-safer.h, lib/open-safer.c, lib/stdlib-safer.h:
>       * lib/mkstemp-safer.c, lib/fd-reopen.h, lib/fd-reopen.c: New files.
>       * lib/fopen-safer.c: Include stdio-safer.h first, to check interface.

Thanks for all that cleanup!

[ In case it wasn't clear, Paul's change means that we no longer have
  to worry about a new open/fopen/dup/mkstemp call (without code
  to check fd_safer) opening up a new hole.  Now, all such calls go
  through the safer_* wrappers -- at least in the .c files that include
  the appropriate --.h header(s). ]

I noticed that `make dist' fails because the new *--.h files aren't
included.  I've just added the *--.h files, one to each corresponding
AC_LIBSOURCES list in m4/*-safer.m4.

Actually, those .h files aren't technically needed in order to use
the *_safer functions, so they're not true dependents.  It's the other
way around: the --.h files are useless without the *_safer functions.
So you might think we need new modules (and .m4 macros), one per
--.h file.  But the --.h files are so small that that would be overkill.

2005-07-03  Jim Meyering  <address@hidden>

        * fcntl-safer.m4 (gl_FCNTL_SAFER): Add fcntl--.h to the list.
        * stdio-safer.m4 (gl_STDIO_SAFER): Add stdio--.h to the list.
        * stdlib-safer.m4: (gl_STDLIB_SAFER): Add stdlib--.h to the list.
        * unistd-safer.m4 (gl_UNISTD_SAFER): Add unistd--.h to the list.

Index: m4/fcntl-safer.m4
===================================================================
RCS file: /fetish/cu/m4/fcntl-safer.m4,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -u -r1.5 -r1.6
--- m4/fcntl-safer.m4   3 Jul 2005 06:43:07 -0000       1.5
+++ m4/fcntl-safer.m4   3 Jul 2005 09:13:33 -0000       1.6
@@ -6,6 +6,6 @@ dnl with or without modifications, as lo
 
 AC_DEFUN([gl_FCNTL_SAFER],
 [
-  AC_LIBSOURCES([open-safer.c, fcntl-safer.h])
+  AC_LIBSOURCES([open-safer.c, fcntl-safer.h, fcntl--.h])
   AC_LIBOBJ([open-safer])
 ])
Index: m4/stdio-safer.m4
===================================================================
RCS file: /fetish/cu/m4/stdio-safer.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -u -r1.3 -r1.4
--- m4/stdio-safer.m4   11 Apr 2005 20:04:57 -0000      1.3
+++ m4/stdio-safer.m4   3 Jul 2005 09:13:27 -0000       1.4
@@ -6,7 +6,7 @@ dnl with or without modifications, as lo
 
 AC_DEFUN([gl_STDIO_SAFER],
 [
-  AC_LIBSOURCES([fopen-safer.c, stdio-safer.h])
+  AC_LIBSOURCES([fopen-safer.c, stdio-safer.h, stdio--.h])
   AC_LIBOBJ([fopen-safer])
 
   dnl Prerequisites of lib/fopen-safer.c.
Index: m4/stdlib-safer.m4
===================================================================
RCS file: /fetish/cu/m4/stdlib-safer.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -u -r1.1 -r1.2
--- m4/stdlib-safer.m4  3 Jul 2005 06:43:07 -0000       1.1
+++ m4/stdlib-safer.m4  3 Jul 2005 09:13:04 -0000       1.2
@@ -6,6 +6,6 @@ dnl with or without modifications, as lo
 
 AC_DEFUN([gl_STDLIB_SAFER],
 [
-  AC_LIBSOURCES([mkstemp-safer.c, stdlib-safer.h])
+  AC_LIBSOURCES([mkstemp-safer.c, stdlib-safer.h, stdlib--.h])
   AC_LIBOBJ([mkstemp-safer])
 ])
Index: m4/unistd-safer.m4
===================================================================
RCS file: /fetish/cu/m4/unistd-safer.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -u -r1.4 -r1.5
--- m4/unistd-safer.m4  1 Jul 2005 21:06:08 -0000       1.4
+++ m4/unistd-safer.m4  3 Jul 2005 09:12:57 -0000       1.5
@@ -6,7 +6,7 @@ dnl with or without modifications, as lo
 
 AC_DEFUN([gl_UNISTD_SAFER],
 [
-  AC_LIBSOURCES([dup-safer.c, fd-safer.c, unistd-safer.h])
+  AC_LIBSOURCES([dup-safer.c, fd-safer.c, unistd-safer.h, unistd--.h])
   AC_LIBOBJ([dup-safer])
   AC_LIBOBJ([fd-safer])
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]