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

Re: [libvirt] PATCH 1/4: AppArmor updates



On Fri, Aug 13, 2010 at 04:58:57PM -0500, Jamie Strandboge wrote:
> Attached is 0001-apparmor-dont-ignore-open.patch
> 
> -- 
> Jamie Strandboge             | http://www.canonical.com

> Index: libvirt-0.8.3/src/security/virt-aa-helper.c
> ===================================================================
> --- libvirt-0.8.3.orig/src/security/virt-aa-helper.c	2010-08-12 09:51:42.000000000 -0500
> +++ libvirt-0.8.3/src/security/virt-aa-helper.c	2010-08-12 09:58:42.000000000 -0500
> @@ -853,11 +853,25 @@
>           * careful than just ignoring them */
>          int ret = virDomainDiskDefForeachPath(ctl->def->disks[i],
>                                                ctl->allowDiskFormatProbing,
> -                                              true,
> +                                              false,
>                                                add_file_path,
>                                                &buf);
> -        if (ret != 0)
> +        /*
> +         * If virDomainDiskDefForeachPath() fails, then exit with error,
> +         * unless the disk doesn't exist, in which case we just skip it
> +         * without error in order to preserve previous behavior.
> +         */
> +        if (ret != 0) {
> +            if (ctl->def->disks[i] && ctl->def->disks[i]->src) {
> +                if (!virFileExists(ctl->def->disks[i]->src)) {
> +                    continue;
> +                } else {
> +                    vah_warning(ctl->def->disks[i]->src);
> +                    vah_warning("  skipped (bad disk format)");
> +                }
> +            }
>              goto clean;
> +        }

Why do we need special behaviour to skip files which don't exist ?
If this is solely to keep the test suite happy, then IMHO the
fix should be in the test suite. Runtime production code shouldn't
have workarounds for test code.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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