Fwd: Windows File permissions are not being inherited - Cygwin 1.7 - Windows 7

Vasya Pupkin cygwin@bsrealm.net
Thu Sep 2 05:37:00 GMT 2010


Will do as soon as I get this thing to at least compile. Actually,
since there is no abstract layer for nt_wfopen(), all calls to this
function have to be modified. Alternatively, the function can be
modified to ignore perms parameter and alternative version of
setup.exe can be compiled then. That is the way I chose, but there is
some problem in another file that I cannot fix myself. You can see my
previous message about that. Regardless, this is the simple patch:

===
--- filemanip.cc        2010-03-01 18:18:39.000000000 +0300
+++ filemanip.cc.new    2010-09-02 09:33:05.094182900 +0400
@@ -433,8 +433,10 @@
   IO_STATUS_BLOCK io;
   UNICODE_STRING uname;
   OBJECT_ATTRIBUTES attr;
+  /*
   SECURITY_DESCRIPTOR sd;
   acl_t acl;
+  */
   const char *c;
   ULONG access, disp;
   int oflags = 0;
@@ -489,11 +491,14 @@
   PWCHAR wname = (PWCHAR) wpath;
   wname[1] = L'?';
   RtlInitUnicodeString (&uname, wname);
+  /*
   InitializeObjectAttributes (&attr, &uname, OBJ_CASE_INSENSITIVE, NULL,
                              disp == FILE_OPEN || perms == 0
                              ? NULL
                              : nt_sec.GetPosixPerms ("", NULL, NULL,
                                                      perms, sd, acl));
+  */
+  InitializeObjectAttributes (&attr, &uname, OBJ_CASE_INSENSITIVE, NULL, NULL);
   status = NtCreateFile (&h, access | SYNCHRONIZE, &attr, &io, NULL,
                         FILE_ATTRIBUTE_NORMAL, FILE_SHARE_VALID_FLAGS, disp,
                         FILE_OPEN_FOR_BACKUP_INTENT
===

Instead of commenting code, defines can be used to allow choosing
required behaviour at compile time.

On Thu, Sep 2, 2010 at 9:12 AM, Christopher Faylor
<cgf-use-the-mailinglist-please@cygwin.com> wrote:
> On Thu, Sep 02, 2010 at 06:08:37AM +0400, Vasya Pupkin wrote:
>>Because I prefer to keep things under control. And I don't think it
>>will require a huge amount of work to disable working with permissions
>>in setup.exe with command line switch.
>
> Well, go ahead then.  What are you waiting for?  Send us a patch.
>
> cgf
>
> --
> 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
>
>

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



More information about the Cygwin mailing list