Re: [PATCH v3 34/34] Introduce syntax-check rule to prefer VIR_STRDUP over strdup

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

 



On 05/03/2013 08:53 AM, Michal Privoznik wrote:
> ---
>  cfg.mk | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/cfg.mk b/cfg.mk
> index 1d63bbd..4ed2c3a 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -387,6 +387,11 @@ sc_prohibit_asprintf:
>  	halt='use strdup instead of virAsprintf with "%s"'		\
>  	  $(_sc_search_regexp)
>  
> +sc_prohibit_strdup:
> +	@prohibit='\<strn?dup\> *\('					\
> +	halt='use VIR_STRUP, not strdup'				\

s/VIR_STRUP/VIR_STRDUP/

> +	  $(_sc_search_regexp)
> +
>  # Prefer virSetUIDGID.
>  sc_prohibit_setuid:
>  	@prohibit='\<set(re)?[ug]id\> *\('				\
> @@ -864,6 +869,9 @@ exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
>  exclude_file_name_regexp--sc_prohibit_asprintf = \
>    ^(bootstrap.conf$$|src/util/virstring\.c$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$)
>  
> +exclude_file_name_regexp--sc_prohibit_strdup = \
> +  ^(docs/|examples/|python/|src/util/virstring\.c$$|tools/virsh\.c$$)

Do we really need to allow strdup() in the python c code?  Likewise for
tools/virsh.c?

There will probably be more places to touch up before you finally commit
this, given other activity in the tree in the meantime :)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]