#729414 grub-pc: bug report script assumes "su" doesn't support "sudo"

Package:
grub-pc
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (PC/BIOS version)
Submitter:
"Jamin W. Collins"
Date:
2013-11-13 20:06:15 UTC
Severity:
normal
#729414#5
Date:
2013-11-12 17:12:33 UTC
From:
To:
The bug report script "/usr/share/bug/grub-pc/script" assumes that the route to
root access is via "su".  This is not the case on all systems, especially since
the current installer offers a direct means of locking the root account and
enabling "sudo" for the first configured user.

cat <<EOF
Information on any LVM volumes on this system is valuable to the GRUB
developers, but gathering this information requires the root password.
EOF
yesno "Do you want to provide LVM volume information?" nop
if [ "$REPLY" = yep ]; then
  echo >&3
  echo "*********************** BEGIN LVM" >&3
  su root -c "vgdisplay; pvdisplay; lvdisplay" >&3
  echo "*********************** END LVM" >&3
fi

#729414#10
Date:
2013-11-13 01:42:32 UTC
From:
To:
Yes.  Are you aware of anything in the base system that abstracts over
this in any useful way?  Trying various different methods is going to
get nasty very quickly, especially since you generally have to actually
try authenticating before you find out you can't ...

I wonder whether this really needs some kind of support in reportbug to
fix properly.

#729414#15
Date:
2013-11-13 19:46:40 UTC
From:
To:
I can't say that I'm aware of any such abstraction.

Sounds like the right place for any abstraction that would be generally
needed by various packages.