X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=2.3 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Received-SPF: pass (google.com: domain of nick.lowe@gmail.com designates 10.52.23.5 as permitted sender) client-ip=10.52.23.5;
Authentication-Results: mr.google.com; spf=pass (google.com: domain of nick.lowe@gmail.com designates 10.52.23.5 as permitted sender) smtp.mail=nick.lowe@gmail.com; dkim=pass header.i=nick.lowe@gmail.com
MIME-Version: 1.0
In-Reply-To: <CADSoG1uVEpxOSxAm2ZtbzE9oh95TcAQYkj_YRAZxP0tL8-3uDQ@mail.gmail.com>
References: <CADSoG1so=3KxR5TS6mVNRhZGkdUku42Y=S3eWV0dtDgiZE8Tww@mail.gmail.com>	<CADSoG1uVEpxOSxAm2ZtbzE9oh95TcAQYkj_YRAZxP0tL8-3uDQ@mail.gmail.com>
Date: Tue, 21 Feb 2012 09:10:45 +0000
Message-ID: <CADSoG1v5skh+gsKmBfVSbykA+AXHJjJEs+oTWsjSav04BvUNzg@mail.gmail.com>
Subject: Re: shared_info::init_obcaseinsensitive implemented incorrectly
From: Nick Lowe <nick.lowe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Grr, I hit send before finishing writing this. I meant to write:

"Then, check for existence of the uppercase or lowercase form of the
path (choose appropriate casing based on the existing casing) with
NtQueryAttributesFile ensuring, obviously, that the
OBJ_CASE_INSENSITIVE flag is not set."

Cheers,

Nick

On Tue, Feb 21, 2012 at 8:59 AM, Nick Lowe <nick.lowe@gmail.com> wrote:
> Dear Cygwin Developers,
>
> shared_info::init_obcaseinsensitive in shared.cc has, in my opinion,
> been implemented incorrectly.
>
> The value of the obcaseinsensitive value in the registry only
> represents how the object manager will be on next reboot and not its
> present state. Cygwin uses it as if it represents the present state,
> however. This is likely to be true, but is not guaranteed to be.
>
> To determine the present state, first get the system root path via either:
>
> 1) Querying the %SystemRoot% environment variable via
> RtlExpandEnvironmentStrings_U and change it with
> RtlDosPathNameToNtPathName_U (alternatively
> RtlDosPathNameToNtPathName_U_WithStatus in Vista and later).
>
> 2) Querying the symbolic link target of \SystemRoot via
> NtQuerySymbolicLinkObject. (Requires administrative rights.)
>
> Then, check for existence of the uppercase form of the path with
> NtQueryAttributesFile ensuring, obviously, that the
> OBJ_CASE_INSENSITIVE flag is not set.
>
> If the the NTSTATUS value is successful, the object manager is running
> with case insensitivity, if not its running with case sensitivity.
>
> With regards,
>
> Nick Lowe

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

