delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/28/23:14:44

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:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=aCGwAWAYgmd9a7a7T2HFeqb5OSxfe
g529U8z6qEsYR+IbwUsP7SrS7oneGD20bVZ6pOolsxM3zwuYrzCXzdX1Zgn4+AC7
9iZVyw44bg7ZR6KQ2L/Edffqxv1GUI2FdA3xjHGhR+vfYFvUDx8Rn2aSSu2P/REI
yT5pZlmrL8h7qY=
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:from:date:message-id:subject:to
:content-type; s=default; bh=LXT6ZoeUKYctz8rhtABBPoP0u1Y=; b=Sec
MUmIpBn9XFhfluAVlwJWcfblzvHTD8hlD8Yo18qvlm6C9DR3zq5y9ufb1HMSs3xF
s6pXL1WW5bLTQeGCprGbKX+UmpDzc2C4N8smQGRtxgQHm3QB6dIjAXvi+vLgE7vM
yEYF+/cre3EVKafxW2J96JuYM49b/Y7/3mh0adB4=
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=0.6 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Console, Disk, ld, LD
X-HELO: mail-qk0-f179.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=u6k7WJklteG+ucl1nQnUZaFcaiFNgQdcEhDmybSXFCs=; b=Nw8Vqr95AneItXCNjDNdsNU7IoEOcx/f3piQVjuzZR1ZBxsWa7UeZfRsDI6RzkRB50 mrfagy/xFiPo5447QLYw4pAjp0PffVSyN4MAWIC+ZOU4RfdmcYbfi1YTDHOqBdKXNPmX ngdcBI4iL2RMc+G4+w7P0D6L4s3OZw8ctQ03qNd1S8u3DGCP7BtH37ysrN4A3oTjws3c CP5cL3bvhrATlyKjwStI+4Vs4KYxhF0KcbSW1x511Wc24QFZpdXiCa6Hva398otIjUkA JIBqt63+5iiulwHU/oPp5yz7xNKCLNByrDFV0NkW8dydqGNbY3SDOoE++xOv4zVY7qlT dKCw==
X-Gm-Message-State: ALyK8tLo1Di+IEOO2W2Bg2LNf6pal9Ds48N+6otHoE1iY4rGHUExVDk4KCRHEwgTOGxcGuQYCQgKHLg9OahEsQ==
X-Received: by 10.233.216.133 with SMTP id u127mr7431894qkf.203.1467170063149; Tue, 28 Jun 2016 20:14:23 -0700 (PDT)
MIME-Version: 1.0
From: David Lee <mailtolky AT gmail DOT com>
Date: Wed, 29 Jun 2016 11:14:22 +0800
Message-ID: <CALiPeu=nAkBgk+JwfrQD-Y4OrThkZNPd0_6UEYnNfeFw+2PX2g@mail.gmail.com>
Subject: Issue creating directories in a VHD volume
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

--94eb2c04363870f52605366226e7
Content-Type: text/plain; charset=UTF-8

Hi,

I found some issues while trying to create directories to a volume on
a virtual disk (VHD).

-- SETUP --

* Windows 7 SP1 x64
* Cygwin 2.5.2 x86 installed and run under C:\Cygwin
* 100 MB Virtual Disk on D:\Test.vhd
* VHD has a 100 MB simple volume formatted as NTFS

* Tests were done under an account the joined the Local Administrators group.

-- TEST 1 --

1. I used Disk Management Console (diskmgmt.msc) to:
    a. Attach the VHD using Disk Management Console (GUI) (diskmgmt.msc).
    b. Mount the volume under C:\Cygwin\tmp\mount (Cygwin saw it as /tmp/mount).

2. Then I tried to create a directory in /tmp/mount inside bash:

   mkdir /tmp/mount/12345

3. Result: success (note: elevation was not needed).


-- TEST 2 --

Same procedure but used the diskpart.exe console utility instead.

1. It fired up a UAC prompt and I accepted it.

2. I created another directory: mkdir /tmp/mount/67890.

3. Result: success (note: although diskpart.exe was elevated, the bash
prompt itself wasn't.)


-- TEST 3 --

I wrote a simple utility in C/C++ to attach the VHD (using Win32 API
such as OpenVirtualDisk() and AttachVirtualDIsk()).

Source was attached with this message (demo.c)

1. I fired up an *elevated* Command Prompt.
2. Ran the utility to attach the DISK. Result: success.
3. Mounted the volume under C:\Cygwin\tmp\mount, either diskmgmt.msc
or diskpart.exe
4. Inside a bash prompt (no elevation), typed mkdir /tmp/mount/abcde
5. Result: permission denied (no directory was created).

6. In a Command Prompt (no elevation), the following SUCCEED:

   mkdir C:\Cygwin\tmp\mount\abcde

Any help is appreciated on why I got the 'permission denied' message.

David Lee.

--94eb2c04363870f52605366226e7
Content-Type: text/x-csrc; charset=US-ASCII; name="demo.c"
Content-Disposition: attachment; filename="demo.c"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_iq0b2gz20

LyoKICogcmVuYW1lIHRvIGRlbW8uYyBhbmQgY29tcGlsZSB1bmRlciBjeWd3
aW4gYXMKICoKICogaTY4Ni13NjQtbWluZ3czMi1nY2MgZGVtby5jIC1sVmly
dERpc2sKICovCgojZGVmaW5lIF9XSU4zMl9XSU5OVCAweDYwMQojZGVmaW5l
IElOSVRHVUlECgojaW5jbHVkZSA8V2luZG93cy5oPgojaW5jbHVkZSA8Vmly
dERpc2suaD4KI2luY2x1ZGUgPHRjaGFyLmg+CiNpbmNsdWRlIDxzdGRpby5o
PgoKI2RlZmluZSBWSER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goJaWYgKHJjICE9IEVSUk9SX1NVQ0NF
U1MpCgl7CgkJZndwcmludGYgKHN0ZGVyciwgTCJBdHRhY2hWaXJ0dWFsRGlz
aygpIGZhaWxlZCwgcmMgPSAlbHVcbiIsIHJjKTsKCQlyZXR1cm4gMTA7Cgl9
CgoJd3ByaW50ZiAoTCJPSyFcbiIpOwoJcmV0dXJuIDA7Cn0K


--94eb2c04363870f52605366226e7
Content-Type: text/plain; charset=us-ascii

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

- Raw text -


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