• E
    util: move detection of shared filesystems · 5160ab79
    Eric Blake 提交于
    The code in virstoragefile.c is getting more complex as I
    consolidate backing chain handling code.  But for the setuid
    virt-login-shell, we don't need to crawl backing chains.  It's
    easier to audit things for setuid security if there are fewer
    files involved, so this patch moves the one function that
    virFileOpen() was actually relying on to also live in virfile.c.
    
    * src/util/virstoragefile.c (virStorageFileIsSharedFS)
    (virStorageFileIsSharedFSType): Move...
    * src/util/virfile.c (virFileIsSharedFS, virFileIsSharedFSType):
    ...to here, and rename.
    (virFileOpenAs): Update caller.
    * src/security/security_selinux.c
    (virSecuritySELinuxSetFileconHelper)
    (virSecuritySELinuxSetSecurityAllLabel)
    (virSecuritySELinuxRestoreSecurityImageLabelInt): Likewise.
    * src/security/security_dac.c
    (virSecurityDACRestoreSecurityImageLabelInt): Likewise.
    * src/qemu/qemu_driver.c (qemuOpenFileAs): Likewise.
    * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
    * src/util/virstoragefile.h: Adjust declarations.
    * src/util/virfile.h: Likewise.
    * src/libvirt_private.syms (virfile.h, virstoragefile.h): Move
    symbols as appropriate.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    5160ab79
qemu_driver.c 538.7 KB