namei -l incorrect error message

Bug #1818548 reported by Seth Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello, namei -l gives incorrect error messages if a directory is not readable:

$ namei -l /etc/ssl/private/ssl-cert-snakeoil.key
f: /etc/ssl/private/ssl-cert-snakeoil.key
drwxr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x root root ssl
drwx--x--- root ssl-cert private
                         ssl-cert-snakeoil.key - No such file or directory
$ cat /etc/ssl/private/ssl-cert-snakeoil.key
cat: /etc/ssl/private/ssl-cert-snakeoil.key: Permission denied
$ ls -l /etc/ssl/private/
ls: cannot open directory '/etc/ssl/private/': Permission denied

"No such file or directory" is a poor error message for this case. The correct error message (as shown by cat) is "Permission denied".

Incorrect error messages make this tool much less useful.

Thanks

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: util-linux 2.31.1-0.4ubuntu3.3
ProcVersionSignature: Ubuntu 4.15.0-45.48-generic 4.15.18
Uname: Linux 4.15.0-45-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
Date: Mon Mar 4 09:00:12 2019
InstallationDate: Installed on 2012-10-18 (2328 days ago)
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120823.1)
ProcEnviron:
 TERM=rxvt-unicode-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: util-linux
UpgradeStatus: Upgraded to bionic on 2018-05-02 (306 days ago)

Revision history for this message
Seth Arnold (seth-arnold) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Yay, this appears to have been fixed in focal:

$ namei -l /etc/ssl/private/ssl-cert-snakeoil.key
f: /etc/ssl/private/ssl-cert-snakeoil.key
drwxr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x root root ssl
drwx--x--- root ssl-cert private
                         ssl-cert-snakeoil.key - Permission denied

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.