Bug 204676 - pw groupshow 0 does not work and gives unknown group
Summary: pw groupshow 0 does not work and gives unknown group
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-11-19 11:39 UTC by longwitz
Modified: 2016-12-12 07:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description longwitz 2015-11-19 11:39:30 UTC
On FreeBSD 10.2-STABLE #0 r287473 the command 'pw groupshow 0' gives 'pw: unknown group `0' instead of 'wheel:*:0:root'. The reason for this is an uninitialized variable in pw_group.c.

The following patch solves this problem for me:

--- usr/src/usr.sbin/pw/pw_group.c.orig 2015-09-05 21:22:44.000000000 +0200
+++ usr/src/usr.sbin/pw/pw_group.c      2015-11-19 12:00:04.233910000 +0100
@@ -296,6 +296,7 @@
                NULL
        };

+       name = NULL;
        if (arg1 != NULL) {
                if (arg1[strspn(arg1, "0123456789")] == '\0')
                        id = pw_checkid(arg1, GID_MAX);
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-12-10 12:49:24 UTC
A commit references this bug:

Author: bapt
Date: Sat Dec 10 12:48:49 UTC 2016
New revision: 309803
URL: https://svnweb.freebsd.org/changeset/base/309803

Log:
  Fix pkg groupshow <gid>

  PR:		204676
  Submitted by:	longwitz@incore.de
  MFC after:	2 days

Changes:
  head/usr.sbin/pw/pw_group.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-12-12 07:03:53 UTC
A commit references this bug:

Author: bapt
Date: Mon Dec 12 07:02:54 UTC 2016
New revision: 309880
URL: https://svnweb.freebsd.org/changeset/base/309880

Log:
  MFC r309803:

  Fix pw groupshow <gid>

  PR:		204676
  Submitted by:	longwitz@incore.de

Changes:
_U  stable/11/
  stable/11/usr.sbin/pw/pw_group.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-12-12 07:03:54 UTC
A commit references this bug:

Author: bapt
Date: Mon Dec 12 07:03:10 UTC 2016
New revision: 309881
URL: https://svnweb.freebsd.org/changeset/base/309881

Log:
  MFC r309803:

  Fix pw groupshow <gid>

  PR:		204676
  Submitted by:	longwitz@incore.de

Changes:
_U  stable/10/
  stable/10/usr.sbin/pw/pw_group.c