Subject: patch,unmaintained main/compat-pvgrub: may write to wrong file

From: Lars Johannsen <[email-masked]>
Date: Thu, 24 Oct 2019 12:02:15 +0200

Hi
While browsing aports i saw this bug.
Im not using this package and it seems to be unmaintained,
but anyway here is a patch to prevent it from writing to the wrong file.

From 9394fd8e5e672bdb4b3a30ffc59c5fdb628c5ca2 Mon Sep 17 00:00:00 2001
From: JailBox <[email-masked]>
Date: Thu, 24 Oct 2019 00:23:03 +0200
Subject: [PATCH] main/compat-pvgrub: prevent output to wrong conf-file

 if "$myconf" defines/redefines "$conf"
	the generated output would go to the wrong file
I.e. 
  >echo "conf=/boot/mybootdir/extlinux.conf" >> /etc/update-extliunx.conf
 /sbin/update-extlinux will honor this,
 while update-pvgrub would write to the wrong config file.

So postpone presetting "$conf" until "$myconf" has been source'd

---
 main/compat-pvgrub/update-pvgrub | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main/compat-pvgrub/update-pvgrub b/main/compat-pvgrub/update-pvgrub
index 56594a337b..5293f5081a 100755
--- a/main/compat-pvgrub/update-pvgrub
+++ b/main/compat-pvgrub/update-pvgrub
@@ -5,7 +5,6 @@ default=0
 timeout=5
 verbose=0
 
-conf=/boot/grub/menu.lst
 myconf=/etc/update-extlinux.conf
 
 # read in extlinux settings
@@ -13,6 +12,8 @@ if [ -f "$myconf" ]; then
 	. $myconf
 fi
 
+conf=/boot/grub/menu.lst
+
 everbose() {
 	if [ "$verbose" = "0" ]; then
 		return
-- 
2.22.0

---

From: Kevin Daudt <[email-masked]>
Date: Mon, 28 Oct 2019 20:25:21 +0100

> but anyway here is a patch to prevent it from writing to the wrong file.

Thanks, I've applied this.