From: Alejandro Colomar Date: Wed, 29 May 2024 12:41:45 +0000 (+0200) Subject: Remove id(1) X-Git-Tag: 4.17.0-rc1~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7981fdd007a6467e65242a4377607c8633c8693;p=thirdparty%2Fshadow.git Remove id(1) Distributions use id(1) from GNU coreutils or BusyBox. Drop ours. Closes: Suggested-by: dkwo Cc: "Serge E. Hallyn" Cc: Iker Pedrosa Cc: Michael Vetter Cc: Sam James Signed-off-by: Alejandro Colomar --- diff --git a/doc/HOWTO b/doc/HOWTO index 03a5f1ae9..cc8ea7804 100644 --- a/doc/HOWTO +++ b/doc/HOWTO @@ -471,7 +471,7 @@ The Shadow Suite contains replacement programs for: - su, login, passwd, newgrp, chfn, chsh, and id + su, login, passwd, newgrp, chfn, chsh The package also contains the new programs: @@ -586,8 +586,6 @@ · /usr/bin/chsh - · /usr/bin/id - The BETA package has a save target in the Makefile, but it's commented out because different distributions place the programs in different places. @@ -637,8 +635,6 @@ · /usr/man/man1/chsh.1.gz - · /usr/man/man1/id.1.gz - · /usr/man/man1/login.1.gz · /usr/man/man1/passwd.1.gz diff --git a/man/Makefile.am b/man/Makefile.am index 83b1d6882..9f5e28ed7 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -200,8 +200,6 @@ EXTRA_DIST = \ $(man_XMANS) \ config.xml \ $(addprefix login.defs.d/,$(login_defs_v)) \ - man1/id.1 \ - id.1.xml \ man8/sulogin.8 \ sulogin.8.xml \ generate_mans.mak \ @@ -227,7 +225,7 @@ if ENABLE_REGENERATE_MAN include generate_mans.mak -CLEANFILES = $(man_MANS) man1/id.1 man8/sulogin.8 +CLEANFILES = $(man_MANS) man8/sulogin.8 else $(man_MANS): diff --git a/man/cs/Makefile.am b/man/cs/Makefile.am index 84407d71d..4ebd7778e 100644 --- a/man/cs/Makefile.am +++ b/man/cs/Makefile.am @@ -23,7 +23,6 @@ man_MANS += man8/lastlog.8 endif EXTRA_DIST = $(man_MANS) \ - man1/id.1 \ man8/groupmems.8 \ man8/logoutd.8 diff --git a/man/cs/man1/id.1 b/man/cs/man1/id.1 deleted file mode 100644 index 9eafaf1f8..000000000 --- a/man/cs/man1/id.1 +++ /dev/null @@ -1,62 +0,0 @@ -.TH ID 1 "GNU Shell Utilities" "FSF" \" \-*\- nroff \-*\- -.do hla cs -.do hpf hyphen.cs -.SH JMÉNO -id \- vypíše reálný a efektivní UID a GID -.SH POUŽITÍ -.B id -[\-gnruG] [\-\-group] [\-\-name] [\-\-real] [\-\-user] [\-\-groups] -[\-\-help] [\-\-version] [uživatel] -.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 id . -Příkaz -.B id -vypíše informace o zadaném uživateli nebo (pokud není jméno uživatele -zadáno) o uživateli, který program -.B id -spustil. Implicitně vypisuje reálné user ID, reálné group ID, -efektivní user ID, pokud se liší od reálného user ID, efektivní -group ID, pokud se liší od reálného group ID, a group ID skupin, -v nichž je uživatel členem. Před každou z hodnot je vypsán řetězec -určující o jakou hodnotu se jedná a za každou jsou odpovídající -jména skupin a uživatelů v závorkách. -.PP -Volby způsobí, že program -.B id -vypisuje pouze některé z těchto informací. -.SS VOLBY -.TP -.I "\-g, \-\-group" -Vypíše pouze group ID. -.TP -.I "\-G, \-\-groups" -Vypíše pouze skupiny, v nichž je uživatel členem. -.TP -.I "\-\-help" -Vypíše návod k použití na standardní výstup a bezchybně skončí. -.TP -.I "\-n, \-\-name" -Vypíše jméno uživatele nebo skupiny místo čísla ID. -Vyžaduje -.IR \-u , -.IR \-g , -nebo -.IR \-G . -.TP -.I "\-r, \-\-real" -Vypíše reálné místo efektivních user a group ID. -Vyžaduje -.IR \-u , -.IR \-g , -nebo -.IR \-G . -.TP -.I "\-u, \-\-user" -Vypíše pouze user ID. -.TP -.I "\-\-version" -Vypíše číslo verze na standardní výstup a bezchybně skončí. diff --git a/man/da/Makefile.am b/man/da/Makefile.am index a3b09224e..162b921ed 100644 --- a/man/da/Makefile.am +++ b/man/da/Makefile.am @@ -21,8 +21,7 @@ man_MANS += $(man_nopam) endif EXTRA_DIST = \ - $(man_MANS) \ - man1/id.1 + $(man_MANS) if USE_PAM EXTRA_DIST += $(man_nopam) diff --git a/man/de/Makefile.am b/man/de/Makefile.am index 671432d39..b28e1c87c 100644 --- a/man/de/Makefile.am +++ b/man/de/Makefile.am @@ -58,7 +58,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/man/fr/Makefile.am b/man/fr/Makefile.am index 335e02982..c675070f3 100644 --- a/man/fr/Makefile.am +++ b/man/fr/Makefile.am @@ -68,7 +68,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/man/hu/man1/id.1 b/man/hu/man1/id.1 deleted file mode 100644 index cae75b796..000000000 --- a/man/hu/man1/id.1 +++ /dev/null @@ -1,63 +0,0 @@ -.TH ID 1 "GNU Shell Utilities" "FSF" \" \-*\- nroff \-*\- -.SH NÉV -id \- kiírja a valóságos és effektív UID\-eket és GID\-eket -.SH ÁTTEKINTÉS -.B id -[\-gnruG] [\-\-group] [\-\-name] [\-\-real] [\-\-user] [\-\-groups] -[\-\-help] [\-\-version] [username] -.SH LEÍRÁS -Ezt a dokumentációt a továbbiakban nem tartjuk karban, így -pontatlan vagy hiányos lehet. A Texinfo dokumentáció a hiteles forrás. -.PP -Ez a kézikönyv lap az -.BR id -GNU változatát írja le. Az -.B id -információt szolgáltat az adott felhasználóról, vagy arról aki a -programot futtatja, ha felhasználó nincs megadva. -Alapértelmezésben a valódi felhasználói ID\-t írja ki, -a valódi csoport ID\-t, az effektív felhasználói ID\-t, ha az különbözik a -valódi felhasználói ID\-től, az effektív csoport ID\-t, ha az különbözik a -valódi csoport ID\-től, és a kiegészítő csoportok ID\-it. -A parancs ezeket a paramétereket egy sorban, egymás után -irja ki, zárójelben megadva a felhasználó, illetve a csoport nevét. -.PP -Az alábbi opciókkal az -.B id -képes a fenti információk egy részének a megjelenítésére is. -.SS OPCIÓK -.TP -.I "\-g, \-\-group" -Csak a csoport ID\-jét írja ki. -.TP -.I "\-G, \-\-groups" -Csak a kiegészítő csoportok ID\-it írja ki. -.TP -.I "\-\-help" -Használati útmutatót ír a standard kimenetre és kilép. -.TP -.I "\-n, \-\-name" -A nevet jeleníti meg az ID helyet. -Szükséges az -.IR \-u , -.IR \-g , -vagy -.IR \-G -paraméter. -.TP -.I "\-r, \-\-real" -A valódi felhasználói vagy csoport ID\-t jeleníti meg az effektív helyett. -Szükséges -.IR \-u , -.IR \-g , -vagy -.IR \-G -paraméter. -.TP -.I "\-u, \-\-user" -Csak a felhasználó ID\-jét jeleníti meg. -.TP -.I "\-\-version" -A program verziójáról ír ki információt a standard kimenetre és kilép. -.SH MAGYAR FORDÍTÁS -Ámon Tamás diff --git a/man/id.1.xml b/man/id.1.xml deleted file mode 100644 index 9d77330fb..000000000 --- a/man/id.1.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - -]> - - - - - Julianne Frances - Haugh - Creation, 1991 - - - Thomas - Kłoczko - kloczek@pld.org.pl - shadow-utils maintainer, 2000 - 2007 - - - Nicolas - François - nicolas.francois@centraliens.net - shadow-utils maintainer, 2007 - now - - - - id - 1 - User Commands - shadow-utils - &SHADOW_UTILS_VERSION; - - - id - display current user and group ID names - - - - - id -a - - - - - DESCRIPTION - - The id command displays the current real and - effective user and group ID names or values. If the value does not - have a corresponding entry in /etc/passwd or - /etc/group, the value will be displayed without - the corresponding name. The optional flag will - display the group set on systems which support supplementary groups - (see initgroups - 3). - - - - - FILES - - - /etc/group - - Group account information. - - - - /etc/passwd - - User account information. - - - - - - - SEE ALSO - - - getgid2 - , - - getgroups2 - , - - getuid2 - , - - initgroups3 - - - - diff --git a/man/it/Makefile.am b/man/it/Makefile.am index b76187faf..e2aef4c99 100644 --- a/man/it/Makefile.am +++ b/man/it/Makefile.am @@ -58,7 +58,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/man/ja/Makefile.am b/man/ja/Makefile.am index 13f18da16..47bbe68f9 100644 --- a/man/ja/Makefile.am +++ b/man/ja/Makefile.am @@ -52,7 +52,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man3/shadow.3 \ man8/sulogin.8 diff --git a/man/ja/man1/id.1 b/man/ja/man1/id.1 deleted file mode 100644 index 3f15aa2b7..000000000 --- a/man/ja/man1/id.1 +++ /dev/null @@ -1,33 +0,0 @@ -.\" SPDX-FileCopyrightText: 1991 Julianne Frances Haugh -.\" SPDX-FileCopyrightText: Copyright (c) 2000 ISHIKAWA Keisuke -.\" SPDX-License-Identifier: BSD-3-Clause -.\" -.\" Translated Thu Nov 9 23:17:10 JST 2000 -.\" by ISHIKAWA Keisuke -.\" Modified Tue 16 Sep 2002 by NAKANO Takeo -.\" -.\" $Id$ -.\" -.TH ID 1 -.SH 名前 -id \- 現在のユーザ ID 名とグループ ID 名を表示する -.SH 書式 -\fBid\fR [\fB\-a\fR] -.SH 説明 -\fBid\fRは、現在の実ユーザ ID、実効ユーザ ID、実グループ ID、 -実効グループ ID の名前または値を表示する。 -値に対応するエントリが \fI/etc/passwd\fR や -\fI/etc/group\fR に存在しない場合は、 -対応する名前は表示されずに値だけが表示される。 -ユーザが同時に複数のグループのメンバーになれるシステムでは、 -\fB\-a\fR オプションを指定するとグループの集合が表示される。 -.SH ファイル -\fI/etc/passwd\fR \- ユーザーアカウント情報 -.br -\fI/etc/group\fR \ \- グループ情報 -.SH 関連項目 -.BR getgid (2), -.BR getgroups (2), -.BR getuid (2) -.SH 著者 -Julianne Frances Haugh diff --git a/man/ko/man1/id.1 b/man/ko/man1/id.1 deleted file mode 100644 index a48aa2661..000000000 --- a/man/ko/man1/id.1 +++ /dev/null @@ -1,52 +0,0 @@ -.TH ID 1L "GNU 쉘 유틸리티" "FSF" \" \-*\- nroff \-*\- -.SH 이름 -id \- 실제, 유효 UID와 GID를 출력한다. -.SH 개요 -.B id -[\-gnruG] [\-\-group] [\-\-name] [\-\-real] [\-\-user] [\-\-groups] -[\-\-help] [\-\-version] [username] -.SH 설명 -이 맨페이지는 GNU 버전의 -.BR id -를 다룬다. -.B id -는 주어진 사용자, 또는 사용자가 주어지지 않는 경우 프로세스의 주인에 대한 -정보를 출력한다. 기본적으로 실제 사용자 ID, 실제 그룹 ID, 만약 실제 사용자 -ID와 다르다면 유효 사용자 ID를, 마찬가지로 실제 그룹 ID와 다르다면 유효 그룹 -ID를 출력하고 추가 그룹 ID를 출력한다. 각 항목은 식별 문자 그리고 괄호 안에 -해당하는 사용자 또는 그룹명으로 표현된다. -.PP -.B id -에 옵션을 주면 위에서 열거한 정보의 일부만 보여준다. -.SS 옵션 -.TP -.I "\-g, \-\-group" -오로지 그룹 ID만 출력한다. -.TP -.I "\-G, \-\-groups" -추가 그룹만 출력한다. -.TP -.I "\-\-help" -표준출력으로 사용법을 출력하고 정상적으로 종료한다. -.TP -.I "\-n, \-\-name" -ID 번호 대신 사용자명, 그룹명을 출력한다. -.IR \-u , -.IR \-g , -또는 -.IR \-G -를 필요로 한다. -.TP -.I "\-r, \-\-real" -유효 사용자, 유효 그룹 ID가 아니라 실제 ID 를 출력한다. -.IR \-u , -.IR \-g , -또는 -.IR \-G -를 필요로 한다. -.TP -.I "\-u, \-\-user" -오로지 사용자 ID 만 출력한다. -.TP -.I "\-\-version" -표준출력으로 버전정보를 출력하고 정상적으로 종료한다. diff --git a/man/pl/Makefile.am b/man/pl/Makefile.am index b2f096f7e..0fdcc3709 100644 --- a/man/pl/Makefile.am +++ b/man/pl/Makefile.am @@ -36,8 +36,7 @@ man_MANS += $(man_nopam) endif EXTRA_DIST = \ - $(man_MANS) \ - man1/id.1 + $(man_MANS) if USE_PAM EXTRA_DIST += $(man_nopam) diff --git a/man/ru/Makefile.am b/man/ru/Makefile.am index 84d55d9ec..bceae79c3 100644 --- a/man/ru/Makefile.am +++ b/man/ru/Makefile.am @@ -58,7 +58,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/man/sv/Makefile.am b/man/sv/Makefile.am index 70329edf3..ba9ef3eca 100644 --- a/man/sv/Makefile.am +++ b/man/sv/Makefile.am @@ -41,8 +41,7 @@ man_MANS += $(man_nopam) endif EXTRA_DIST = \ - $(man_MANS) \ - man1/id.1 + $(man_MANS) if USE_PAM EXTRA_DIST += $(man_nopam) diff --git a/man/uk/Makefile.am b/man/uk/Makefile.am index 3fb5ffb3d..d34be0692 100644 --- a/man/uk/Makefile.am +++ b/man/uk/Makefile.am @@ -57,7 +57,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/man/zh_CN/Makefile.am b/man/zh_CN/Makefile.am index a8b93a568..b9a205d17 100644 --- a/man/zh_CN/Makefile.am +++ b/man/zh_CN/Makefile.am @@ -58,7 +58,6 @@ endif EXTRA_DIST = \ $(man_MANS) \ - man1/id.1 \ man8/sulogin.8 if USE_PAM diff --git a/po/POTFILES.in b/po/POTFILES.in index 78eb26407..b3513c7cc 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -94,7 +94,6 @@ src/groups.c src/grpck.c src/grpconv.c src/grpunconv.c -src/id.c src/lastlog.c src/login.c src/login_nopam.c diff --git a/src/.gitignore b/src/.gitignore index 5fffda779..a0ee0ef6f 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -14,7 +14,6 @@ /grpck /grpconv /grpunconv -/id /lastlog /login /logoutd diff --git a/src/Makefile.am b/src/Makefile.am index b6cb09ef1..c1268777b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,8 +58,8 @@ usbin_PROGRAMS = \ usermod \ vipw -# id and groups are from gnu, sulogin from sysvinit -noinst_PROGRAMS = id sulogin +# sulogin from sysvinit +noinst_PROGRAMS = sulogin suidusbins = suidbins = diff --git a/src/id.c b/src/id.c deleted file mode 100644 index 247af6d99..000000000 --- a/src/id.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * SPDX-FileCopyrightText: 1991 - 1994, 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 - */ - -/* - * id - print current process user identification information - * - * Print the current process identifiers. This includes the - * UID, GID, effective-UID and effective-GID. Optionally print - * the concurrent group set if the current system supports it. - */ - -#include - -#ident "$Id$" - -#include -#include -#include -#include - -#include "alloc/malloc.h" -#include "defines.h" - -/* local function prototypes */ -static void usage (void); - -static void usage (void) -{ - (void) fputs (_("Usage: id [-a]\n"), stderr); - exit (EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - uid_t ruid, euid; - gid_t rgid, egid; - long sys_ngroups; - -/* - * This block of declarations is particularly strained because of several - * different ways of doing concurrent groups. Old BSD systems used int for - * gid's, but short for the type passed to getgroups(). Newer systems use - * gid_t for everything. Some systems have a small and fixed NGROUPS, - * usually about 16 or 32. Others use bigger values. - */ - GETGROUPS_T *groups; - int ngroups; - bool aflg = 0; - struct passwd *pw; - struct group *gr; - - (void) setlocale (LC_ALL, ""); - (void) bindtextdomain (PACKAGE, LOCALEDIR); - (void) textdomain (PACKAGE); - - /* - * Dynamically get the maximum number of groups from system, instead - * of using the symbolic constant NGROUPS_MAX. This ensures that the - * group limit is not hard coded into the binary, so it will still - * work if the system library is recompiled. - */ - sys_ngroups = sysconf (_SC_NGROUPS_MAX); - groups = MALLOC(sys_ngroups, GETGROUPS_T); - - /* - * See if the -a flag has been given to print out the concurrent - * group set. - */ - - if (argc > 1) { - if (argc > 2 || strcmp(argv[1], "-a") != 0) - usage(); - else - aflg = true; - } - - ruid = getuid (); - euid = geteuid (); - rgid = getgid (); - egid = getegid (); - - /* - * Print out the real user ID and group ID. If the user or group - * does not exist, just give the numerical value. - */ - - pw = getpwuid (ruid); /* local, no need for xgetpwuid */ - if (NULL != pw) { - (void) printf ("UID=%lu(%s)", - (unsigned long) ruid, pw->pw_name); - } else { - (void) printf ("UID=%lu", (unsigned long) ruid); - } - - gr = getgrgid (rgid);; /* local, no need for xgetgrgid */ - if (NULL != gr) { - (void) printf (" GID=%lu(%s)", - (unsigned long) rgid, gr->gr_name); - } else { - (void) printf (" GID=%lu", (unsigned long) rgid); - } - - /* - * Print out the effective user ID and group ID if they are - * different from the real values. - */ - - if (ruid != euid) { - pw = getpwuid (euid); /* local, no need for xgetpwuid */ - if (NULL != pw) { - (void) printf (" EUID=%lu(%s)", - (unsigned long) euid, pw->pw_name); - } else { - (void) printf (" EUID=%lu", (unsigned long) euid); - } - } - if (rgid != egid) { - gr = getgrgid (egid); /* local, no need for xgetgrgid */ - if (NULL != gr) { - (void) printf (" EGID=%lu(%s)", - (unsigned long) egid, gr->gr_name); - } else { - (void) printf (" EGID=%lu", (unsigned long) egid); - } - } - - /* - * Print out the concurrent group set if the user has requested it. - * The group numbers will be printed followed by their names. - */ - if (aflg && (ngroups = getgroups (sys_ngroups, groups)) != -1) { - int i; - - /* - * Start off the group message. It will be of the format - * - * groups=###(aaa),###(aaa),###(aaa) - * - * where "###" is a numerical value and "aaa" is the - * corresponding name for each respective numerical value. - */ - (void) puts (_(" groups=")); - for (i = 0; i < ngroups; i++) { - if (0 != i) - (void) putchar (','); - - /* local, no need for xgetgrgid */ - gr = getgrgid (groups[i]); - if (NULL != gr) { - (void) printf ("%lu(%s)", - (unsigned long) groups[i], - gr->gr_name); - } else { - (void) printf ("%lu", - (unsigned long) groups[i]); - } - } - } - free (groups); - - /* - * Finish off the line. - */ - (void) putchar ('\n'); - - return EXIT_SUCCESS; -} -