shadow-maint / shadow

Upstream shadow tree
Other
299 stars 230 forks source link

[RFC] Deprecating and removing groups(1) and id(1) #1005

Closed alejandro-colomar closed 3 months ago

alejandro-colomar commented 4 months ago

Related: https://github.com/shadow-maint/shadow/issues/999 Cc: @dkwo, @jubalh, @hallyn, @ikerexxe


coreutils/id and coreutils/groups have existed since back in 1992:

$ git show --stat ccbd1d7dc518 -- src/id.c src/groups.sh
commit ccbd1d7dc5189f4637468a8136f672e60ee0e531
Author: Jim Meyering <jim@meyering.net>
Date:   Sun Nov 1 05:44:29 1992 +0000

    Initial revision

 src/groups.sh |  31 ++++++
 src/id.c      | 346 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 377 insertions(+)

busybox/id has existed since 2000:

alx@debian:~/src/busybox/busybox/master$ git show --stat 94f5e0ba7ca7 -- coreutils/id.c
commit 94f5e0ba7ca7af260f4bf2d8c77b8e6f6f528b18
Author: Erik Andersen <andersen@codepoet.org>
Date:   Mon May 1 19:10:52 2000 +0000

    Some accrued fixes/updates.
        * cp/mv now accepts (and ignores) the -f flag, since it always
            does force anyway
        * tail can now accept -<num> commands (e.g. -10) for better
            compatibility with the standard tail command
        * added a simple id implementation; doesn't support supp. groups yet

 coreutils/id.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

busybox/groups has existed since 2011:

alx@debian:~/src/busybox/busybox/master$ git show --stat 33092f100398
commit 33092f1003982fc26339c0fda66283805cfbcfb1
Author: Tito Ragusa <farmatito@tiscali.it>
Date:   Tue Jun 21 17:11:40 2011 +0200

    groups: new applet

    Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
    Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

 coreutils/Config.src  |  6 ------
 coreutils/Kbuild.src  |  1 -
 coreutils/id.c        | 40 ++++++++++++++++++++++++++++++++++++----
 include/applets.src.h |  1 -
 4 files changed, 36 insertions(+), 12 deletions(-)

Both coreutils/groups and shadow/groups have no options at all, so they should be identical. coreutils/id has a superset of shadow/id 's options (shadow only has -a).


Debian uses the GNU coreutils binaries. I don't know what other distros do.


I'm in favor of removing duplicate programs, which would reduce maintenance work, unless there are good reasons to keep them. Does anyone know of any reasons to keep these programs around?

ikerexxe commented 4 months ago

I'm in favor of removing duplicate programs, which would reduce maintenance work, unless there are good reasons to keep them. Does anyone know of any reasons to keep these programs around?

In general terms I'm not against having several projects providing the same functionality. They may have slight differences that make it worth maintaining two or more implementations. As an example, and from what I heard, busybox is tuned for systems with limited resources like embedded systems.

Debian uses the GNU coreutils binaries. I don't know what other distros do.

Fedora also uses id and groups binaries provided by coreutils.

Both coreutils/groups and shadow/groups have no options at all, so they should be identical. coreutils/id has a superset of shadow/id 's options (shadow only has -a).

From this analysis it seems like shadow's implementation is simpler and doesn't provide any additional options.

In addition, Debian and Fedora use coreutils implementation, so I'm in favour of deprecating and removing those binaries from this project.

alejandro-colomar commented 4 months ago

@thesamesam Any comments from Gentoo?

jubalh commented 4 months ago

Debian uses the GNU coreutils binaries. I don't know what other distros do.

openSUSE also uses groups and id from coreutils.