don't list windows capabilities in windows uname

we never used them, and maybe it's a bad idea to publish them
This commit is contained in:
Roger Dingledine 2010-01-12 12:17:07 -05:00
parent f6e8fcfe7a
commit 356c927476

View File

@ -1608,7 +1608,6 @@ get_uname(void)
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
OSVERSIONINFOEX info; OSVERSIONINFOEX info;
int i; int i;
unsigned int leftover_mask;
const char *plat = NULL; const char *plat = NULL;
const char *extra = NULL; const char *extra = NULL;
static struct { static struct {
@ -1625,25 +1624,6 @@ get_uname(void)
{ 3, 51, "Windows NT 3.51" }, { 3, 51, "Windows NT 3.51" },
{ 0, 0, NULL } { 0, 0, NULL }
}; };
#ifdef VER_SUITE_BACKOFFICE
static struct {
unsigned int mask; const char *str;
} win_mask_table[] = {
{ VER_SUITE_BACKOFFICE, " {backoffice}" },
{ VER_SUITE_BLADE, " {\"blade\" (2003, web edition)}" },
{ VER_SUITE_DATACENTER, " {datacenter}" },
{ VER_SUITE_ENTERPRISE, " {enterprise}" },
{ VER_SUITE_EMBEDDEDNT, " {embedded}" },
{ VER_SUITE_PERSONAL, " {personal}" },
{ VER_SUITE_SINGLEUSERTS,
" {terminal services, single user}" },
{ VER_SUITE_SMALLBUSINESS, " {small business}" },
{ VER_SUITE_SMALLBUSINESS_RESTRICTED,
" {small business, restricted}" },
{ VER_SUITE_TERMINAL, " {terminal services}" },
{ 0, NULL },
};
#endif
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.dwOSVersionInfoSize = sizeof(info); info.dwOSVersionInfoSize = sizeof(info);
if (! GetVersionEx((LPOSVERSIONINFO)&info)) { if (! GetVersionEx((LPOSVERSIONINFO)&info)) {
@ -1702,18 +1682,6 @@ get_uname(void)
} else if (info.wProductType == VER_NT_WORKSTATION) { } else if (info.wProductType == VER_NT_WORKSTATION) {
strlcat(uname_result, " [workstation]", sizeof(uname_result)); strlcat(uname_result, " [workstation]", sizeof(uname_result));
} }
leftover_mask = info.wSuiteMask;
for (i = 0; win_mask_table[i].mask; ++i) {
if (info.wSuiteMask & win_mask_table[i].mask) {
strlcat(uname_result, win_mask_table[i].str, sizeof(uname_result));
leftover_mask &= ~win_mask_table[i].mask;
}
}
if (leftover_mask) {
size_t len = strlen(uname_result);
tor_snprintf(uname_result+len, sizeof(uname_result)-len,
" {0x%x}", info.wSuiteMask);
}
#endif #endif
#else #else
strlcpy(uname_result, "Unknown platform", sizeof(uname_result)); strlcpy(uname_result, "Unknown platform", sizeof(uname_result));