This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: I'd like to have an unreadable file


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]