]> xenbits.xensource.com Git - libvirt.git/commit
util: make virSetUIDGID a NOP only when uid or gid is -1
authorLaine Stump <laine@laine.org>
Thu, 31 Jan 2013 18:18:45 +0000 (13:18 -0500)
committerLaine Stump <laine@laine.org>
Wed, 13 Feb 2013 21:11:15 +0000 (16:11 -0500)
commitf506a4c115c44003455cb956861836a46425f97b
treeada91608fd99a26e1abc7356d1b7e707080157d3
parent417182b072f088a0338bf0460fda14f7ad953c97
util: make virSetUIDGID a NOP only when uid or gid is -1

Rather than treating uid:gid of 0:0 as a NOP, we blindly pass that
through to the lower layers. However, we *do* check for a requested
value of "-1" to mean "don't change this setting". setregid() and
setreuid() already interpret -1 as a NOP, so this is just an
optimization, but we are also calling getpwuid_r and initgroups, and
it's unclear what the former would do with a uid of -1.
src/util/virutil.c