Remove groups(1)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2024-07-01 00:06:48 +02:00 committed by Serge Hallyn
parent c7981fdd00
commit 866d911655
26 changed files with 3 additions and 443 deletions

View File

@ -476,7 +476,7 @@
The package also contains the new programs:
chage, newusers, dpasswd, gpasswd, useradd, userdel, usermod,
groupadd, groupdel, groupmod, groups, pwck, grpck, lastlog, pwconv,
groupadd, groupdel, groupmod, pwck, grpck, lastlog, pwconv,
and pwunconv
Additionally, the library: libshadow.a is included for writing and/or
@ -1373,7 +1373,7 @@
users or changing the group password, the /etc/gshadow file will be
changed.
The programs groups, groupadd, groupmod, and groupdel are provided as
The programs groupadd, groupmod, and groupdel are provided as
part of the Shadow Suite to modify groups.
The format of the /etc/group file is as follows:

View File

@ -21,7 +21,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \
@ -90,7 +89,6 @@ man_XMANS = \
groupdel.8.xml \
groupmems.8.xml \
groupmod.8.xml \
groups.1.xml \
grpck.8.xml \
gshadow.5.xml \
limits.5.xml \

View File

@ -9,7 +9,6 @@ man_MANS = \
man8/groupadd.8 \
man8/groupdel.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man5/gshadow.5 \
man8/nologin.8 \

View File

@ -1,29 +0,0 @@
.TH GROUPS 1 "GNU Shell Utilities" "FSF" \" \-*\- nroff \-*\-
.do hla cs
.do hpf hyphen.cs
.SH JMÉNO
groups \- vypíše skupiny, jichž je uživatel členem
.SH POUŽITÍ
\fBgroups\fR [\fIuživatel...\fR]
.SH POPIS
Tato dokumentace není dále udržována a může být nepřesná nebo neúplná.
Autoritativním zdrojem je Texinfo dokumentace.
.PP
Tato manuálová stránka popisuje GNU verzi příkazu
.BR groups .
Příkaz
.B groups
vypíše jména všech skupin, v nichž je zadaný \fIuživatel\fR nebo aktuální proces,
pokud uživatel není zadán, členem. Pokud jsou zadána jména uživatelů, potom bude
jméno každého z uživatelů vypsáno před seznam skupin, jichž je členem.
.PP
Seznam skupin je ekvivalentní s výstupem příkazu `id \-Gn'.
.SH VOLBY
Když je GNU příkaz \fBgroups\fR vyvolán právě s jedním parametrem,
jsou rozpoznávány následující volby:
.TP
.I "\-\-help"
Vypíše návod k použití na standardní výstup a bezchybně skončí.
.TP
.I "\-\-version"
Vypíše číslo verze na standardní výstup a bezchybně skončí.

View File

@ -5,7 +5,6 @@ mandir = @mandir@/da
man_MANS = \
man1/chfn.1 \
man8/groupdel.8 \
man1/groups.1 \
man5/gshadow.5 \
man8/logoutd.8 \
man1/newgrp.1 \

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh
SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
SPDX-License-Identifier: BSD-3-Clause
-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!-- SHADOW-CONFIG-HERE -->
]>
<refentry id='groups.1'>
<!-- $Id$ -->
<refentryinfo>
<author>
<firstname>Julianne Frances</firstname>
<surname>Haugh</surname>
<contrib>Creation, 1991</contrib>
</author>
<author>
<firstname>Thomas</firstname>
<surname>Kłoczko</surname>
<email>kloczek@pld.org.pl</email>
<contrib>shadow-utils maintainer, 2000 - 2007</contrib>
</author>
<author>
<firstname>Nicolas</firstname>
<surname>François</surname>
<email>nicolas.francois@centraliens.net</email>
<contrib>shadow-utils maintainer, 2007 - now</contrib>
</author>
</refentryinfo>
<refmeta>
<refentrytitle>groups</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="sectdesc">User Commands</refmiscinfo>
<refmiscinfo class="source">shadow-utils</refmiscinfo>
<refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>groups</refname>
<refpurpose>display current group names</refpurpose>
</refnamediv>
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
<command>groups</command>
<arg choice='opt'>
<replaceable>user</replaceable>
</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
The <command>groups</command> command displays the current group names
or ID values. If the value does not have a corresponding entry in
<filename>/etc/group</filename>, the value will be displayed as the
numerical group value. The optional <replaceable>user</replaceable>
parameter will display the groups for the named user.
</para>
</refsect1>
<refsect1 id='note'>
<title>NOTE</title>
<para>
Systems which do not support supplementary groups (see <citerefentry>
<refentrytitle>initgroups</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>) will have the
information from <filename>/etc/group</filename> reported. The user
must use <command>newgrp</command> or <command>sg</command> to change
his current real and effective group ID.
</para>
</refsect1>
<refsect1 id='files'>
<title>FILES</title>
<variablelist>
<varlistentry>
<term><filename>/etc/group</filename></term>
<listitem>
<para>Group account information.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id='see_also'>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>newgrp</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>getgid</refentrytitle><manvolnum>2</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>getgroups</refentrytitle><manvolnum>2</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>getuid</refentrytitle><manvolnum>2</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>initgroups</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>.
</para>
</refsect1>
</refentry>

View File

@ -4,7 +4,6 @@ mandir = @mandir@/hu
man_MANS = \
man1/chsh.1 \
man1/gpasswd.1 \
man1/groups.1 \
man1/login.1 \
man1/newgrp.1 \
man1/passwd.1 \

View File

@ -1,35 +0,0 @@
.\" SPDX-FileCopyrightText: 1991 \- 1994, Julianne Frances Haugh
.\" SPDX-License-Identifier: BSD-3-Clause
.\"
.\" $Id$
.\"
.TH GROUPS 1
.SH NÉV
groups \- kiírja a jelenlegi csoportazonosító neveket
.SH ÁTTEKINTÉS
.B groups
.RI [ felhasználó ]
.SH LEÍRÁS
A
.B groups
parancs kiírja a jelenlegi csoportazonosító neveket vagy számértékeket. Ha
nincs az értéknek megfelelő bejegyzés a \fI/etc/group\fR fájlban, akkor a
csoport azonosító számát írja ki. Az opcionális \fIfelhasználó\fR paraméter
esetén azokat a csoportokat írja ki, amelyekbe a megadott \fIfelhasználó\fR
tartozik.
.SH MEGJEGYZÉS
Azok a rendszerek, amelyek nem támogatják a konkurrens csoportbeállításokat,
a kiírt információkat a \fI/etc/group\fR fájlból gyűjtik. A felhasználónak
muszáj a \fBnewgrp\fR vagy a \fBsg\fR parancsot használniuk, hogy
megváltoztassák a jelenlegi valódi és effektív csoportazonosítójukat.
.SH FÁJLOK
\fI/etc/group\fR \- információ a csoportokról
.SH LÁSD MÉG
.BR newgrp (1),
.BR getgid (2),
.BR getgroups (2),
.BR getuid (2)
.SH AUTHOR
Julianne Frances Haugh (jfh@tab.com)
.SH MAGYAR FORDÍTÁS
ifj. Dyekiss Emil <emil2@cds.hu>

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -13,7 +13,6 @@ man_MANS = \
man8/groupadd.8 \
man8/groupdel.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -1,39 +0,0 @@
.\" SPDX-FileCopyrightText: 1991 - 1994 Julianne Frances Haugh
.\" SPDX-FileCopyrightText: Copyright (c) 2001 Maki KURODA
.\" SPDX-License-Identifier: BSD-3-Clause
.\" Translated Tue Oct 30 11:58:18 JST 2001 by Maki KURODA <mkuroda@aisys\-jp.com>
.\" Modified Tue 16 Sep 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.\" $Id$
.\"
.\"WORD: concurrent group set 同時所属グループ集合
.\"WORD: real group ID 実グループ ID
.\"WORD: effective group ID 実効グループ ID
.\"
.TH GROUPS 1
.SH 名前
groups \- 現在のグループ名の表示
.SH 書式
\fBgroups\fR [\fIuser\fR]
.SH 説明
.B groups
は現在のグループの名前または ID 値を表示する。
ID 値に対応する名前が \fI/etc/group\fR に登録されていなければ、
数値のグループ ID で表示される。
パラメータとして \fIuser\fR を与えると、
指定した \fIuser\fR が所属するグループ名を表示する。
.SH 注意
同時所属グループ集合 (concurrent group set)
をサポートしていないシステムでは、
\fI/etc/group\fR の情報が報告される。
ユーザが現在の実グループ ID や実効グループ ID を変更するには、
\fBnewgrp\fR\fBsg\fR を使用しなければならない。
.SH ファイル
/etc/group \- グループ情報
.SH 関連項目
.BR newgrp (1),
.BR getuid (2),
.BR getgid (2),
.BR getgroups (2)
.SH 著者
Julianne Frances Haugh <julie78787@gmail.com>

View File

@ -4,7 +4,6 @@ mandir = @mandir@/ko
man_MANS = \
man1/chfn.1 \
man1/chsh.1 \
man1/groups.1 \
man1/login.1 \
man5/passwd.5 \
man1/su.1 \

View File

@ -1,32 +0,0 @@
.\"$Id$
.TH GROUPS 1L "GNU 쉘 유틸리티" "FSF" \" \-*\- nroff \-*\-
.SH 이름
groups \- 사용자가 속한 그룹들을 출력한다
.SH 개요
.B groups
[사용자명...]
.br
.B groups
{\-\-help,\-\-version}
.SH 설명
이 맨페이지는 GNU 버전의
.BR groups
를 다룬다.
.B groups
는 주어진 각
.IR username
또는 프로세스
가 속한 추가 그룹의 이름을 출력해준다.
만약 사용자명이 주어졌다면 각 사용자명이 소속된 그룹 목록 앞에 표시된다.
.PP
그룹 목록은 `id \-Gn'의 결과와 같다.
.SS 옵션
GNU
.B groups
가 단 한 개의 인수를 가지고 실행되면 다음 옵션들을 인식한다:
.TP
.I "\-\-help"
표준출력으로 사용법을 출력하고 정상적으로 종료한다.
.TP
.I "\-\-version"
표준출력으로 버전정보를 출력하고 정상적으로 종료한다.

View File

@ -326,7 +326,6 @@
<para>MAX_MEMBERS_PER_GROUP</para>
</listitem>
</varlistentry>
<!-- groups: no variables -->
<varlistentry>
<term>grpck</term>
<listitem>

View File

@ -13,7 +13,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/logoutd.8 \
man1/newgrp.1 \

View File

@ -13,7 +13,6 @@ XMLFILES = \
$(top_srcdir)/man/groupdel.8.xml \
$(top_srcdir)/man/groupmems.8.xml \
$(top_srcdir)/man/groupmod.8.xml \
$(top_srcdir)/man/groups.1.xml \
$(top_srcdir)/man/grpck.8.xml \
$(top_srcdir)/man/gshadow.5.xml \
$(top_srcdir)/man/lastlog.8.xml \

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -12,7 +12,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man5/gshadow.5 \
man8/logoutd.8 \

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -16,7 +16,6 @@ man_MANS = \
man8/groupdel.8 \
man8/groupmems.8 \
man8/groupmod.8 \
man1/groups.1 \
man8/grpck.8 \
man8/grpconv.8 \
man8/grpunconv.8 \

View File

@ -90,7 +90,6 @@ src/groupadd.c
src/groupdel.c
src/groupmems.c
src/groupmod.c
src/groups.c
src/grpck.c
src/grpconv.c
src/grpunconv.c

1
src/.gitignore vendored
View File

@ -10,7 +10,6 @@
/groupdel
/groupmems
/groupmod
/groups
/grpck
/grpconv
/grpunconv

View File

@ -26,7 +26,7 @@ AM_CFLAGS = $(LIBBSD_CFLAGS)
# and installation would be much simpler (just two directories,
# $prefix/bin and $prefix/sbin, no install-data hacks...)
bin_PROGRAMS = groups login
bin_PROGRAMS = login
sbin_PROGRAMS = nologin
ubin_PROGRAMS = faillog chage chfn chsh expiry gpasswd newgrp passwd
if ENABLE_SUBIDS

View File

@ -1,178 +0,0 @@
/*
* SPDX-FileCopyrightText: 1991 - 1993, Julianne Frances Haugh
* SPDX-FileCopyrightText: 1996 - 2000, Marek Michałkiewicz
* SPDX-FileCopyrightText: 2001 - 2006, Tomasz Kłoczko
* SPDX-FileCopyrightText: 2007 - 2008, Nicolas François
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <config.h>
#ident "$Id$"
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include "alloc/x/xmalloc.h"
#include "defines.h"
#include "prototypes.h"
#include "shadowlog.h"
/*
* Global variables
*/
static const char Prog[] = "groups";
/* local function prototypes */
static void print_groups (const char *member);
/*
* print_groups - print the groups which the named user is a member of
*
* print_groups() scans the groups file for the list of groups which
* the user is listed as being a member of.
*/
static void print_groups (const char *member)
{
int groups = 0;
struct group *grp;
struct passwd *pwd;
bool flag = false;
pwd = getpwnam (member); /* local, no need for xgetpwnam */
if (NULL == pwd) {
(void) fprintf (stderr, _("%s: unknown user %s\n"),
Prog, member);
exit (EXIT_FAILURE);
}
setgrent ();
while ((grp = getgrent ()) != NULL) {
if (is_on_list (grp->gr_mem, member)) {
if (0 != groups) {
(void) putchar (' ');
}
groups++;
(void) printf ("%s", grp->gr_name);
if (grp->gr_gid == pwd->pw_gid) {
flag = true;
}
}
}
endgrent ();
/* The user may not be in the list of members of its primary group */
if (!flag) {
grp = getgrgid (pwd->pw_gid); /* local, no need for xgetgrgid */
if (NULL != grp) {
if (0 != groups) {
(void) putchar (' ');
}
groups++;
(void) printf ("%s", grp->gr_name);
}
}
if (0 != groups) {
(void) putchar ('\n');
}
}
/*
* groups - print out the groups a process is a member of
*/
int main (int argc, char **argv)
{
long sys_ngroups;
GETGROUPS_T *groups;
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
groups = XMALLOC(sys_ngroups, GETGROUPS_T);
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
log_set_progname(Prog);
log_set_logfd(stderr);
if (argc == 1) {
/*
* Called with no arguments - give the group set for the
* current user.
*/
int i;
int pri_grp; /* TODO: should be GETGROUPS_T */
/*
* This system supports concurrent group sets, so I can ask
* the system to tell me which groups are currently set for
* this process.
*/
int ngroups = getgroups (sys_ngroups, groups);
if (ngroups < 0) {
perror ("getgroups");
exit (EXIT_FAILURE);
}
/*
* The groupset includes the primary group as well.
*/
pri_grp = getegid ();
for (i = 0; i < ngroups; i++) {
if (pri_grp == (int) groups[i]) {
break;
}
}
if (i != ngroups) {
pri_grp = -1;
}
/*
* Print out the name of every group in the current group
* set. Unknown groups are printed as their decimal group ID
* values.
*/
if (-1 != pri_grp) {
struct group *gr;
/* local, no need for xgetgrgid */
gr = getgrgid (pri_grp);
if (NULL != gr) {
(void) printf ("%s", gr->gr_name);
} else {
(void) printf ("%d", pri_grp);
}
}
for (i = 0; i < ngroups; i++) {
struct group *gr;
if ((0 != i) || (-1 != pri_grp)) {
(void) putchar (' ');
}
/* local, no need for xgetgrgid */
gr = getgrgid (groups[i]);
if (NULL != gr) {
(void) printf ("%s", gr->gr_name);
} else {
(void) printf ("%ld", (long) groups[i]);
}
}
(void) putchar ('\n');
} else {
/*
* The invoker wanted to know about some other user. Use
* that name to look up the groups instead.
*/
print_groups (argv[1]);
}
return EXIT_SUCCESS;
}