]> xenbits.xensource.com Git - libvirt.git/commit
run.in: Detect binaries in builddir properly
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 22 May 2024 15:21:04 +0000 (17:21 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 4 Jun 2024 12:39:00 +0000 (14:39 +0200)
commit4381b83d991b51a07ba5b6d3f56e6c0a8910a38d
tree4111cd94adaa92f157098541d0756b69582f83a8
parent83bed4367e76e9003479a8d7bd5cbee080d80017
run.in: Detect binaries in builddir properly

When attempting to run:

  libvirt.git/_build # ./run --selinux ./src/libvirtd

the following error is thrown:

  Refusing to change selinux context of file './src/libvirtd' outside build directory

which is obviously wrong. The problem is 'being inside of build
directory' is detected by simple progpath.startswith(builddir).
While builddir is an absolute path, progpath isn't necessarily.

And while looking into the code, I've noticed chcon() function
accessing variable outside its scope when printing out the path
it's working on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
run.in