From owner-freebsd-hackers Fri Mar 8 04:31:08 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA01376 for hackers-outgoing; Fri, 8 Mar 1996 03:18:30 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [192.216.222.3]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA01327 for ; Fri, 8 Mar 1996 03:18:18 -0800 (PST) Received: from gvr.win.tue.nl (root@gvr.win.tue.nl [131.155.210.19]) by who.cdrom.com (8.6.12/8.6.11) with ESMTP id XAA22338 for ; Thu, 7 Mar 1996 23:42:52 -0800 Received: by gvr.win.tue.nl (8.6.12/1.53) id IAA24948; Fri, 8 Mar 1996 08:41:22 +0100 From: guido@gvr.win.tue.nl (Guido van Rooij) Message-Id: <199603080741.IAA24948@gvr.win.tue.nl> Subject: Re: pwd_mkdb - really slow :( To: ache@astral.msk.su (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=) Date: Fri, 8 Mar 1996 08:41:21 +0100 (MET) Cc: julian@ref.tfs.com, rashid@rk.ios.com, hackers@FreeBSD.org In-Reply-To: <199603051212.PAA01715@ache.dialup.ru> from "=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=" at Mar 5, 96 03:12:27 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@FreeBSD.org X-Loop: owner-hackers@FreeBSD.ORG Precedence: bulk > > Do you solve order problems with different login names per same uid? > Yes. That is in fact quite easy to solve. But only because my patches give the opportunity to add/change *one* user to the password file via chpass/chsh/chfn, passwd and yppasswdd. These utilities do not allow the uid to be changed. In those cases you can getpwuid() the uid to change/add, do a getpwnam on the result and check if the uid you get back equals the uid of the user to add/change. You then know what to do. It will be harder when you can also change the uid. That is because you have to do two things 1) Make sure the old uid of the user to change is not still used 2) Test if the new uid of the user to change is not in use. In both cases when the uid is in use, you have to find out which user with that uid comes first in the password file. This is not at all easy to solve. Testing in file that is passed to pwd_mkdb for a uid change of the given user is the only solution. That would take a lot of time though. In my case, I demand that the uid did not change. And that is gurantueed by the limited set of commands supporting it. -Guido