From 6fe59500e5821ba073c77aaed05ac2fbcb875feb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 25 Sep 2010 20:06:21 +0000 Subject: [PATCH] * fhandler_socket.cc (fhandler_socket::bind): Drop has_exclusiveaddruse condition. Fix comment about availability. Move remaining comment to the right spot. Drop has_ip_helper_lib condition. * net.cc (cygwin_setsockopt): Drop has_disabled_user_tos_setting condition. Fix comment. (get_2k_ifs): Fix comment. (get_nt_ifs): Remove. (getifaddrs): Drop call to get_nt_ifs. (get_ifconf): Ditto. * wincap.cc: Throughout, drop has_ip_helper_lib, has_disabled_user_tos_setting, and has_exclusiveaddruse settings from wincaps. (wincap_unknown): Remove. (wincap_nt4): Remove. (wincap_minimal): New macro, set to wincap_nt4sp4 for now. (wincapc::init): Drop test for pre-SP4 NT4. Just imply at least NT SP4. Replace references to wincap_unknown with references to wincap_minimal. * wincap.h (struct wincaps): Drop has_ip_helper_lib, has_disabled_user_tos_setting, and has_exclusiveaddruse flags and methods. --- winsup/cygwin/ChangeLog | 25 ++- winsup/cygwin/fhandler_socket.cc | 83 +++++----- winsup/cygwin/net.cc | 262 +------------------------------ winsup/cygwin/wincap.cc | 124 +-------------- winsup/cygwin/wincap.h | 6 - 5 files changed, 74 insertions(+), 426 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4bdb63c43..b09ffbade 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,6 +1,29 @@ 2010-09-25 Corinna Vinschen - * autoload.cc: Throughout. order entry points alphabetically by DLL + * fhandler_socket.cc (fhandler_socket::bind): Drop has_exclusiveaddruse + condition. Fix comment about availability. Move remaining comment to + the right spot. Drop has_ip_helper_lib condition. + * net.cc (cygwin_setsockopt): Drop has_disabled_user_tos_setting + condition. Fix comment. + (get_2k_ifs): Fix comment. + (get_nt_ifs): Remove. + (getifaddrs): Drop call to get_nt_ifs. + (get_ifconf): Ditto. + * wincap.cc: Throughout, drop has_ip_helper_lib, + has_disabled_user_tos_setting, and has_exclusiveaddruse settings from + wincaps. + (wincap_unknown): Remove. + (wincap_nt4): Remove. + (wincap_minimal): New macro, set to wincap_nt4sp4 for now. + (wincapc::init): Drop test for pre-SP4 NT4. Just imply at least NT SP4. + Replace references to wincap_unknown with references to wincap_minimal. + * wincap.h (struct wincaps): Drop has_ip_helper_lib, + has_disabled_user_tos_setting, and has_exclusiveaddruse flags and + methods. + +2010-09-25 Corinna Vinschen + + * autoload.cc: Throughout, order entry points alphabetically by DLL and function name. Make functions which are available on all supported systems non-optional. Fix return value on entry points imported from secur32.dll. Add comment. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 82be0ca38..85651c500 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1035,52 +1035,47 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen) } else { - /* If the application didn't explicitely call setsockopt (SO_REUSEADDR), - enforce exclusive local address use using the SO_EXCLUSIVEADDRUSE - socket option, to emulate POSIX socket behaviour more closely. - - KB 870562: Note that this option is only available since NT4 SP4. - Also note that a bug in Win2K SP1-3 and XP up to SP1 only enables - this option for users in the local administrators group. */ - if (wincap.has_exclusiveaddruse ()) + if (!saw_reuseaddr ()) { - if (!saw_reuseaddr ()) - { - int on = 1; - int ret = ::setsockopt (get_socket (), SOL_SOCKET, - ~(SO_REUSEADDR), - (const char *) &on, sizeof on); - debug_printf ("%d = setsockopt (SO_EXCLUSIVEADDRUSE), %E", ret); - } - else if (!wincap.has_enhanced_socket_security ()) + /* If the application didn't explicitely call setsockopt + (SO_REUSEADDR), enforce exclusive local address use using the + SO_EXCLUSIVEADDRUSE socket option, to emulate POSIX socket + behaviour more closely. + + KB 870562: Note that a bug in Win2K SP1-3 and XP up to SP1 only + enables this option for users in the local administrators group. */ + int on = 1; + int ret = ::setsockopt (get_socket (), SOL_SOCKET, + ~(SO_REUSEADDR), + (const char *) &on, sizeof on); + debug_printf ("%d = setsockopt (SO_EXCLUSIVEADDRUSE), %E", ret); + } + else if (!wincap.has_enhanced_socket_security ()) + { + debug_printf ("SO_REUSEADDR set"); + /* There's a bug in SO_REUSEADDR handling in WinSock. + Per standards, we must not be able to reuse a complete + duplicate of a local TCP address (same IP, same port), + even if SO_REUSEADDR has been set. That's unfortunately + possible in WinSock. + + So we're testing here if the local address is already in + use and don't bind, if so. This only works for OSes with + IP Helper support and is, of course, still prone to races. + + However, we don't have to do this on systems supporting + "enhanced socket security" (2K3 and later). On these + systems the default binding behaviour is exactly as you'd + expect for SO_REUSEADDR, while setting SO_REUSEADDR re-enables + the wrong behaviour. So all we have to do on these newer + systems is never to set SO_REUSEADDR but only to note that + it has been set for the above SO_EXCLUSIVEADDRUSE setting. + See setsockopt() in net.cc. */ + if (get_socket_type () == SOCK_STREAM && address_in_use (name)) { - debug_printf ("SO_REUSEADDR set"); - /* There's a bug in SO_REUSEADDR handling in WinSock. - Per standards, we must not be able to reuse a complete - duplicate of a local TCP address (same IP, same port), - even if SO_REUSEADDR has been set. That's unfortunately - possible in WinSock. - - So we're testing here if the local address is already in - use and don't bind, if so. This only works for OSes with - IP Helper support and is, of course, still prone to races. - - However, we don't have to do this on systems supporting - "enhanced socket security" (2K3 and later). On these - systems the default binding behaviour is exactly as you'd - expect for SO_REUSEADDR, while setting SO_REUSEADDR re-enables - the wrong behaviour. So all we have to do on these newer - systems is never to set SO_REUSEADDR but only to note that - it has been set for the above SO_EXCLUSIVEADDRUSE setting. - See setsockopt() in net.cc. */ - if (get_socket_type () == SOCK_STREAM - && wincap.has_ip_helper_lib () - && address_in_use (name)) - { - debug_printf ("Local address in use, don't bind"); - set_errno (EADDRINUSE); - goto out; - } + debug_printf ("Local address in use, don't bind"); + set_errno (EADDRINUSE); + goto out; } } if (::bind (get_socket (), name, namelen)) diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 3e4e45bf4..093abce6c 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -742,11 +742,9 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval, Sidenote: The reasoning for dropping ToS in Win2K is that ToS per RFC 1349 is incompatible with DiffServ per RFC 2474/2475. - We just ignore the return value of setting IP_TOS under Windows - 2000 and above entirely. */ + We just ignore the return value of setting IP_TOS entirely. */ if (level == IPPROTO_IP && optname == IP_TOS - && WSAGetLastError () == WSAEINVAL - && wincap.has_disabled_user_tos_setting ()) + && WSAGetLastError () == WSAEINVAL) { debug_printf ("Faked IP_TOS success"); res = 0; @@ -2034,8 +2032,7 @@ done: } /* - * Get network interfaces NTSP4, W2K, XP w/o service packs. - * Use IP Helper Library + * Get network interfaces up to XP w/o service packs. */ static struct ifall * get_2k_ifs () @@ -2232,251 +2229,6 @@ done: return ifret; } -/* - * Get network interfaces Windows NT < SP4: - * Look at the Bind value in - * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\ - * This is a REG_MULTI_SZ with strings of the form: - * \Device\, where netcard is the name of the net device. - * Then look under: - * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\ - * Parameters\Tcpip - * at the IPAddress, Subnetmask and DefaultGateway values for the - * required values. - * Also fake "lo" since there's no representation in the registry. - */ -static struct ifall * -get_nt_ifs () -{ - HKEY key; - LONG ret; - struct ifall *ifret = NULL, *ifp; - unsigned long lip, lnp; - struct sockaddr_in *sin = NULL; - DWORD size; - int cnt = 0, idx; - char *binding = NULL; - - if ((ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, - "SYSTEM\\" - "CurrentControlSet\\" - "Services\\" - "Tcpip\\" "Linkage", - 0, KEY_READ, &key)) == ERROR_SUCCESS) - { - if ((ret = RegQueryValueEx (key, "Bind", NULL, NULL, - NULL, &size)) == ERROR_SUCCESS) - { - binding = (char *) alloca (size); - if ((ret = RegQueryValueEx (key, "Bind", NULL, NULL, - (unsigned char *) binding, - &size)) != ERROR_SUCCESS) - binding = NULL; - } - RegCloseKey (key); - } - - if (!binding) - { - __seterrno_from_win_error (ret); - return NULL; - } - - char *bp, eth[2] = "/"; - char cardkey[256], ipaddress[256], netmask[256]; - - for (bp = binding; *bp; bp += strlen (bp) + 1) - { - bp += strlen ("\\Device\\"); - strcpy (cardkey, "SYSTEM\\CurrentControlSet\\Services\\"); - strcat (cardkey, bp); - strcat (cardkey, "\\Parameters\\Tcpip"); - - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, cardkey, - 0, KEY_READ, &key) != ERROR_SUCCESS) - continue; - - if (RegQueryValueEx (key, "IPAddress", - NULL, NULL, - (unsigned char *) ipaddress, - (size = 256, &size)) == ERROR_SUCCESS - && RegQueryValueEx (key, "SubnetMask", - NULL, NULL, - (unsigned char *) netmask, - (size = 256, &size)) == ERROR_SUCCESS) - ++cnt; - RegCloseKey (key); - } - ++cnt; /* loopback */ - if (!(ifret = (struct ifall *) malloc (cnt * sizeof (struct ifall)))) - return NULL; - /* Set up lo interface first */ - idx = 0; - ifp = ifret + idx; - memset (ifp, 0, sizeof *ifp); - /* Next in chain */ - ifp->ifa_ifa.ifa_next = (struct ifaddrs *) &ifp[1].ifa_ifa; - /* Interface name */ - strcpy (ifp->ifa_name, "lo"); - ifp->ifa_ifa.ifa_name = ifp->ifa_name; - /* Flags */ - ifp->ifa_ifa.ifa_flags = IFF_UP | IFF_LOWER_UP | IFF_RUNNING | IFF_LOOPBACK; - /* Address */ - sin = (struct sockaddr_in *) &ifp->ifa_addr; - sin->sin_addr.s_addr = htonl (INADDR_LOOPBACK); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_addr = (struct sockaddr *) &ifp->ifa_addr; - /* Netmask */ - sin = (struct sockaddr_in *) &ifp->ifa_netmask; - sin->sin_addr.s_addr = htonl (IN_CLASSA_NET); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask; - /* Broadcast address */ - sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr; - sin->sin_addr.s_addr = htonl (INADDR_LOOPBACK | IN_CLASSA_HOST); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *) &ifp->ifa_brddstaddr; - /* Hardware address */ - ; // Nothing to do... */ - /* Metric */ - ifp->ifa_metric = 1; - /* MTU */ - ifp->ifa_mtu = 1520; /* Default value for MS TCP Loopback interface. */ - /* Interface index */ - ifp->ifa_ifindex = -1; - /* Friendly name */ - struct ifreq_frndlyname *iff = (struct ifreq_frndlyname *) - &ifp->ifa_frndlyname; - strcpy (iff->ifrf_friendlyname, "Default loopback"); - iff->ifrf_len = 16; - - for (bp = binding; *bp; bp += strlen (bp) + 1) - { - bp += strlen ("\\Device\\"); - strcpy (cardkey, "SYSTEM\\CurrentControlSet\\Services\\"); - strcat (cardkey, bp); - strcat (cardkey, "\\Parameters\\Tcpip"); - - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, cardkey, - 0, KEY_READ, &key) != ERROR_SUCCESS) - continue; - - if (RegQueryValueEx (key, "IPAddress", - NULL, NULL, - (unsigned char *) ipaddress, - (size = 256, &size)) == ERROR_SUCCESS - && RegQueryValueEx (key, "SubnetMask", - NULL, NULL, - (unsigned char *) netmask, - (size = 256, &size)) == ERROR_SUCCESS) - { - char *ip, *np; - char dhcpaddress[256], dhcpnetmask[256]; - bool ppp = false; - - for (ip = ipaddress, np = netmask; - *ip && *np; - ip += strlen (ip) + 1, np += strlen (np) + 1) - { - bool dhcp = false; - if (cygwin_inet_addr (ip) == 0L - && RegQueryValueEx (key, "DhcpIPAddress", - NULL, NULL, - (unsigned char *) dhcpaddress, - (size = 256, &size)) - == ERROR_SUCCESS - && RegQueryValueEx (key, "DhcpSubnetMask", - NULL, NULL, - (unsigned char *) dhcpnetmask, - (size = 256, &size)) - == ERROR_SUCCESS) - dhcp = true; - if (++idx == cnt - && !(ifp = (struct ifall *) - realloc (ifret, ++cnt * sizeof (struct ifall)))) - { - free (ifret); - return NULL; - } - ifp = ifret + idx; - memset (ifp, 0, sizeof *ifp); - /* Next in chain */ - ifp->ifa_ifa.ifa_next = (struct ifaddrs *) &ifp[1].ifa_ifa; - /* Interface name */ - if (!strncmp (bp, "NdisWan", 7)) - { - strcpy (ifp->ifa_name, "ppp"); - strcat (ifp->ifa_name, bp + 7); - ppp = true; - } - else - { - ++*eth; - strcpy (ifp->ifa_name, "eth"); - strcat (ifp->ifa_name, eth); - } - ifp->ifa_ifa.ifa_name = ifp->ifa_name; - /* Flags */ - ifp->ifa_ifa.ifa_flags = IFF_UP | IFF_LOWER_UP | IFF_RUNNING; - if (ppp) - ifp->ifa_ifa.ifa_flags |= IFF_POINTOPOINT | IFF_NOARP; - else - ifp->ifa_ifa.ifa_flags |= IFF_BROADCAST; - /* Address */ - sin = (struct sockaddr_in *) &ifp->ifa_addr; - sin->sin_addr.s_addr = cygwin_inet_addr (dhcp ? dhcpaddress : ip); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_addr = (struct sockaddr *) &ifp->ifa_addr; - /* Netmask */ - sin = (struct sockaddr_in *) &ifp->ifa_netmask; - sin->sin_addr.s_addr = cygwin_inet_addr (dhcp ? dhcpnetmask : np); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask; - if (ppp) - { - /* Destination address */ - sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr; - sin->sin_addr.s_addr = - cygwin_inet_addr (dhcp ? dhcpaddress : ip); - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_dstaddr = (struct sockaddr *) - &ifp->ifa_brddstaddr; - } - else - { - /* Broadcast address */ - lip = cygwin_inet_addr (dhcp ? dhcpaddress : ip); - lnp = cygwin_inet_addr (dhcp ? dhcpnetmask : np); - sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr; - sin->sin_addr.s_addr = (lip & lnp) | ~lnp; - sin->sin_family = AF_INET; - ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *) - &ifp->ifa_brddstaddr; - } - /* Hardware address */ - ; // Nothing to do... */ - /* Metric */ - ifp->ifa_metric = 1; - /* MTU */ - ifp->ifa_mtu = 1500; - /* Interface index */ - ifp->ifa_ifindex = -1; - /* Friendly name */ - struct ifreq_frndlyname *iff = (struct ifreq_frndlyname *) - &ifp->ifa_frndlyname; - strcpy (iff->ifrf_friendlyname, bp); - iff->ifrf_len = strlen (iff->ifrf_friendlyname); - } - } - RegCloseKey (key); - } - /* Since every entry is set to the next entry, the last entry points to an - invalid next entry now. Fix it retroactively. */ - if (ifp > ifret) - ifp->ifa_ifa.ifa_next = NULL; - return ifret; -} - extern "C" int getifaddrs (struct ifaddrs **ifap) { @@ -2488,10 +2240,8 @@ getifaddrs (struct ifaddrs **ifap) struct ifall *ifp; if (wincap.has_gaa_prefixes () && !CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ) ifp = get_xp_ifs (AF_UNSPEC); - else if (wincap.has_ip_helper_lib ()) - ifp = get_2k_ifs (); else - ifp = get_nt_ifs (); + ifp = get_2k_ifs (); *ifap = &ifp->ifa_ifa; return ifp ? 0 : -1; } @@ -2520,10 +2270,8 @@ get_ifconf (struct ifconf *ifc, int what) struct ifall *ifret, *ifp; if (wincap.has_gaa_prefixes () && !CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ) ifret = get_xp_ifs (AF_INET); - else if (wincap.has_ip_helper_lib ()) - ifret = get_2k_ifs (); else - ifret = get_nt_ifs (); + ifret = get_2k_ifs (); if (!ifret) return -1; diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 3d5bee99b..2cf562c57 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -20,90 +20,8 @@ details. */ in the same session. I'm only writing this longish comment because I'm puzzled that this has never been noticed before... */ -/* Minimal set of capabilities which is equivalent to NT4. */ -wincaps wincap_unknown __attribute__((section (".cygwin_dll_common"), shared)) = { - chunksize:0, - heapslop:0x0, - max_sys_priv:SE_CHANGE_NOTIFY_PRIVILEGE, - is_server:false, - has_dacl_protect:false, - has_ip_helper_lib:false, - has_broken_if_oper_status:false, - has_physical_mem_access:true, - has_process_io_counters:false, - has_terminal_services:false, - has_create_global_privilege:false, - has_ioctl_storage_get_media_types_ex:false, - has_extended_priority_class:false, - has_guid_volumes:false, - has_disk_ex_ioctls:false, - has_disabled_user_tos_setting:false, - has_fileid_dirinfo:false, - has_exclusiveaddruse:false, - has_enhanced_socket_security:false, - has_buggy_restart_scan:false, - has_mandatory_integrity_control:false, - needs_logon_sid_in_sid_list:true, - needs_count_in_si_lpres2:false, - has_recycle_dot_bin:false, - has_gaa_prefixes:false, - has_gaa_on_link_prefix:false, - supports_all_posix_ai_flags:false, - has_restricted_stack_args:false, - has_transactions:false, - ts_has_dep_problem:false, - has_recvmsg:false, - has_sendmsg:false, - has_broken_udf:false, - has_console_handle_problem:false, - has_broken_alloc_console:false, - has_always_all_codepages:false, - has_localenames:false, - has_mwmo_inputavailable:false, - has_buggy_thread_startup:false, -}; - -wincaps wincap_nt4 __attribute__((section (".cygwin_dll_common"), shared)) = { - chunksize:0, - heapslop:0x0, - max_sys_priv:SE_CHANGE_NOTIFY_PRIVILEGE, - is_server:false, - has_dacl_protect:false, - has_ip_helper_lib:false, - has_broken_if_oper_status:false, - has_physical_mem_access:true, - has_process_io_counters:false, - has_terminal_services:false, - has_create_global_privilege:false, - has_ioctl_storage_get_media_types_ex:false, - has_extended_priority_class:false, - has_guid_volumes:false, - has_disk_ex_ioctls:false, - has_disabled_user_tos_setting:false, - has_fileid_dirinfo:false, - has_exclusiveaddruse:false, - has_enhanced_socket_security:false, - has_buggy_restart_scan:false, - has_mandatory_integrity_control:false, - needs_logon_sid_in_sid_list:true, - needs_count_in_si_lpres2:false, - has_recycle_dot_bin:false, - has_gaa_prefixes:false, - has_gaa_on_link_prefix:false, - supports_all_posix_ai_flags:false, - has_restricted_stack_args:false, - has_transactions:false, - ts_has_dep_problem:false, - has_recvmsg:false, - has_sendmsg:false, - has_broken_udf:false, - has_console_handle_problem:false, - has_broken_alloc_console:false, - has_always_all_codepages:false, - has_localenames:false, - has_mwmo_inputavailable:false, - has_buggy_thread_startup:false, -}; +/* Minimal set of capabilities required to run Cygwin. */ +#define wincap_minimal wincap_nt4sp4 wincaps wincap_nt4sp4 __attribute__((section (".cygwin_dll_common"), shared)) = { chunksize:0, @@ -111,7 +29,6 @@ wincaps wincap_nt4sp4 __attribute__((section (".cygwin_dll_common"), shared)) = max_sys_priv:SE_CHANGE_NOTIFY_PRIVILEGE, is_server:false, has_dacl_protect:false, - has_ip_helper_lib:true, has_broken_if_oper_status:true, has_physical_mem_access:true, has_process_io_counters:false, @@ -121,9 +38,7 @@ wincaps wincap_nt4sp4 __attribute__((section (".cygwin_dll_common"), shared)) = has_extended_priority_class:false, has_guid_volumes:false, has_disk_ex_ioctls:false, - has_disabled_user_tos_setting:false, has_fileid_dirinfo:false, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, @@ -153,7 +68,6 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:true, has_process_io_counters:true, @@ -163,9 +77,7 @@ wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:false, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:true, has_mandatory_integrity_control:false, @@ -195,7 +107,6 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:true, has_process_io_counters:true, @@ -205,9 +116,7 @@ wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:false, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:true, has_mandatory_integrity_control:false, @@ -237,7 +146,6 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:true, has_process_io_counters:true, @@ -247,9 +155,7 @@ wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, @@ -279,7 +185,6 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:true, has_process_io_counters:true, @@ -289,9 +194,7 @@ wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, @@ -321,7 +224,6 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:true, has_process_io_counters:true, @@ -331,9 +233,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:false, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, @@ -363,7 +263,6 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE, is_server:true, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:false, has_process_io_counters:true, @@ -373,9 +272,7 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:false, @@ -405,7 +302,6 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:false, has_process_io_counters:true, @@ -415,9 +311,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:true, @@ -447,7 +341,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE, is_server:false, has_dacl_protect:true, - has_ip_helper_lib:true, has_broken_if_oper_status:false, has_physical_mem_access:false, has_process_io_counters:true, @@ -457,9 +350,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_extended_priority_class:true, has_guid_volumes:true, has_disk_ex_ioctls:true, - has_disabled_user_tos_setting:true, has_fileid_dirinfo:true, - has_exclusiveaddruse:true, has_enhanced_socket_security:true, has_buggy_restart_scan:false, has_mandatory_integrity_control:true, @@ -510,11 +401,8 @@ wincapc::init () switch (version.dwMajorVersion) { case 4: - if (!has_osversioninfoex - && strcmp (version.szCSDVersion, "Service Pack 4") < 0) - caps = &wincap_nt4; - else - caps = &wincap_nt4sp4; + /* No mercy. We require at least NT4 SP4. */ + caps = &wincap_nt4sp4; break; case 5: switch (version.dwMinorVersion) @@ -555,7 +443,7 @@ wincapc::init () } break; default: - caps = &wincap_unknown; + caps = &wincap_minimal; break; } break; @@ -565,7 +453,7 @@ wincapc::init () api_fatal ("Windows 95/98/Me are not supported."); break; default: - caps = &wincap_unknown; + caps = &wincap_minimal; break; } diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index b8809b0f9..315d4d51e 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -19,7 +19,6 @@ struct wincaps DWORD max_sys_priv; unsigned is_server : 1; unsigned has_dacl_protect : 1; - unsigned has_ip_helper_lib : 1; unsigned has_broken_if_oper_status : 1; unsigned has_physical_mem_access : 1; unsigned has_process_io_counters : 1; @@ -29,9 +28,7 @@ struct wincaps unsigned has_extended_priority_class : 1; unsigned has_guid_volumes : 1; unsigned has_disk_ex_ioctls : 1; - unsigned has_disabled_user_tos_setting : 1; unsigned has_fileid_dirinfo : 1; - unsigned has_exclusiveaddruse : 1; unsigned has_enhanced_socket_security : 1; unsigned has_buggy_restart_scan : 1; unsigned has_mandatory_integrity_control : 1; @@ -77,7 +74,6 @@ public: DWORD IMPLEMENT (max_sys_priv) bool IMPLEMENT (is_server) bool IMPLEMENT (has_dacl_protect) - bool IMPLEMENT (has_ip_helper_lib) bool IMPLEMENT (has_broken_if_oper_status) bool IMPLEMENT (has_physical_mem_access) bool IMPLEMENT (has_process_io_counters) @@ -87,9 +83,7 @@ public: bool IMPLEMENT (has_extended_priority_class) bool IMPLEMENT (has_guid_volumes) bool IMPLEMENT (has_disk_ex_ioctls) - bool IMPLEMENT (has_disabled_user_tos_setting) bool IMPLEMENT (has_fileid_dirinfo) - bool IMPLEMENT (has_exclusiveaddruse) bool IMPLEMENT (has_enhanced_socket_security) bool IMPLEMENT (has_buggy_restart_scan) bool IMPLEMENT (has_mandatory_integrity_control) -- 2.43.5