fixes in cert auth; android client switched to 1.2.11 API
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 10 Jan 2014 10:55:09 +0000 (12:55 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 10 Jan 2014 10:55:09 +0000 (12:55 +0200)
12 files changed:
android/src/agent/.classpath
android/src/agent/res/values/build_number.xml
android/src/console/.classpath
android/src/console/res/values/build_number.xml
android/src/console/src/org/netxms/ui/android/main/adapters/LastValuesAdapter.java
build/build_number
include/build.h
src/java/build/set_build_number.cmd
src/java/netxms-base/src/main/java/org/netxms/base/BuildNumber.java
src/server/core/cert.cpp
src/server/core/userdb_objects.cpp
src/server/libnxsrv/main.cpp

index 1c01ad0..a406067 100644 (file)
@@ -6,7 +6,7 @@
        <classpathentry kind="lib" path="libs/acra-4.4.0.jar"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="lib" path="libs/netxms-base-1.2.10.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-mobile-agent-1.2.10.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-base-1.2.11.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-mobile-agent-1.2.11.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index 9ef4cff..fbcbe03 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-       <string name="build_number">7857</string>
+       <string name="build_number">7858</string>
 </resources>
index a5e211f..f5d1899 100644 (file)
@@ -9,9 +9,9 @@
        <classpathentry kind="lib" path="libs/acra-4.4.0.jar"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="lib" path="libs/certificate-manager-1.2.10.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-base-1.2.10.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-client-1.2.10.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-client-api-1.2.10.jar"/>
+       <classpathentry kind="lib" path="libs/certificate-manager-1.2.11.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-base-1.2.11.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-client-1.2.11.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-client-api-1.2.11.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index 9ef4cff..fbcbe03 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-       <string name="build_number">7857</string>
+       <string name="build_number">7858</string>
 </resources>
index d095ddd..0c9ea71 100644 (file)
@@ -319,8 +319,8 @@ public class LastValuesAdapter extends BaseAdapter
                        int f = t.getFunction();
                        StringBuilder text = new StringBuilder(r.getString(fns[f]));
                        text.append("(");
-                       if (f != Threshold.F_DIFF)
-                               text.append(t.getArg1());
+                       if ((f != Threshold.F_DIFF) && (f != Threshold.F_SCRIPT))
+                               text.append(t.getSampleCount());
                        text.append(") ");
                        text.append(r.getString(ops[t.getOperation()]));
                        text.append(' ');
index 100179a..e771ae7 100644 (file)
@@ -1 +1 @@
-7857
+7858
index c35df41..5084f12 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef __build_h
 #define __build_h
-#define NETXMS_VERSION_BUILD 7857
-#define NETXMS_VERSION_BUILD_STRING _T("7857")
+#define NETXMS_VERSION_BUILD 7858
+#define NETXMS_VERSION_BUILD_STRING _T("7858")
 #endif
index 0cc5d9e..6194a7f 100644 (file)
@@ -1,5 +1,5 @@
 package org.netxms.base;
 public final class BuildNumber {
-   public static final String TEXT = "7857";
-   public static final int NUMBER = 7857;
+   public static final String TEXT = "7858";
+   public static final int NUMBER = 7858;
 }
index 42f6ddf..077d4c0 100644 (file)
@@ -93,8 +93,6 @@ static BOOL CheckPublicKey(EVP_PKEY *key, const TCHAR *mappingData)
  */
 static BOOL CheckCommonName(X509 *cert, const TCHAR *cn)
 {
-   TCHAR certCN[256];
-
    X509_NAME *subject = X509_get_subject_name(cert);
    if (subject == NULL)
       return FALSE;
@@ -111,13 +109,19 @@ static BOOL CheckCommonName(X509 *cert, const TCHAR *cn)
    if (data == NULL)
       return FALSE;
 
-   unsigned char *utf8;
-   int length = ASN1_STRING_to_UTF8(&utf8, data);
-   printf( ">>> CN value: %s\n", utf8 );
-   printf( ">>> CN length: %d\n", length );
-   OPENSSL_free(utf8);
-
-   return TRUE;
+   unsigned char *utf8CertCN;
+   int length = ASN1_STRING_to_UTF8(&utf8CertCN, data);
+#ifdef UNICODE
+   DbgPrintf(3, _T("Certificate CN=\"%hs\", user CN=\"%s\""), utf8CertCN, cn);
+   char *utf8UserCN = UTF8StringFromWideString(cn);
+   BOOL success = !stricmp((char *)utf8CertCN, utf8UserCN);
+   free(utf8UserCN);
+#else
+   DbgPrintf(3, _T("Certificate CN=\"%s\", user CN=\"%s\""), utf8CertCN, cn);
+   BOOL success = !stricmp((char *)utf8CertCN, cn);
+#endif
+   OPENSSL_free(utf8CertCN);
+   return success;
 }
 
 /**
index a3bf6fe..c5339c3 100644 (file)
@@ -345,7 +345,7 @@ bool User::saveToDatabase(DB_HANDLE hdb)
       hStmt = DBPrepare(hdb,
          _T("INSERT INTO users (name,password,system_access,flags,full_name,description,grace_logins,guid,auth_method,")
          _T("  cert_mapping_method,cert_mapping_data,password_history,auth_failures,last_passwd_change,min_passwd_length,")
-         _T("  disabled_until,last_login,xmpp_id,id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"));
+         _T("  disabled_until,last_login,xmpp_id,id) VALUES (?,?,?,?,?,?,?,?,?,?,?,'',?,?,?,?,?,?,?)"));
    }
    if (hStmt == NULL)
       return false;
index 6e62f3b..80e22c1 100644 (file)
@@ -26,7 +26,7 @@
 /**
  * Global variables
  */
-UINT32 LIBNXSRV_EXPORTABLE g_dwFlags = AF_USE_SYSLOG | AF_CATCH_EXCEPTIONS;
+UINT32 LIBNXSRV_EXPORTABLE g_dwFlags = AF_USE_SYSLOG | AF_CATCH_EXCEPTIONS | AF_LOG_SQL_ERRORS;
 UINT32 LIBNXSRV_EXPORTABLE g_dwSNMPTimeout = 2000;
 UINT32 LIBNXSRV_EXPORTABLE g_debugLevel = (UINT32)NXCONFIG_UNINITIALIZED_VALUE;