Subject: Re: getpw*() changes to support YP netgroups
To: None <tech-userlevel@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: tech-userlevel
Date: 07/17/1995 09:29:59
>> I now have a version of the passwd routines that support netgroups.
>> Unfortunately, the db format of the passwd file will change when I
>> commit them so things will break.  [...]

>> Another idea would be to change the library version...
>> I am open to suggestions...

As I see it, the problem with this is ensuring that the passwd db file
format changes at the same time as the getpw*() library routines.  One
solution, of course, is just to tell users that they have to install
and run the new pwd_mkdb when they install the new getpw*() routines,
or things will break; this is the way some other similar things (like
the mount_ffs change) have been done in the past.  It works, but it
will inevitably cause confusion from people who don't pay attention.
It also means that anything linked -static with getpw*() will break
until relinked.

My suggestion: have pwd_mkdb generate two db files, one in the old
format (sans yp entries), for old executables, and one in the new
format, for new executables.  Then have getpw*() check for the new
file and use it if exists, falling back on the old file if not (so that
the new routines can be used with an old database).  This would not
call for changing either version number of libc.  And perhaps in a
while (a year?), getpw*() could be changed to drop support for the old
file format....

> Changing the format of the passwd database files is not something to
> be taken lightly.  Quite a few, perhaps most, of the programs I use
> every day use getpwnam(), etc. and will have to be re-compiled.

Just relinked, and not even that if they were linked with the dynamic
version of libc.

> I think that the following questions have to be answered:

> 	1. Do the advantages of this change outweigh the disadvantages?
> 	   In particular, consider comercial software that does not
> 	   come with source.

What about it?  (Personally, I'd _like_ to break such software, but I
realize this option is not quite as attractive to core.)  If it's
linked -static, yell loudly about their having supplied you with a
broken program - and with my suggestion, it'll work anyway.  If it's
not linked -static, it'll work Just Fine anyway.

					der Mouse