summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 176838de8..1ab5170ea 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -882,8 +882,10 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
fattr |= FILE_ATTRIBUTE_READONLY;
SECURITY_ATTRIBUTES sa = sec_none_nih;
security_descriptor sd;
- if (pc.has_acls ())
- set_security_attribute (mode, &sa, sd);
+ /* See comments in fhander_base::open () for an explanation why we defer
+ setting security attributes on remote files. */
+ if (pc.has_acls () && !pc.isremote ())
+ set_security_attribute (pc, mode, &sa, sd);
NTSTATUS status;
HANDLE fh;
OBJECT_ATTRIBUTES attr;
@@ -904,6 +906,8 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
}
else
{
+ if (pc.has_acls () && pc.isremote ())
+ set_file_attribute (fh, pc, ILLEGAL_UID, ILLEGAL_GID, mode);
char buf[sizeof (SOCKET_COOKIE) + 80];
__small_sprintf (buf, "%s%u %c ", SOCKET_COOKIE, sin.sin_port,
get_socket_type () == SOCK_STREAM ? 's'