From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by sourceware.org (Postfix) with ESMTPS id 799673861035 for ; Mon, 7 Sep 2020 20:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 799673861035 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mo7if-1kumc00NQJ-00pgcp for ; Mon, 07 Sep 2020 22:51:27 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 9352BA83A8B; Mon, 7 Sep 2020 22:51:26 +0200 (CEST) Date: Mon, 7 Sep 2020 22:51:26 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Weird behavior in 'grep'ing for string in /proc/registry... Message-ID: <20200907205126.GK4127@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <5F55C670.7030004@tlinx.org> <758d674d-7501-56ea-7246-894e5c877778@SystematicSw.ab.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Provags-ID: V03:K1:wFIhgiZ4A0KyZd1yxOnyARM1RqxGbnBWC343hH0HiRH5y8kZO9E bPWu4TNrHLZURFJTnMgRZYp6D5gnCsxiQhiGiZAMTuTPWP4dW9+X6Gj0juJ/u7gdBXiCBr8 ljhq8ZMXk3YX5Iqq4FqkgvAS54kFEWtadQTJU1uhKLZIXPD16zeBKQYOxXr7Y/zcsegdNb0 U5EY/HdmBIfHjeZhh0c3g== X-UI-Out-Filterresults: notjunk:1;V03:K0:pSjtMETkRb8=:MzlW6JD90sfv7wGTy3jKA5 yQzPje94tHWA0p3ku/UaEgM9YDuOweVxVDFykOCMITTMKvQoQJdXPWVDacQvXl6HrP9pM+bDz 5KR8sfFUTIev/IL1Xzniqkd8G3uO0jab9maocfdKLbSwP7ocvKaKjL8Zavch6W3dIvIzOUDGf SEfxuX+b3OfXHnMRlrotodOdbsbqmKutPR6RvaczRgdhPQjTPBu5/Ss/wXKjsTMWVkNtSkJkS snnJzWS/7rD4PpksRITzYk1a3hPo+5pTNrwjqTHFrqRwchcUQjrKxMxnJFsn4Go1kBJYWGfhT 4eHZ9tkZy7NQWYYMtPa1WfGyYeCPCgSsh1kZK3Nyy9VAJwB3ECOycG1GdoA3BjJg4Pwttkqbh wQy5DQBUlwzRgN1mN0KkBq9HdHQui11jHOEHQh1HEmUilul9ybgCA8Tygrtkgxj66cTwxO6ik XGI7o3xfuZbwubiG9Rf4fgSQJ1CSXbzzhq7Zvskd2tlyW8+IT5N7YhC1t7oBcAao0vObJHC9h mZXyeM81W9/gOnGFUjiI7zfOeIUhGgmGZpHlrj4dPbE5PwrFErXVxZFgc2PyKthNTLKcD+8hw TtBgk46wlym4KeYr0MToOCB2hZq9rqFRLqRtAPrtCO5c/MLc+m4kqyjUgFCBwTIoZeQHjKAgz XInybKDGn9p1cJZCOBMNr8M/lHL3AIsG6Pal1OeFfai+JuG8RCYvnEb8jKX0wZmO9hj0+CB5R ibgStlpAvD7wFHyLOQQBtlCjY08hEUuGTayscT/wKMRBBYPMAbHU27rlTUS1xvxPuRfsKUwNd G2+vLjf6mWOgpIaVb0Cbu913vwGOnsFaxwqsGoBIn10ARGrTSJSZa0bu4HFCmi7vi/CEj+xU1 7u6SCE46rkfM8hQSNd3w== X-Spam-Status: No, score=-100.6 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 20:51:30 -0000 On Sep 7 09:53, Thomas Wolff wrote: > Am 07.09.2020 um 09:05 schrieb Brian Inglis: > > On 2020-09-06 23:34, L A Walsh wrote: > > > In directory > > > /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/eventlog > > > I wanted to list all the ".dll"s that handled various types of > > > events. > > > > > > I tried > > > /bin/grep -Pr '\.dll' > > > > > > but got a load of bogus error messages: > > > > > > /bin/grep: Group: Is a directory > > > /bin/grep: ImagePath: Is a directory > > > /bin/grep: Description: Is a directory > > > /bin/grep: ObjectName: Is a directory > > > .... > > [...] > I reproduced Lindas observation (although not in the folder she mentioned > which does not exist here) and in fact there is an inconsistency between > `grep -r` reporting "Is a directory" for entries that are not marked as > directory by `ls`: > .pwd > /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Appinfo/Parameters > .ls -l > insgesamt 0 > -r--r----- 1 SYSTEM SYSTEM 34 27. Nov 2019  ServiceDll > -r--r----- 1 SYSTEM SYSTEM  4 27. Nov 2019  ServiceDllUnloadOnStop > .grep -r . > grep: ServiceDll: Is a directory > grep: ServiceDllUnloadOnStop: Is a directory > > I checked whether `opendir` marks the d_type fields wrong in the /proc > filesystem but that's not it. No, it's a collision of an internal flag with an official open(2) flag from fcntl.h, used by grep in this case. I changed the way the internal flag is used so it doesn't collide with fcntl.h flags ever, even if we add some more. I uploaded new snapshots for testing to https://cygwin.com/snapshots/ Please give them a try. Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer