[PATCH v2 6/8] syntax-check: Prohibit canonicalize_file_name()

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

 



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@xxxxxxxxxx>
---
 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/(securityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src/packet-libvirt\.c)$$
 
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux