[1131] in NetBSD-Development
Partial libAL integration
daemon@ATHENA.MIT.EDU (Greg Hudson)
Sat Nov 18 12:41:21 1995
Date: Sat, 18 Nov 1995 12:40:51 -0500
From: Greg Hudson <ghudson@MIT.EDU>
To: linux-dev@MIT.EDU, netbsd-dev@MIT.EDU
Since a few people have gotten bitten by the changes I've made to
parts of the source tree, I thought I should send a status report
here.
xlogin, login, and telnetd now all use the same implementations of
adding people to the passwd file and group file, and that
implementation lives in libAL. Due to some complications in the libAL
session interface (in particular, that it calls getpwnam() at
initialization time and expects the result to be valid until you end
your session), I introduced some lower-level libAL interfaces
independent of the Athena session structure:
int PWaddPasswdEntry(struct passwd *pwd)
int PWremovePasswdEntry(struct passwd *pwd)
int PWaddGroups(struct passwd *pwd, gid_t *groups, int ngroups)
int PWremoveGroups(struct passwd *pwd, gid_t *groups, int ngroups)
Some bonuses here are that the NetBSD code actually uses a correct
locking convention, that the code for adding people to groups fixes
problems that no prior implementation addressed, and that there is
actually support for removing users from /etc/group when they log out
(PWaddGroups() records the groups it added in groups, returning the
number of groups added, and PWremoveGroups() removes the user from
those groups). Naturally, the normal session interfaces (replace "PW"
with "AL") are defined in terms of the PW* interfaces, so they have
the same nice properties.
So far, only telnetd and login will remove people from the groups file
(or xlogin if your login fails after it adds you, but that's not
terribly interesting), because the xlogin/dm interaction needs to be
modified to support removing groups.
All of the new code compiles currently (Sal found a compilation
problem under Linux, which I've fixed), but none of it's been tested
at all. I hope to test the code today.