]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Explicitly set the owning SID in make_private_security_descriptor.
authorSimon Tatham <anakin@pobox.com>
Tue, 13 May 2014 19:19:28 +0000 (19:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 13 May 2014 19:19:28 +0000 (19:19 +0000)
Philippe Maupertuis reports that on one particular machine, Windows
causes the named pipe created by upstream PuTTY to be owned by the
Administrators group SID rather than the user's SID, which defeats the
security check in the downstream PuTTY. No other machine has been
reported to do this, but nonetheless it's clearly a thing that can
sometimes happen, so we now work around it by specifying explicitly in
the security descriptor for the pipe that its owner should be the user
SID rather than any other SID we might have the right to use.

[originally from svn r10188]

windows/winsecur.c

index d04e88a92370bbb57b0dff65e3dcbabba7d4e1eb..df93a74c5baa4954ecabdb669200f7e8e7af0718 100644 (file)
@@ -187,6 +187,12 @@ int make_private_security_descriptor(DWORD permissions,
         goto cleanup;
     }
 
+    if (!SetSecurityDescriptorOwner(*psd, usersid, FALSE)) {
+        *error = dupprintf("unable to set owner in security descriptor: %s",
+                           win_strerror(GetLastError()));
+        goto cleanup;
+    }
+
     if (!SetSecurityDescriptorDacl(*psd, TRUE, *acl, FALSE)) {
         *error = dupprintf("unable to set DACL in security descriptor: %s",
                            win_strerror(GetLastError()));