浏览代码

Merge branch 'candidate-5.2.4' into candidate-5.4.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 年之前
父节点
当前提交
15b4caf9f9
共有 4 个文件被更改,包括 11 次插入69 次删除
  1. 10 0
      dali/dfuplus/dfuplus.cpp
  2. 1 1
      dali/dfuplus/dfuplus.hpp
  3. 0 67
      dali/dfuplus/main.cpp
  4. 0 1
      roxie/ccd/ccdqueue.cpp

+ 10 - 0
dali/dfuplus/dfuplus.cpp

@@ -32,6 +32,7 @@
 #include "rmtfile.hpp"
 #include "sockfile.hpp"
 
+#include "jutil.hpp"
 
 static class CSecuritySettings
 {
@@ -192,6 +193,15 @@ CDfuPlusHelper::CDfuPlusHelper(IProperties* _globals,   CDfuPlusMessagerIntercep
 
     const char* username = globals->queryProp("username");
     const char* password = globals->queryProp("password");
+    if ( username && *username && (!password || !*password))
+    {
+        VStringBuffer prompt("%s's password: ", username);
+        StringBuffer passw;
+        passwordInput(prompt, passw);
+        globals->setProp("password",passw.str());
+        password = globals->queryProp("password");
+    }
+
     sprayclient->setUsernameToken(username, password, NULL);
     dfuclient->setUsernameToken(username, password, NULL);
 

+ 1 - 1
dali/dfuplus/dfuplus.hpp

@@ -34,7 +34,7 @@ class CDfuPlusHelper : public CInterface, implements IInterface
 {
 public:
     IMPLEMENT_IINTERFACE
-    
+
     CDfuPlusHelper(IProperties* _globals,   CDfuPlusMessagerIntercept *_msgintercept=NULL);
     virtual ~CDfuPlusHelper();
 

+ 0 - 67
dali/dfuplus/main.cpp

@@ -20,9 +20,6 @@
 #include "daftcfg.hpp"
 #include "dfuerror.hpp"
 #include "dfuplus.hpp"
-#if defined( __linux__) || defined(__FreeBSD__)
-#include "termios.h"
-#endif
 
 void printVersion()
 {
@@ -202,70 +199,6 @@ bool build_globals(int argc, const char *argv[], IProperties * globals)
     return true;
 }
 
-void promptFor(const char *prompt, const char *prop, bool hide, IProperties * globals)
-{
-    StringBuffer result;
-    fprintf(stdout, "%s", prompt);
-    fflush(stdout);
-    if (hide)
-    {
-#ifdef _WIN32
-        HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);   
-        DWORD dwInputMode;
-        GetConsoleMode(hStdIn, &dwInputMode);   
-        SetConsoleMode(hStdIn, dwInputMode & ~ENABLE_LINE_INPUT & ~ENABLE_ECHO_INPUT);
-        loop
-        {
-            /* read a character from the console input */   
-            char ch;
-            DWORD dwRead;
-            if (!ReadFile(hStdIn, &ch, sizeof(ch), &dwRead, NULL))
-                break;
-            if (ch == '\n' || ch=='\r' || !ch)
-                break;
-            result.append(ch);
-        }
-        SetConsoleMode(hStdIn, dwInputMode); 
-#else
-        int fn = fileno(stdin);
-#ifdef __linux__        
-        struct termio t;
-        /* If ioctl fails, we're probably not connected to a terminal. */
-        if(!ioctl(fn, TCGETA, &t))
-        {
-            t.c_lflag &= ~ECHO;
-            ioctl(fn, TCSETA, &t);
-        }
-#endif
-        loop
-        {
-            char ch = fgetc(stdin);
-            if (ch == '\n' || ch=='\r' || !ch)
-                break;
-            result.append(ch);
-        }
-#ifdef __linux__        
-        if(!ioctl(fn, TCGETA, &t))
-        {
-            t.c_lflag |= ECHO;
-            ioctl(fn, TCSETA, &t);
-        }
-#endif
-#endif
-        printf("\n");
-    }
-    else
-    {
-        char buf[100];
-        if (fgets(buf, 100, stdin))
-            result.append(buf);
-        if (result.length() && result.charAt(result.length()-1)=='\n')
-            result.remove(result.length()-1, 1);
-    }
-    globals->setProp(prop, result);
-}
-
-
 int main(int argc, const char* argv[])
 {
     InitModuleObjects();

+ 0 - 1
roxie/ccd/ccdqueue.cpp

@@ -2466,7 +2466,6 @@ void LocalMessagePacker::flush(bool last_message)
 CLocalMessageCollator::CLocalMessageCollator(IRowManager *_rowManager, ruid_t _ruid) 
     : rowManager(_rowManager), id(_ruid)
 {
-    id = 0;
     totalBytesReceived = 0;
 }