mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Move check for loop device inside crypt_loop_backing_file.
It also fixes minor regression where we return backing file for partition on top of loop device when prompting for passphrase. Partition on loop has different major number so it should not be considered loop device at all.
This commit is contained in:
@@ -252,7 +252,12 @@ static char *_sysfs_backing_file(const char *loop)
|
||||
|
||||
char *crypt_loop_backing_file(const char *loop)
|
||||
{
|
||||
char *bf = _sysfs_backing_file(loop);
|
||||
char *bf;
|
||||
|
||||
if (!crypt_loop_device(loop))
|
||||
return NULL;
|
||||
|
||||
bf = _sysfs_backing_file(loop);
|
||||
return bf ?: _ioctl_backing_file(loop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user