mkpasswd - ndbm failure with a small input file

From: Richard Berrie - Computing Services <r.berrie_at_qut.edu.au>
Date: Thu, 26 Feb 1998 15:46:19 +1100

Help me please!


With regard to the following:

------8<---------------------8<----------------------8<-------------
PROBLEM: (Patch ID: OSF410-400331)
********
When the /etc/passwd file is very large, a performance degradation may occur.

When the number of passwd entries reaches up into the 30,000 to 80,000 range
or greater, mkpasswd will sometimes fail to create a hashed (ndbm) database.
Since the purpose of this database is to allow for efficient (fast) searches
for passwd file information, failure to build it causes commands that rely
on it to do a linear search of /etc/passwd. This results in a serious per-
formance degradation for those commands. This patch allows the vedquota,
vquot, vquota and vquotacheck commands to work correctly when the customer
builds a hashed passwd database using a non-default page file block size.
------8<---------------------8<----------------------8<-------------


It seems not to be the size of the /etc/passwd file that matters .. it has something to
do with the way ndbm hashes the records...

The following uuencoded example demonstrates the problem. I have many more sets of
14 records that break mkpasswd as well..

*NOTE* you don't have to bee root to try this. The test should run OK for any user who
can create a directory in /tmp.

begin 755 tryit.sh
M(R$O8FEN+W-H"G5M87-K(#`W-PI41$E2/2]T;7`O7U]-2U!!4U-71%]&04E,
M7U\*+V)I;B]M:V1I<B`D5$1)4_at_I#1$E2/6!P=V1_at_"F-D("141$E2"B]B:6XO
M8V%T(#X_at_9F%I;',_at_/#P_at_7$5/1_at_IN,3DT,S,S,CHJ.C,W.34R.C$P,#`Z0D5.
M2D%-24X_at_5T5.34%..B]U<V5R-"]N,3DT,S,S,CHO=7-R+VQO8V%L+V)I;B]B
M87-H"FXQ.30R-#0Q.BHZ,S<X.#4Z,3`P,#I32$%.3D].(%=!4E))04XZ+W5S
M97(S+VXQ.30R-#0Q.B]U<W(O;&]C86PO8FEN+V)A<V_at_*;C$Y-#(R-C,Z*CHS
M-S_at_W-#HQ,#`P.DM!5$4_at_5T%21#HO=7-E<C8O;C$Y-#(R-C,Z+W5S<B]L;V-A
M;"]B:6XO8F%S:`IN,3DS-#0R,CHJ.C,W,C<W.C$P,#`Z1$5!3B!35$5.4TY%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("UF("]U<W(O<V)I;B]M:W!A<W-W9"!=(#L_at_=&AE;_at_H_at_("]U<W(O<V)I
M;B]M:W!A<W-W9"!F86EL<PIF:0HO8FEN+VQS("UL<PIC9"`D0T1)4_at_HC(')E
M;6]V92!T:&ES('-T=69F('-I;F-E('-O;64_at_<WES=&5M('5T:6QI=&EE<R!D
F;VXG="!L:6ME('1H92!S:7IE<PHO8FEN+W)M("UR9B`D5$1)4_at_II
`
end


The output you get (if it fails) is:

Digital UNIX V4.0A (Rev. 464)
Digital UNIX V4.0B (Rev. 564)
------------------------------

mkpasswd: dbm_store failed: File too large

-rw------- 1 root system 870 Apr 16 07:57 fails
-rw-r--r-- 1 root system 2045198336 Apr 16 07:57 fails.dir
-rw-r--r-- 1 root system 16754233061376 Apr 16 07:57 fails.pag


ULTRIX 4.3
----------

mkpasswd: dbm_store failed: Invalid argument

-rw-r--r-- 1 root system 870 Apr 16 08:03 fails
-rw-r--r-- 1 root system 212992 Apr 16 08:03 fails.dir
-rw-r--r-- 1 root system 1713123328 Apr 16 08:03 fails.pag


If it doesn't fail on your system could you please let me know what Version of Digital
Unix (and patches) that you are running.


Many thanks in advance for your cooperation.



Regards,
Richard.

==============================================================================
Richard Berrie, mailto:r.berrie_at_qut.edu.au
IT Security Analyst, phone: +61 7 3864 1572
Computing Services, fax: +61 7 3864 5272
Queensland University of Technology,
Brisbane, Queensland, Australia.
Received on Thu Feb 26 1998 - 09:35:49 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT