[libvirt] [PATCH v2 01/22] virt-aa-helper: Trick invalid syntax-check

John Ferlan jferlan at redhat.com
Thu Nov 13 23:57:58 UTC 2014



On 11/13/2014 09:37 AM, Martin Kletzander wrote:
> Rule sc_prohibit_newline_at_end_of_diagnostic for syntax-check does
> check for passing strings ending with '\n' to known functions.  But when
> setting IFS, '\n' needs to be part of that (and is by default).  The
> order of individual characters in IFS doesn't matter, so transposing
> last two of them fixes it for the future.
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>  src/security/virt-aa-helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

I was just about to point out that this particular change did seem out
of place with the rest of the series (forgot to do that in my .0
response)... I'm sure glad Eric has the standards knowledge!

John
> diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
> index 1f299a0..e102c3c 100644
> --- a/src/security/virt-aa-helper.c
> +++ b/src/security/virt-aa-helper.c
> @@ -1257,7 +1257,7 @@ main(int argc, char **argv)
>          vah_error(ctl, 1, _("could not set PATH"));
>      }
> 
> -    if (setenv("IFS", " \t\n", 1) != 0) {
> +    if (setenv("IFS", " \n\t", 1) != 0) {
>          vah_error(ctl, 1, _("could not set IFS"));
>      }
> 




More information about the libvir-list mailing list