]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
syntax-check: prohibit all new uses of gethostby* functions
authorJim Meyering <meyering@redhat.com>
Thu, 11 Dec 2008 15:14:03 +0000 (15:14 +0000)
committerJim Meyering <meyering@redhat.com>
Thu, 11 Dec 2008 15:14:03 +0000 (15:14 +0000)
* Makefile.maint (sc_prohibit_gethostby): New rule.
* .x-sc_prohibit_gethostby: Exempt the few existing uses.

.x-sc_prohibit_gethostby [new file with mode: 0644]
ChangeLog
Makefile.maint

diff --git a/.x-sc_prohibit_gethostby b/.x-sc_prohibit_gethostby
new file mode 100644 (file)
index 0000000..d74ea40
--- /dev/null
@@ -0,0 +1,3 @@
+gnulib/lib/getaddrinfo.c
+gnulib/m4/getaddrinfo.m4
+src/xend_internal.c
index feb0b3c04c49bf01a10a1f8a39e14e708a05ae39..cae44d793f48b8e54a65f0c4f9998b8e19bdc2f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Dec 11 16:13:08 +0100 2008 Jim Meyering <meyering@redhat.com>
+
+       syntax-check: prohibit all new uses of gethostby* functions
+       * Makefile.maint (sc_prohibit_gethostby): New rule.
+       * .x-sc_prohibit_gethostby: Exempt the few existing uses.
+
 Thu Dec 11 10:03:00 EST 2008 Cole Robinson <crobinso@redhat.com>
 
        * src/test.c: Fix locking issue in test driver VolLookupByPath
index 10d481b764e7ef79186eba47c84e3c898ad57261..051e4c0238787a6bc46cccd761c60149755fe4b5 100644 (file)
@@ -390,6 +390,12 @@ sc_prohibit_virBufferAdd_with_string_literal:
          { echo '$(ME): use virBufferAddLit, not virBufferAdd,' \
              'with a string literal' 1>&2; exit 1; } || :
 
+# Not only do they fail to deal well with ipv6, but the gethostby*
+# functions are also not thread-safe.
+sc_prohibit_gethostby:
+       @grep -nE '\<gethostby(addr|name2?) *\(' $$($(VC_LIST_EXCEPT)) && \
+         { echo '$(ME): use getaddrinfo, not gethostby*' 1>&2; exit 1; } || :
+
 # Avoid useless parentheses like those in this example:
 # #if defined (SYMBOL) || defined (SYM2)
 sc_useless_cpp_parens: