sleep-config: check if we operate on regular file in swap_device_to_device_id() in swap file code path

Similar to the previous commit: before we continue doing swap file
operations let's ensure this actually is a swap file.
This commit is contained in:
Lennart Poettering
2023-06-20 13:13:54 +02:00
parent 1cf78c8f78
commit 08e0ed300a
+4
View File
@@ -631,6 +631,10 @@ static int swap_device_to_device_id(const SwapEntry *swap, dev_t *ret_dev) {
return 0;
}
r = stat_verify_regular(&sb);
if (r < 0)
return r;
return get_block_device(swap->device, ret_dev);
}