delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/08/17/08:03:48

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=tJW/lVLwzSJTgaIphC7LXp9PHFjOP
x+TjaK/Hm1GEaxcXBn50eJ+AyLtjr8tNqT/Az7sju66IU+LRx3mHRBcD5WKaKvAE
poWkTOtC2g88Xb9x5OwqVzFGSb+ybHD6sw+XG9rwYC4P6CLfjOFhMnlEl90Pniw7
euJuJVwx9P9NEY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; s=default; bh=uXtjhk4dhygMhrRimWGOda43N7A=; b=FcU
Gx8ucr8RX3DMxfesjjzPTrRYL2ULO7WbL8sforDQQ3tMxVnvUwNC0Ul7WpWE/LcE
0X2UxIn1YAaSg3hI05RDbl798hB7MTAFxaFibtzf2g24NdszhMbZJyNdpFPKPDr8
weXVX0fqtF0m7SVtL+7uq0Q+1WJLyr/sirpieXRE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-wi0-f175.google.com
MIME-Version: 1.0
X-Received: by 10.180.85.194 with SMTP id j2mr32858534wiz.11.1439813009220; Mon, 17 Aug 2015 05:03:29 -0700 (PDT)
Date: Mon, 17 Aug 2015 15:03:29 +0300
Message-ID: <CAGHpTBKEWFa8M1KN6_vqrBT6WOjVpmOCUqP-LHBYK=FApg2fJg@mail.gmail.com>
Subject: FindFirstFile fails for some network directories
From: Orgad Shaneh <orgads AT gmail DOT com>
To: cygwin AT cygwin DOT com

Hi,

I have 2 network shares with similar contents:
\\netapp1\CM\CompilationResults
\\aclnas01\versions\CompilationResults

Trying to list all the files within these directories using Ruby
succeeds for netapp1, but fails for aclnas01.

The failing ruby command is:
  ruby -e "print Dir.glob('//aclnas01/versions/CompilationResults/*')"

The exact same command succeeds when executed from a normal command
prompt, or when the directory is on netapp1 (on both shells).

After debugging Ruby, I found out that FindFirstFile returns an
INVALID_HANDLE when invoked from cygwin environment.

The following application succeeds on command prompt and fails on cygwin:

#include <stdio.h>
#include <windows.h>

int main()
{
    const TCHAR *aclnas = TEXT("//aclnas01/versions/CompilationResults");
    const TCHAR *netapp = TEXT("//netapp1/CM/CompilationResults");

    WIN32_FIND_DATA fd;
    printf("%d\n", FindFirstFile(aclnas, &fd) !=
INVALID_HANDLE_VALUE); // Fails on cygwin
    printf("%d\n", FindFirstFile(netapp, &fd) !=
INVALID_HANDLE_VALUE); // Always succeeds
    return 0;
}

Output on cmd is 1 1, on cygwin it is 0 1.

Process Monitor shows that when executed from cygwin, CreateFile is
called with Open for Backup flag. I can't say for sure if this causes
the failure, but that's the only difference I could find between these
executions.

This bug was previously reported on github/msys2[1], but it wasn't solved.

I only have read access to these servers, but I might have cooperation
of the sys admin (can't promise though).

Any help will be appreciated.

Thanks,
- Orgad

[1] https://github.com/Alexpux/MSYS2-packages/issues/242

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019