X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Message-ID: <49FA1C44.6020007@cygwin.com> Date: Thu, 30 Apr 2009 17:46:44 -0400 From: "Larry Hall (Cygwin)" Reply-To: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20090101 Remi/2.0.0.19-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: I'd like to have an unreadable file References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Tim McDaniel wrote: > I'd like to test a script by giving it an unreadable file as an > argument. > > I usually log in as a user, but one that's in the Administrators > group. I made the file (a text file containing just "hello") owned by > user Administrator with absolutely no permissions for anyone else. > > In Windows Explorer, when running as Administrator, it says that > mymachine\tmcdaniel has no permission on the file at all -- I can't > even view permissions as tmcdaniel. > > In cmd, I get > > c:\home\tmcdaniel>type noperm > Access is denied. > > c:\home\tmcdaniel>CACLS noperm > c:\home\tmcdaniel\noperm > Access is denied. > > though I can see some information in other ways: > > c:\home\tmcdaniel>attrib noperm > A C:\home\tmcdaniel\noperm > > c:\home\tmcdaniel>dir noperm > ... > 04/30/2009 02:47 PM 6 noperm > 1 File(s) 6 bytes > > But Cygwin lets me see it just fine. > > $ cd > $ cat noperm > hello > and I can see the contents in vi also. > > So > - how do I manipulate a file so that only the owner user can do > anything with it, even in Cygwin, even if that owner user is in the > Administrators group? > - how is it that Cygwin gives more permission than Windows? > > I am using the latest Cygwin, just updated a few hours ago. Please > let me know if you need more information. It's a known fact that Cygwin allows users that are members of the Adminstrators group access to any file, regardless of it's permissions. This mirrors what an administrator can do in Linux. I haven't investigated a way to try to circumvent this, though I expect a successful attempt would be fragile. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/