X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_VT,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4D712D7A.30000@redhat.com> Date: Fri, 04 Mar 2011 11:20:42 -0700 From: Eric Blake User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: LS and TAR don't see any file permissions ("ls -l" shows "----------+ ...") References: In-Reply-To: OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigDD0B9A7A8EE2764B6680845E" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enigDD0B9A7A8EE2764B6680845E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/04/2011 11:12 AM, Peter Binney wrote: > When running "ls -l" the permissions field shows as "----------+". Which means that the owner has no permissions, but that there are ACLs which allow others permissions. Not entirely unusual, given Windows' ability to create files with a different owner than the current user, while allowing the current user to access the file (typically when done to places like the desktop, and caused by inheritance ACLs present on the directory where the problematic file is being created in the first place). > Oddly, "ls -l" shows the correct permissions if the pathname uses the > windows drive letter syntax. eg: >=20 > $ pwd > /cygdrive/c > $ ls -l tmp/plb.txt > ----------+ 1 ga2binn Domain Users 5527 Mar 3 13:54 tmp/plb.txt > $ ls -l c:/tmp/plb.txt > -rw-r--r-- 1 ga2binn Domain Users 5527 Mar 3 13:54 c:/tmp/plb.txt That's because using a dos-style path disregards ACL parsing, and fakes the permission bits instead. The + shows that ACLs are present, and 'getfacl tmp/plb.txt' will show you the difference between the owner and your permissions. > Similarly, TAR images have no permissions on the files contained. eg: >=20 > $ pwd > /cygdrive/c/tmp > $ tar cf - plb.txt | tar vtf - > ---------- ga2binn/Domain Users 5527 2011-03-03 13:54 plb.txt Here, the problem is that tar doesn't preserve ACLs by default, so the original POSIX mode (000) is preserved while the ACLs are lost, resulting in an truly inaccessible file (note that there is no longer a + in the listing). >=20 > Even more oddly, this behaviour (both LS and TAR) occurs on a new PC > that I am moving to. That's another big case where the user ids on the old pc do not correpsond to the user ids on the new pc; copying preserved the old user id, but gave ACL access to the new user, resulting in odd permissions. --=20 Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigDD0B9A7A8EE2764B6680845E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNcS16AAoJEKeha0olJ0Nq1TQH/AgcQYCYfSV+LgFBc+a86H3/ RMEXysLjOdj1VwjS7QIQlsQfDi2AWPx9Q/+rHbBzBphBcx39Z/wTWKALw5MmkkBy hSGIqUoh9coEcuMFM1ASH0QQgwc6EzTdPLyNILXylV5xYjMpxFBvWXk6W4mpQ3o9 hh5reroL84ilF8cAUH0ye03ZMlAf6b3YfuqL/GM5hfcm2E9LTCXhawgk0OVdoRA8 syA9hE4J0zvwxq0mds6Azt1zdx+uEy62ZH6tlS5f0sV4HyYjPtzXcoU47BmCGvwy Eh3PjWxg0pPBi7S8WqNgljfpuF6vd+XkfcNYOovARk4jkqO3jC3KSwjdCkavOag= =N9xQ -----END PGP SIGNATURE----- --------------enigDD0B9A7A8EE2764B6680845E--