Date: Fri, 27 Jan 2023 20:51:53 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 269190] [patch] bugs in stat(1) and devname(3), wrong report on disk names Message-ID: <bug-269190-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269190 Bug ID: 269190 Summary: [patch] bugs in stat(1) and devname(3), wrong report on disk names Product: Base System Version: 13.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: alexander.naumochkin@gmail.com Created attachment 239747 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D239747&action= =3Dedit patches lib/libc/gen/devname.c and usr.bin/stat/stat.c If I want to know the name of the partition a file is on I run stat(1) with= the -f "%Sd %Sr" option and it always reports #NODEV #NODEV. I checked out the stat(1) source code and found that it always calls devname(3) for dev_t with S_ISBLK mode, which is gone since FreeBSD 6.x AFAIR. Also during my investigation I figured out that devname(3) has 10 years old bug: when it tries to check that the `type' is one of S_IFCHR or S_IFBLK, it applies S_ISBLK macro to `dev' instead of `type'. patches attached --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269190-227>