Re: gated 3.6A1 for 1.3.99 (diffs)

Marek Michalkiewicz (
Sun, 9 Jun 1996 15:18:53 +0200 (MET DST)

Cristian Gafton:
> Still, I seriously doubt that this will work on shadow-aware systems
> without actually having /etc/shadow.

Why not? Many other programs do it this way and work just fine -
if /etc/shadow doesn't exist, getspnam() will return NULL and the
password from /etc/passwd will be used. If you see any specific
problems with this, let me know.

> Why not check the presence of /etc/shadow and if it is present and size >
> 0 then proceed with shadow things ?

Because it's more code which is not necessary in most cases. I do it
only in programs which need to modify password files (passwd already
works with both shadow and non-shadow passwords in my current, not yet
unreleased source).

Besides, the implementation of getspnam() might change later, so there
shouldn't be too many programs with hardcoded check for /etc/shadow.
(Not that it is expected to change anytime soon, but...)