Package: ipmitool
Version: 1.8.18-3
Severity: minor

Dear Maintainer,

   * What led up to the situation?

The problem surfaces when trying to start ipmitool as a regular user !=
root in a situation where the user does not have access to the ipmi0
device:

user@host:~$ ls -lad /dev/ /dev/ipmi0
drwxr-xr-x 20 root root   3140 Jun 29 21:34 /dev/
crw-------  1 root root 246, 0 Jun 29 21:34 /dev/ipmi0

ipmitool goves the following error message regardless of commands issued
(when trying to connect via local device interface. Connecting to remote
IPMI BMCs works of course).

user@host:~$ ipmitool
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such 
file or directory
user@host:~$ ipmitool shell
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such 
file or directory
user@host:~$ ipmitool -d 0
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such 
file or directory


which, regarding the situation is clearly the wrong error message.
According to an strace, ipmitool tries to open the devices in sequence:

open("/dev/ipmi0", O_RDWR)              = -1 EACCES (Permission denied)
open("/dev/ipmi/0", O_RDWR)             = -1 ENOENT (No such file or directory)
open("/dev/ipmidev/0", O_RDWR)          = -1 ENOENT (No such file or directory)
write(2, "Could not open device at /dev/ip"..., 96Could not open device at 
/dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory) = 96

Probably the last error survives and is output as if it was the reason
to fail for all device nodes.

I think this is little more than cosmetic but may cause an administrator
hunting the error to bark up the wrong tree for some time. If it is
possible in any way, I would like to see it go away.

    * What would you expect to see?

I would expect to see the textual representations of the errors for each
device, when no device can be opened. Another idea would be to only show
the ENOENT error, if no other error was encountered, and the other error
if it was. Then again, with 3 default devices, more than 2 different
errors may happen, so this might get too complex to be feasible quite
fast.

(return code correctly is 1, indicating failure)

  Tested with ipmitool 1.8.18-3 on amd64


Regards, Joel

-- System Information:
Debian Release: 9.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ipmitool depends on:
ii  libc6          2.24-11+deb9u1
ii  libfreeipmi16  1.4.11-1.1+b1
ii  libncurses5    6.0+20161126-1
ii  libreadline7   7.0-3
ii  libssl1.0.2    1.0.2l-2
ii  libtinfo5      6.0+20161126-1
ii  lsb-base       9.20161125

Versions of packages ipmitool recommends:
ii  openipmi  2.0.22-1.1

ipmitool suggests no packages.

-- no debconf information

Reply via email to