This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cp creates unreadable file on Windows 7
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: "Frank, Matthew I" <matthew dot i dot frank at intel dot com>, cygwin at cygwin dot com
- Date: Thu, 10 Oct 2013 06:50:14 +0400
- Subject: Re: cp creates unreadable file on Windows 7
- Authentication-results: sourceware.org; auth=none
- References: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6421A227 at FMSMSX106 dot amr dot corp dot intel dot com>
- Reply-to: Andrey Repin <cygwin at cygwin dot com>
Greetings, Frank, Matthew I!
> I believe my problem is identical to the one reported in:
> http://cygwin.com/ml/cygwin/2012-02/msg00456.html, but that message chain ended with
> "mount your file system noacl" which isn't an option for me, so I'm looking for
> other alternatives.
Please explain, how it is not an option for you?
> I create a file using cmd.exe in a directory created by cmd.exe. Then in Cygwin bash I
> mkdir a directory (two levels deep) and cp the file into the new directory. The resulting
> file is not readable by any Windows or Cygwin executable. I can't say whether this is
> correct or not, but it surprised me.
> I am on a corporate network (logged in using network credentials). The filesystem is NTFS,
> the machine is Windows 7. I am an Administrator on the machine. I am using the new 64-bit
> Cygwin installed in c:\users\mifrank\cygwin64, but the problem was originally reported by
> several of my users, and they are using slightly older 32-bit versions of Cygwin installed
> in c:\cygwin.
> Reproducer. Step 1 (must be done in a cmd.exe shell.)
> C:\>md dos-level1
> C:\>echo foo > dos-level1\bar
> C:\>cat dos-level1\bar
> foo
> C:\>icacls.exe dos-level1\
> dos-level1\ BUILTIN\Administrators:(I)(F)
> BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
> NT AUTHORITY\SYSTEM:(I)(F)
> NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
> BUILTIN\Users:(I)(OI)(CI)(RX)
> NT AUTHORITY\Authenticated Users:(I)(M)
> NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)
> Successfully processed 1 files; Failed processing 0 files
> C:\>icacls.exe dos-level1\bar
> dos-level1\bar BUILTIN\Administrators:(I)(F)
> NT AUTHORITY\SYSTEM:(I)(F)
> BUILTIN\Users:(I)(RX)
> NT AUTHORITY\Authenticated Users:(I)(M)
> Successfully processed 1 files; Failed processing 0 files
> Step 2 (from Cygwin bash shell)
> $ cygcheck -V
> cygcheck (cygwin) 1.7.25
> $ cd /cygdrive/c/
> $ groups
> Domain Users Users
> $ umask
> 0022
> $ mkdir --parents cyg-level1/cyg-level2
> $ cat dos-level1/bar
> foo
> $ cp dos-level1/bar cyg-level1/cyg-level2/
> $ cat cyg-level1/cyg-level2/bar
> cat: cyg-level1/cyg-level2/bar: Permission denied
> $ icacls.exe cyg-level1/cyg-level2/
> cyg-level1/cyg-level2/ AMR\mifrank:(F)
> AMR\Domain Users:(RX)
> Everyone:(RX)
> BUILTIN\Administrators:(F)
> NT AUTHORITY\SYSTEM:(F)
> BUILTIN\Users:(RX)
> NT AUTHORITY\Authenticated Users:(M)
> CREATOR OWNER:(OI)(CI)(IO)(F)
> CREATOR GROUP:(OI)(CI)(IO)(RX)
> Everyone:(OI)(CI)(IO)(RX)
> Successfully processed 1 files; Failed processing 0 files
> $ icacls.exe cyg-level1/cyg-level2/bar
> cyg-level1/cyg-level2/bar AMR\mifrank:(D,Rc,WDAC,WO,RA,WA)
> AMR\Domain Users:(Rc,S,RA)
> Everyone:(Rc,S,RA)
> Successfully processed 1 files; Failed processing 0 files
> On the other hand:
> $ echo fromcyg > cyg-level1/cyg-level2/baz
> $ cat cyg-level1/cyg-level2/baz
> fromcyg
> $ icacls.exe cyg-level1/cyg-level2/baz
> cyg-level1/cyg-level2/baz AMR\mifrank:(R,W,D,WDAC,WO)
> AMR\Domain Users:(R)
> Everyone:(R)
> Successfully processed 1 files; Failed processing 0 files
This sounds exactly like an issue you would run while trying to mix Cygwin ACL
and corporate environment.
TL;DR: Choose one. Either corporate-enforced ACL control, and disable Cygwin
emulation of POSIX permissions, or Cygwin ACLs and keep away from corporate
environments.
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 10.10.2013, <06:44>
Sorry for my terrible english...
--
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