From d949f945c1101f46679a52069896962a1192102c Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 13 Oct 2009 13:06:42 +0000
Subject: [PATCH] Fix for issue 4273 (server does not work as service if Windows UAC enabled in Windows Server 2008) The problem was that the code assumed that the only windows OS supporting UAC was Windows Vista. This was the case before Windows 2008 came out. The fix consists on creating a method that allows identifying which OS versions of vista support UAC and which do not.
---
opendj-sdk/opends/src/server/org/opends/server/util/SetupUtils.java | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/SetupUtils.java b/opendj-sdk/opends/src/server/org/opends/server/util/SetupUtils.java
index 718a597..764f4b8 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/SetupUtils.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/SetupUtils.java
@@ -292,6 +292,41 @@
}
return isVista;
}
+
+ /**
+ * Indicates whether the underlying operating system is Windows 2008.
+ *
+ * @return {@code true} if the underlying operating system is Windows
+ * 2008, or {@code false} if not.
+ */
+ public static boolean isWindows2008()
+ {
+ boolean isWindows2008;
+ String os = System.getProperty("os.name");
+ if (os != null)
+ {
+ isWindows2008 = isWindows() &&
+ (os.toLowerCase().indexOf("server 2008") != -1);
+ }
+ else
+ {
+ isWindows2008 = false;
+ }
+ return isWindows2008;
+ }
+
+ /**
+ * Indicates whether the underlying operating system has UAC (User Access
+ * Control).
+ *
+ * @return {@code true} if the underlying operating system has UAC (User
+ * Access Control), or {@code false} if not.
+ */
+ public static boolean hasUAC()
+ {
+ return SetupUtils.isVista() || SetupUtils.isWindows2008();
+ }
+
/**
* Returns a String representation of the OS we are running.
* @return a String representation of the OS we are running.
--
Gitblit v1.10.0