From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83828 invoked by alias); 29 Jun 2016 03:14:29 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 83818 invoked by uid 89); 29 Jun 2016 03:14:26 -0000 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 Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 29 Jun 2016 03:14:25 +0000 Received: by mail-qk0-f179.google.com with SMTP id a125so65815366qkc.2 for ; Tue, 28 Jun 2016 20:14:25 -0700 (PDT) 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 Received: by 10.237.55.40 with HTTP; Tue, 28 Jun 2016 20:14:22 -0700 (PDT) From: David Lee Date: Wed, 29 Jun 2016 06:32:00 -0000 Message-ID: Subject: Issue creating directories in a VHD volume To: cygwin@cygwin.com Content-Type: multipart/mixed; boundary=94eb2c04363870f52605366226e7 X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00419.txt.bz2 --94eb2c04363870f52605366226e7 Content-Type: text/plain; charset=UTF-8 Content-length: 1682 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 Content-length: 1574 LyoKICogcmVuYW1lIHRvIGRlbW8uYyBhbmQgY29tcGlsZSB1bmRlciBjeWd3 aW4gYXMKICoKICogaTY4Ni13NjQtbWluZ3czMi1nY2MgZGVtby5jIC1sVmly dERpc2sKICovCgojZGVmaW5lIF9XSU4zMl9XSU5OVCAweDYwMQojZGVmaW5l IElOSVRHVUlECgojaW5jbHVkZSA8V2luZG93cy5oPgojaW5jbHVkZSA8Vmly dERpc2suaD4KI2luY2x1ZGUgPHRjaGFyLmg+CiNpbmNsdWRlIDxzdGRpby5o PgoKI2RlZmluZSBWSERQQVRIIEwiRDpcXHRlc3QudmhkIgoKaW50Cm1haW4g KHZvaWQpCnsKCVZJUlRVQUxfU1RPUkFHRV9UWVBFIHZzdDsKCUhBTkRMRSBo VmhkOwoJQVRUQUNIX1ZJUlRVQUxfRElTS19QQVJBTUVURVJTIHBhcmFtczsK CURXT1JEIHJjOwoKCXZzdC5EZXZpY2VJZCA9IFZJUlRVQUxfU1RPUkFHRV9U WVBFX0RFVklDRV9WSEQ7Cgl2c3QuVmVuZG9ySWQgPSBWSVJUVUFMX1NUT1JB R0VfVFlQRV9WRU5ET1JfTUlDUk9TT0ZUOwoKCXJjID0gT3BlblZpcnR1YWxE aXNrICgKCQkmdnN0LAoJCVZIRFBBVEgsCgkJKFZJUlRVQUxfRElTS19BQ0NF U1NfTUFTSykgKFZJUlRVQUxfRElTS19BQ0NFU1NfQVRUQUNIX1JXIHwgVklS VFVBTF9ESVNLX0FDQ0VTU19ERVRBQ0gpLAoJCU9QRU5fVklSVFVBTF9ESVNL X0ZMQUdfTk9ORSwKCQlOVUxMLAoJCSZoVmhkCgkpOwoKCWlmIChyYyAhPSBF UlJPUl9TVUNDRVNTKQoJewoJCWZ3cHJpbnRmIChzdGRlcnIsIEwiT3BlblZp cnR1YWxEaXNrKCkgZmFpbGVkLCByYyA9ICVsdVxuIiwgcmMpOwoJCXJldHVy biAxMDsKCX0KCglwYXJhbXMuVmVyc2lvbiA9IEFUVEFDSF9WSVJUVUFMX0RJ U0tfVkVSU0lPTl8xOwoKCXJjID0gQXR0YWNoVmlydHVhbERpc2sgKAoJCWhW aGQsCgkJTlVMTCwKCQkoQVRUQUNIX1ZJUlRVQUxfRElTS19GTEFHKShBVFRB Q0hfVklSVFVBTF9ESVNLX0ZMQUdfTk9fRFJJVkVfTEVUVEVSIHwgQVRUQUNI X1ZJUlRVQUxfRElTS19GTEFHX1BFUk1BTkVOVF9MSUZFVElNRSksCgkJMCwK CQkmcGFyYW1zLAoJCU5VTEwKCSk7CgoJaWYgKHJjICE9IEVSUk9SX1NVQ0NF U1MpCgl7CgkJZndwcmludGYgKHN0ZGVyciwgTCJBdHRhY2hWaXJ0dWFsRGlz aygpIGZhaWxlZCwgcmMgPSAlbHVcbiIsIHJjKTsKCQlyZXR1cm4gMTA7Cgl9 CgoJd3ByaW50ZiAoTCJPSyFcbiIpOwoJcmV0dXJuIDA7Cn0K --94eb2c04363870f52605366226e7 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- 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--