--- origsrc/screen-4.6.2/socket.c 2017-10-23 20:32:41.000000000 +0900 +++ src/screen-4.6.2/socket.c 2019-03-09 00:19:12.463762700 +0900 @@ -537,6 +537,9 @@ xseteuid(real_uid); xsetegid(real_gid); # endif +#ifdef __CYGWIN__ + setsockopt(s, SOL_SOCKET, SO_PEERCRED, NULL, 0); +#endif if (connect(s, (struct sockaddr *) &a, strlen(SockPath) + 2) != -1) { debug("oooooh! socket already is alive!\n"); @@ -588,6 +591,9 @@ chown(SockPath, real_uid, real_gid); #endif #endif /* SOCK_NOT_IN_FS */ +#ifdef __CYGWIN__ + setsockopt(s, SOL_SOCKET, SO_PEERCRED, NULL, 0); +#endif if (listen(s, 5) == -1) Panic(errno, "listen"); #ifdef F_SETOWN @@ -628,6 +634,9 @@ return -1; } #endif +#ifdef __CYGWIN__ + setsockopt(s, SOL_SOCKET, SO_PEERCRED, NULL, 0); +#endif if (connect(s, (struct sockaddr *)&a, strlen(SockPath) + 2) == -1) { if (err) @@ -1343,6 +1352,9 @@ if (stat(sap->sun_path, &st)) return -1; chmod(sap->sun_path, 0); +#ifdef __CYGWIN__ + setsockopt(s, SOL_SOCKET, SO_PEERCRED, NULL, 0); +#endif x = connect(s, (struct sockaddr *) sap, len); chmod(sap->sun_path, st.st_mode); return x;