[322] in NetBSD-Development
Re: Some notes on installation
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Dec 28 05:01:50 1994
To: yoav@MIT.EDU
Cc: ghudson@MIT.EDU, netbsd-dev@MIT.EDU
In-Reply-To: Your message of "Wed, 28 Dec 1994 04:44:57 EST."
<9412280944.AA04654@marinara.MIT.EDU>
Date: Wed, 28 Dec 1994 05:01:44 -0500
From: Greg Hudson <ghudson@MIT.EDU>
> surely you're kidding?
> I don't see why we can't just put people into /etc/passwd.local,
> and reactivate would call up a program which generates all the other
> files from the passwd.local
This is what we do now, and this is effectively what Athena does
(except that /etc/passwd is the only generated file).
The problem with the Athena approach is that it confuses system
utilities by treating the system passwd files as derived files. The
main practical problem we see is that "passwd" modifies
/etc/master.passwd and therefore has its changes undone at the next
reactivate. Athena treats this particular symptom under Ultrix by
writing a modified /bin/passwd, but that doesn't cure the disease.
Note that the method for adding local password entries is more
complicated only because the "hesinfo username passwd" format is
incompatible with NetBSD's source format for passwd entries. If I
were implementing this under Ultrix or Linux, you would be able to do
"hesinfo username passwd >>/etc/passwd" and that would be it.
> /bin/login that I'm working on will clean out that cruft hopefully,
> and can add people with the *temp* if you insist..
> I'm not sure why we need to be so different from athena..
/bin/login shouldn't be cleaning anything up. I think we should be
different from Athena because (a) we have to anyway, given the NetBSD
passwd structure, (b) unlike the Athena approach, my approach doesn't
have the conceptual flaw of changing which files in /etc are source
files and which are derived, and is therefore less likely to collide
with non-Athena utilities, and (c) my approach doesn't create
additional files in /etc, and the Athena approach does.
I've written an awk script (since perl isn't local, and reactivate
shouldn't depend on /usr/athena) to implement reaping the
/etc/master.passwd and /etc/group files, and put it in
/afs/sipb/project/netbsd/dev/athena/reactivate/passwd-reap.awk. It
looks like this:
BEGIN {
FS = ":"
while (getline < "/etc/master.passwd") {
if ($2 != "*temp*") {
print $0 > "/etc/master.passwd.new";
users[$1] = 1;
}
}
FS=":|,"
while (getline < "/etc/group") {
members = "";
for (i = 4; i <= NF; i++) {
if (users[$i] == 1)
members = members "," $i;
}
if (members != "" || $2 != "*temp*")
print $1 ":" $2 ":" $3 ":" substr(members, 2) > "/etc/group.new";
}
}
It generates /etc/master.passwd.new and /etc/group.new files, so that
/etc/athena/reactivate can move those files into place over the old
ones. Note that groups must be empty and marked as *temp* to be
reaped; that way system groups like "bin" don't get reaped, and
neither do groups containing entries for people with permanent
/etc/master.passwd entries.
Unless I hear some real arguments ("why are we being different from
Athena?" isn't a real argument) why this scheme isn't significantly
better than the old one, I will modify xlogin and AL to add password
entries using *temp*, and change reactivate to use the new scheme for
cleaning up the passwd file.
And don't call me Shirley.