]> xenbits.xensource.com Git - libvirt.git/commit
qemusecuritymock: Fix bit arithmetic
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Apr 2019 15:17:40 +0000 (17:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2019 06:36:03 +0000 (08:36 +0200)
commit854f0e85e4fa8bf8f0e9da1c44609eefb04a629b
tree93e81125d9dd24d53127914489a031fff66feed6
parent0a9dcfabf89d711d5e01f606f02d87b2ff9ceb95
qemusecuritymock: Fix bit arithmetic

One of the functions of this mock is that it spoofs chown() and
stat() calls. But it is doing so in a clever way: it stores the
new owner on chown() and reports it on subsequent stat(). This is
done by using a 32bit unsigned integer where one half is used to
store uid the other is for gid. Later, when stat() is called the
integer is fetched and split into halves again. Well, my bit
operation skills are poor and the code I've written does not do
that properly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tests/qemusecuritymock.c