delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/10/17/04:03:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Rocket-MIMEInfo: 001.001,T24gT2N0IDE2IENvcmlubmEgVmluc2NoZW4gd3JvdGU6Cj4gT24gT2N0IDE1IDIzOjU1LCBHcmFoYW1DIHdyb3RlOgo.ID4gQW5vdGhlciBhbm9tYWx5IHdpdGggZGlzayBkcml2ZSBwYXJ0aXRpb24gZGV2aWNlcyAoL2Rldi9zZFgxLCAvZGV2L3NkWDIgZXRjLikgaXMgdGhlIGFjY2VzcyBjb250cm9sLgo.ID4gwqAKPiA.IFdoaWxlIHRoZSB3aG9sZSBkaXNrIGRldmljZXMgKC9kZXYvc2RYKSBjYW4gb25seSBiZSBhY2Nlc3NlZCB3aGVuIHJ1bm5pbmcgYXMgYWRtaW5pc3RyYXRvciwgdGhlCj4gPiBpbmRpdmkBMAEBAQE-
References: <CALtVTxS-g26AMU7s0o6zr2K4oK4ok=WxSCPUub62gpMVM6qNrA AT mail DOT gmail DOT com> <1350329081 DOT 35214 DOT YahooMailNeo AT web171406 DOT mail DOT ir2 DOT yahoo DOT com> <20121015193636 DOT GC25877 AT calimero DOT vinschen DOT de> <1350331470 DOT 1670 DOT YahooMailNeo AT web171403 DOT mail DOT ir2 DOT yahoo DOT com> <1350341744 DOT 91309 DOT YahooMailNeo AT web171405 DOT mail DOT ir2 DOT yahoo DOT com> <20121016085907 DOT GF25877 AT calimero DOT vinschen DOT de>
Message-ID: <1350461007.66056.YahooMailNeo@web171406.mail.ir2.yahoo.com>
Date: Wed, 17 Oct 2012 09:03:27 +0100 (BST)
From: GrahamC <grahamc001uk AT yahoo DOT co DOT uk>
Reply-To: GrahamC <grahamc001uk AT yahoo DOT co DOT uk>
Subject: Re: Cygwin for Windows 8
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
In-Reply-To: <20121016085907.GF25877@calimero.vinschen.de>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q9H83jhN015106

On Oct 16 Corinna Vinschen wrote:
> On Oct 15 23:55, GrahamC wrote:
> > Another anomaly with disk drive partition devices (/dev/sdX1, /dev/sdX2 etc.) is the access control.
> >  
> > While the whole disk devices (/dev/sdX) can only be accessed when running as administrator, the
> > individual partition devices (/dev/sdX1, /dev/sdX2 etc.) can be both read and written without
> > needing administrator mode.
>
> Access control is not done inside Cygwin.  The permissions on the block
> devices are set by Windows.  If you want to take a closer look,  see
> the mapping of the native namespace into the Cygwin /proc/sys namespace.
> Look at everything under /proc/sys/Device/Harddisk*, but make sure you're
> admin, otherwise you won't see everything.  If you want to take an even
> closer look, I suggest to download the winobj tool from sysinternal.  It
> also provides a detailed ACL view.
>
> Device creation is based on what Windows creates. Cygwin only looks
> which devices exist in the internal native namespace and maps those to
> the equivalent POSIX device names.  If a \Device\HarddiskX\PartitionY
> exists, then /dev/sd<X>Y exists in Cygwin, with <X> being 'a' + X.
>
> As for the missing ~70 sectors, I'm not sure.  How do you know?  Does
> the number of KBs you can read differ by this amount from the KBs given
> in /proc/partitions?  
>
> Maybe that's the missing call to FSCTL_ALLOW_EXTENDED_DASD_IO.  Cygwin's
> block device code only calls this Windows ioctl code for full disks, not
> for partitions on the disk.  I fixed that in CVS, though.  Can you give
> the today's snapshot from http://cygwin.com/snapshots/ a try, please?


OK, the 20121016 snapshot of cygwin1.dll fixed the data truncation 
problem. The number of sectors readable from the /dev/sdXY 
devices now match the partition sizes.
 
My missing partition devices appears to be an incompatibility between
the Linux parted tool and Windows. The former puts a 6 byte disk ID in the
partition sector at position 0x1b8..0x1bd, Windows uses the first 4 bytes only
and if two disks have the same value it doesn't create volumes for the second disk. 
Patching the ID to a unique value in the first 4 bytes made the missing partitions
appear at next boot up. 

Non-administrator read and write access to /dev/sdXY devices appears to 
be limited to the USB flash devices. The WinObj tool shows the 
group INTERACTIVE having read and write access to these. I suppose this 
makes sense from the Windows point of view. WinObj also shows group 
Everyone has read access to the raw disk devices DR0, DR1, DR2 etc., 
but that doesn't seem to make it through to the /dev/sdX devices (not 
that I would want it to).

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