Bug 188213 - gpart(8): gpart device designator handling is inconsistant
Summary: gpart(8): gpart device designator handling is inconsistant
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL: https://reviews.freebsd.org/D27556
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 04:30 UTC by Ronald F. Guilmette
Modified: 2021-01-11 21:15 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald F. Guilmette 2014-04-03 04:30:00 UTC
The "list" and "show" sub-commands of the gpart(8) program behave quite
differently and inconsistantly, depending on the exact form/format of the
designator used for the device/geom of interest.  Specifically:

	gpart show ada0		-- works just fine
	gpart show /dev/ada0	-- works just fine
	gpart list ada0		-- works just fine
	gpart list /dev/ada0	-- produces error "No such geom"

It would be better if the "list" and "show" sub-commands of the
gpart(8) program behaved consistantly with one another.  Either they
should both reject device designators that include a leading "/dev/"
or else they should both accept this form.

Fix: 

Sorry, I do not have code to fix this.  I am just reporting the bug.
How-To-Repeat: 
See above.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:25 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 commit-hook freebsd_committer 2020-12-12 07:22:55 UTC
A commit references this bug:

Author: rew
Date: Sat Dec 12 07:22:38 UTC 2020
New revision: 368576
URL: https://svnweb.freebsd.org/changeset/base/368576

Log:
  geom(8): list geoms with /dev/ prefix

  Allow geom(8) to list geoms with the '/dev/' prefix.

  `geom part show` accepts the '/dev/' prefix but `geom part list` does not.

  Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior
  of find_geom() in lib/geom/part/geom_part.c.

  PR:             188213
  Reported by:    Ronald F. Guilmette <rfg@tristatelogic.com>
  Reviewed by:    imp, kevans
  Approved by:    kevans (mentor)
  MFC after:      1 week
  Differential Revision:  https://reviews.freebsd.org/D27556

Changes:
  head/sbin/geom/core/geom.c
Comment 3 commit-hook freebsd_committer 2021-01-11 21:15:18 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a09fd56501c2508c9d2797302544d55112d767f

commit 0a09fd56501c2508c9d2797302544d55112d767f
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2020-12-12 07:22:38 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2021-01-11 20:54:22 +0000

    geom(8): list geoms with /dev/ prefix

    Allow geom(8) to list geoms with the '/dev/' prefix.

    `geom part show` accepts the '/dev/' prefix but `geom part list` does not.

    Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior
    of find_geom() in lib/geom/part/geom_part.c.

    PR:             188213
    Reported by:    Ronald F. Guilmette <rfg@tristatelogic.com>
    Reviewed by:    imp, kevans
    Approved by:    kevans (mentor)
    Differential Revision:  https://reviews.freebsd.org/D27556

    (cherry picked from commit f200cc255f8e90b1905d94d0506a22f5dcd467c0)

 sbin/geom/core/geom.c | 4 ++++
 1 file changed, 4 insertions(+)