]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Change default for storage uid/gid from getuid()/getgid() to -1/-1
authorLaine Stump <laine@laine.org>
Thu, 4 Mar 2010 22:35:27 +0000 (17:35 -0500)
committerCole Robinson <crobinso@redhat.com>
Thu, 4 Mar 2010 22:35:27 +0000 (17:35 -0500)
commit219305df44fdf576e56659f487ab625b6ee18ba0
tree5cf3af9d25a0d42fdc60601fdcd66d404110841e
parentc7434706a27391bdaf441bef3775d78df92a0f1e
Change default for storage uid/gid from getuid()/getgid() to -1/-1

This allows the config to have a setting that means "leave it alone",
eg when building a pool where the directory already exists the user
may want the current uid/gid of the directory left intact. This
actually gets us back to older behavior - before recent changes to the
pool building code, we weren't as insistent about honoring the uid/gid
settings in the XML, and virt-manager was taking advantage of this
behavior.

As a side benefit, removing calls to getuid/getgid from the XML
parsing functions also seems like a good idea. And having a default
that is different from a common/useful value (0 == root) is a good
thing in general, as it removes ambiguity from decisions (at least one
place in the code was checking for (perms.uid == 0) to see if a
special uid was requested).

Note that this will only affect newly created pools and volumes. Due
to the way that the XML is parsed, then formatted for newly created
volumes, all existing pools/volumes already have an explicit uid and
gid set.

src/conf/storage_conf.c: Remove calls to setuid/setgid for default values
                         of uid/gid, and set them to -1 instead

src/storage/storage_backend.c:
src/storage/storage_backend_fs.c:
        Make account for the new default values of perms.uid
        and perms.gid.
src/conf/storage_conf.c
src/storage/storage_backend.c
src/storage/storage_backend_fs.c