bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #42409] grub-probe produces misleading errors and wrong info if use


From: Alain Kalker
Subject: [bug #42409] grub-probe produces misleading errors and wrong info if user doesn't have permission to access drive
Date: Fri, 23 May 2014 15:08:14 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?42409>

                 Summary: grub-probe produces misleading errors and wrong info
if user doesn't have permission to access drive
                 Project: GNU GRUB
            Submitted by: ackalker
            Submitted on: Fri 23 May 2014 03:08:13 PM GMT
                Category: Disk &amp; Partition
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: other
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

System details:
OS: Arch Linux x86_64
Grub: 2.02.beta2 installed on a GPT disk with protective MBR
Boot: using BIOS
GPT partition /dev//boot: 

Using grub-probe on this setup works fine when running it with sudo:

$ sudo grub-probe --target=partmap /
gpt 
$ sudo grub-probe --target=drive /
(hostdisk//dev/sda,gpt1)

However, running grub-probe as a user without read access to /dev/sda*,
produces misleading errors, and ultimately gives incorrect information:

$ grub-probe --target=partmap /
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
grub-probe: error: disk `hostdisk//dev/sda1' not found.
$ grub-probe --target=drive /
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device
/dev/sda1.
(hostdisk//dev/sda1)

Running the above commands under strace (filtering on open, stat, execve
events, see attached files) shows that grub-probe running as unprivileged user
encounters permission errors (EACCES) but doesn't report these to the user.

The errors which grub-probe does report are misleading: the disk does exist,
but the current user simply has no permission to access it.
Also the final info is incorrect, as it doesn't identify the partition as
being a GPT partition.

Both these issues can lead users trying to diagnose problems to look in the
wrong place, or worse, apply the wrong fixes.
Note that in some environments such as SELinux, even running grub-probe under
sudo, one might not have permission to access some devices!

>From reading several reports on the net about grub-probe reporting "warning:
disk does not exist", I think that grub-probe not reporting permssion problems
may lie at the heart of at least some of these reports.

Please consider fixing grub-probe to report permission errors directly to the
user.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 23 May 2014 03:08:13 PM GMT  Name:
strace-grub-probe-target-partmap-verbose.log  Size: 15kB   By: ackalker

<http://savannah.gnu.org/bugs/download.php?file_id=31424>
-------------------------------------------------------
Date: Fri 23 May 2014 03:08:13 PM GMT  Name:
strace-grub-probe-target-drive-verbose.log  Size: 15kB   By: ackalker

<http://savannah.gnu.org/bugs/download.php?file_id=31425>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42409>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]