kpartx: use absolute path for regular files
authorMartin Wilck <mwilck@suse.com>
Mon, 15 May 2017 15:37:20 +0000 (17:37 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 17 May 2017 21:45:01 +0000 (23:45 +0200)
commit9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b
tree16ba728a9cad12b679f8561b0fa7b6d7cd65a365
parentf3c233b2fd7363c6483c46a07b080e3ad97cf7b6
kpartx: use absolute path for regular files

kpartx supports being called for a regular file, in which
case it assumes that it should set up a loop device or use
an existing one. Because the loopinfo.lo_name field contains
an absolute path, matching with existing loop devices fails
for relative paths. Matching by basename only would be unreliable.

Therefore, convert relative to absolute path for regular files.

Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/kpartx.c