From: Roger Leigh <rleigh@codelibre.net>
To: util-linux@vger.kernel.org
Subject: Re: newgrp(1) and sg(1)
Date: Mon, 18 Mar 2013 22:38:40 +0000 [thread overview]
Message-ID: <20130318223840.GW23093@codelibre.net> (raw)
In-Reply-To: <20130318154225.GF2172@x2.net.home>
On Mon, Mar 18, 2013 at 04:42:25PM +0100, Karel Zak wrote:
> Do we really need passwords for groups [newgrp(1) and /etc/gshadow]?
> Seems like a nice over-engineering.
>
> By the way, I have fixed newgrp(1) in util-linux and shadow-utils 5
> years ago. The password verification was pretty useless for years...
It's only with the newer glibcs that it's supported by NSS and
the standard library properly (and getent). So while it's not
as widely used as other system databases, it does have its place
and has really only recently become properly usable.
Looking at the newgrp(1) implementation, it's not using glibc
NSS. On a current system, it could certainly switch to using
the standard getsgent (or related fgetsgent_r etc.) calls.
> IMHO it would be better to mark whole /etc/gshadow as deprecated and
> reuse "su --group <group> [--supp-group <group> ...]" code to switch
> between groups, then we don't have to maintain separate newgrp code.
>
> Note that newgrp(1) is available in shadow-utils and util-linux, sg(1)
> is alias in shadow-utils. We have been successful with login(1), now
> I'd like to consolidate newgrp(1) :-)
I don't think that deprecation is really appropriate--the system
interface, NSS and /etc/gshadow are not really the purview of
util-linux, though tools using the interfaces certainly are.
newgrp(1) is specified by POSIX/SUS, so I think this is worth
retaining for compatibility reasons. Making it use NSS would be
a good improvement though, since it's currently limited to flat
files.
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools
`- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
next prev parent reply other threads:[~2013-03-18 22:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 15:42 newgrp(1) and sg(1) Karel Zak
2013-03-18 20:09 ` Sami Kerola
2013-03-18 22:38 ` Roger Leigh [this message]
2013-03-19 8:52 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130318223840.GW23093@codelibre.net \
--to=rleigh@codelibre.net \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox