[prev in list] [next in list] [prev in thread] [next in thread]
List: libvir-list
Subject: [libvirt] [PATCH v2 6/8] syntax-check: Prohibit canonicalize_file_name()
From: Andrea Bolognani <abologna () redhat ! com>
Date: 2018-04-30 16:53:01
Message-ID: 20180430165303.6124-7-abologna () redhat ! com
[Download RAW message or body]
Now what we have removed all uses of the function, we want to
prevent it from creeping back in.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
cfg.mk | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index c3d18279ce..7ffa10f563 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -462,6 +462,13 @@ sc_prohibit_ctype_h:
halt='use c-ctype.h instead of ctype.h' \
$(_sc_search_regexp)
+# canonicalize_file_name() is only available in glibc, and the gnulib
+# version is difficult to mock; realpath() suffers from neither limitation
+sc_prohibit_canonicalize_file_name:
+ @prohibit='\<canonicalize_file_name\(' \
+ halt='use realpath(path, NULL) instead of canonicalize_file_name(path)' \
+ $(_sc_search_regexp)
+
# Insist on correct types for [pug]id.
sc_correct_id_types:
@prohibit='\<(int|long) *[pug]id\>' \
@@ -1208,6 +1215,9 @@ exclude_file_name_regexp--sc_prohibit_nonreentrant = \
exclude_file_name_regexp--sc_prohibit_select = \
^cfg\.mk$$
+exclude_file_name_regexp--sc_prohibit_canonicalize_file_name = \
+ ^cfg\.mk$$
+
exclude_file_name_regexp--sc_prohibit_raw_allocation = \
^(docs/hacking\.html\.in|src/util/viralloc\.[ch]|examples/.*|tests/(securityselinux \
helper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src/packet-libvirt\.c)$$ \
--
2.14.3
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic