/*
- * $Id: defines.h,v 1.96 2001/10/08 16:55:25 hno Exp $
+ * $Id: defines.h,v 1.97 2001/11/17 11:09:24 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#define O_BINARY 0
#endif
-/* CygWin & Windows NT Port */
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
-#define _WIN_OS_UNKNOWN 0
-#define _WIN_OS_WIN32S 1
-#define _WIN_OS_WIN95 2
-#define _WIN_OS_WIN98 3
-#define _WIN_OS_WINNT 4
-#define _WIN_OS_WIN2K 5
-#define _WIN_OS_WINXP 6
-#endif
-
#endif /* SQUID_DEFINES_H */
/*
- * $Id: dns_internal.cc,v 1.44 2001/10/24 07:45:34 hno Exp $
+ * $Id: dns_internal.cc,v 1.45 2001/11/17 11:09:24 hno Exp $
*
* DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c
* AUTHOR: Duane Wessels
break;
case _WIN_OS_WIN95:
case _WIN_OS_WIN98:
+ case _WIN_OS_WINME:
/* get nameservers from the Windows 9X registry */
if (RegOpenKey(HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP",
/*
- * $Id: enums.h,v 1.200 2001/11/16 17:02:20 hno Exp $
+ * $Id: enums.h,v 1.201 2001/11/17 11:09:24 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
VARY_CANCEL
};
+/* CygWin & Windows NT Port */
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
+/*
+ * Supported Windows OS types codes
+ */
+enum {
+ _WIN_OS_UNKNOWN,
+ _WIN_OS_WIN32S,
+ _WIN_OS_WIN95,
+ _WIN_OS_WIN98,
+ _WIN_OS_WINME,
+ _WIN_OS_WINNT,
+ _WIN_OS_WIN2K,
+ _WIN_OS_WINXP
+};
+
+#endif
+
#endif /* SQUID_ENUMS_H */
/*
- * $Id: tools.cc,v 1.212 2001/11/15 15:01:37 hno Exp $
+ * $Id: tools.cc,v 1.213 2001/11/17 11:09:25 hno Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
void
leave_suid(void)
{
- debug(21, 3) ("leave_suid: PID %d called\n", (int)getpid());
+ debug(21, 3) ("leave_suid: PID %d called\n", (int) getpid());
if (geteuid() != 0)
return;
/* Started as a root, check suid option */
if (setgid(Config2.effectiveGroupID) < 0)
debug(50, 0) ("ALERT: setgid: %s\n", xstrerror());
debug(21, 3) ("leave_suid: PID %d giving up root, becoming '%s'\n",
- (int)getpid(), Config.effectiveUser);
+ (int) getpid(), Config.effectiveUser);
#if HAVE_SETRESUID
if (setresuid(Config2.effectiveUserID, Config2.effectiveUserID, 0) < 0)
debug(50, 0) ("ALERT: setresuid: %s\n", xstrerror());
void
enter_suid(void)
{
- debug(21, 3) ("enter_suid: PID %d taking root priveleges\n", (int)getpid());
+ debug(21, 3) ("enter_suid: PID %d taking root priveleges\n", (int) getpid());
#if HAVE_SETRESUID
setresuid(-1, 0, -1);
#else
uid_t uid;
leave_suid();
uid = geteuid();
- debug(21, 3) ("leave_suid: PID %d giving up root priveleges forever\n", (int)getpid());
+ debug(21, 3) ("leave_suid: PID %d giving up root priveleges forever\n", (int) getpid());
#if HAVE_SETRESUID
if (setresuid(uid, uid, uid) < 0)
debug(50, 1) ("no_suid: setresuid: %s\n", xstrerror());
lt = nt + 1;
}
fqdncacheAddEntryFromHosts(addr, hosts);
-skip:
+ skip:
wordlistDestroy(&hosts);
}
}
/*
- * $Id: win32.cc,v 1.3 2001/10/19 22:34:49 hno Exp $
+ * $Id: win32.cc,v 1.4 2001/11/17 11:09:25 hno Exp $
*
* * * * * * * * Legal stuff * * * * * * *
*
WIN32_OS_string = xstrdup("Windows NT");
return _WIN_OS_WINNT;
}
+ if ((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion == 0)) {
+ WIN32_OS_string = xstrdup("Windows 2000");
+ return _WIN_OS_WIN2K;
+ }
if ((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion == 1)) {
WIN32_OS_string = xstrdup("Windows XP");
return _WIN_OS_WINXP;
}
- WIN32_OS_string = xstrdup("Windows 2000");
- return _WIN_OS_WIN2K;
break;
case VER_PLATFORM_WIN32_WINDOWS:
- if ((osvi.dwMajorVersion > 4) ||
- ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0))) {
+ if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 0)) {
+ WIN32_OS_string = xstrdup("Windows 95");
+ return _WIN_OS_WIN95;
+ }
+ if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 10)) {
WIN32_OS_string = xstrdup("Windows 98");
return _WIN_OS_WIN98;
}
- WIN32_OS_string = xstrdup("Windows 95");
- return _WIN_OS_WIN95;
+ if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 90)) {
+ WIN32_OS_string = xstrdup("Windows Me");
+ return _WIN_OS_WINME;
+ }
break;
case VER_PLATFORM_WIN32s:
WIN32_OS_string = xstrdup("Windows 3.1 with WIN32S");
return _WIN_OS_WIN32S;
break;
default:
- return _WIN_OS_UNKNOWN;
+ break;
}
- WIN32_OS_string = xstrdup("Unknown");
+ WIN32_OS_string = xstrdup("Unknown Windows system");
return _WIN_OS_UNKNOWN;
}