Received: from mailman.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (8.9.3p2) with ESMTP id XAA13604; Tue, 14 Dec 2004 23:00:59 -0500 (EST) Received: from pch.mit.edu (pch.mit.edu [127.0.0.1]) by mailman.mit.edu (8.12.8p2/8.12.8) with ESMTP id iBF454YR016403 for ; Tue, 14 Dec 2004 23:05:04 -0500 Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by mailman.mit.edu (8.12.8p2/8.12.8) with ESMTP id iBF452YR016399 for ; Tue, 14 Dec 2004 23:05:02 -0500 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) iBF40O1j002689; Tue, 14 Dec 2004 23:00:24 -0500 (EST) Received: from all-in-one.mit.edu (ALL-IN-ONE.MIT.EDU [18.18.1.71]) (authenticated bits=56) (User authenticated as raeburn@ATHENA.MIT.EDU) by outgoing.mit.edu (8.12.4/8.12.4) with ESMTP id iBF40MmN015222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 14 Dec 2004 23:00:23 -0500 (EST) Received: (from raeburn@localhost) by all-in-one.mit.edu (8.12.9) id iBF40MUF001033; Tue, 14 Dec 2004 23:00:22 -0500 To: krb5-bugs@mit.edu From: Ken Raeburn Date: Tue, 14 Dec 2004 23:00:22 -0500 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.9 X-Spam-Flag: NO X-Scanned-BY: MIMEDefang 2.42 Subject: profile iterator can see inconsistent data if file independently modified X-Beenthere: krb5-bugs-incoming@mit.edu X-Mailman-Version: 2.1 Precedence: list Sender: krb5-bugs-incoming-bounces@mit.edu Errors-To: krb5-bugs-incoming-bounces@mit.edu X-RT-Original-Encoding: us-ascii Content-Length: 1182 If the config file is modified on disk while the iterator code is walking over the data, the profile code will re-read the file, build a new node tree, and next time the iterator is used, it will again look up the sequence of names it's using, and walk forward to the Nth entry under that name, when it kept track that it was on the Nth entry in the old version of the file. More sensible, probably, would be to keep a handle on the old data, so that we don't return a mix of new data and old. A new ref count, a new mutex, and a new level of indirection can do this. Sounds simple enough, but consider too how this might interact with a program that is itself trying to make modifications. Contemplate the horror of multiple threads trying to iterate and make modifications to the same data at once. Then run screaming into the night, while race conditions hiss and growl as they claw their way out of the pit, sniffing at the air to catch the scent of the dangling pointers you leave behind as... oh, sorry. Should a modification attempt fail if the library knows that the on-disk data has been modified? Should we just ignore the disk changes and overwrite it? Etc. Ken