]> git.ipfire.org Git - thirdparty/grub.git/commit
loopback: Do not automaticaly replace existing loopback dev, error instead
authorGlenn Washburn <development@efficientek.com>
Fri, 4 Dec 2020 01:57:11 +0000 (19:57 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sat, 12 Dec 2020 00:19:03 +0000 (01:19 +0100)
commit85307c34e895df5d8b3af23b765d878242c3cdc2
treeacb126ecc5490a33ea85f107df5a817579637585
parent407ddead690ea76d63415f37deba9421b0bf5c13
loopback: Do not automaticaly replace existing loopback dev, error instead

If there is a loopback device with the same name as the one to be created,
instead of closing the old one and replacing it with the new one, return an
error instead. If the loopback device was created, its probably being used
by something and just replacing it may cause GRUB to crash unexpectedly.
This fixes obvious problems like "loopback d (d)/somefile". Its not too
onerous to force the user to delete the loopback first with the "-d" switch.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/loopback.c