summary refs log tree commit diff stats
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 5120c25a..0881c708 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -681,7 +681,7 @@ get_cpu_str (void)
 	double mhz;
 
 	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
-	GetVersionEx (&osvi);
+	GetVersionEx ((OSVERSIONINFO*) &osvi);
 
 	switch (osvi.dwMajorVersion)
 	{
@@ -740,7 +740,7 @@ get_cpu_str (void)
 					}
 					else
 					{
-						strcpy (winver, "8 Server");
+						strcpy (winver, "Server 2012");
 					}
 					break;
 			}
@@ -1966,3 +1966,23 @@ get_subdirs (const char *path)
 
 	return dirlist;
 }
+
+char *
+encode_sasl_pass (char *user, char *pass)
+{
+	int passlen;
+	char *buffer;
+	char *encoded;
+
+	/* passphrase generation, nicely copy-pasted from the CAP-SASL plugin */
+	passlen = strlen (user) * 2 + 2 + strlen (pass);
+	buffer = (char*) malloc (passlen + 1);
+	strcpy (buffer, user);
+	strcpy (buffer + strlen (user) + 1, user);
+	strcpy (buffer + strlen (user) * 2 + 2, pass);
+	encoded = g_base64_encode ((unsigned char*) buffer, passlen);
+
+	free (buffer);
+
+	return encoded;
+}