Browse Source

Prompt the user for a password without echoing.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@550 e5f2f494-b856-4b98-b285-d166d9295462
Likun Zhang 15 years ago
parent
commit
7cca5aa337

+ 0 - 4
src/bin/bindctl/message_format

@@ -1,4 +0,0 @@
-#define the message format between different modules
-'command' : [module_name, command_name, {param1 = value1, param2 = value2}]
-
-

+ 1 - 0
src/bin/cmd-ctrld/TODO

@@ -4,4 +4,5 @@
 4. RESTful API document for cmd-ctrld.
 5. Unit tests for cmd-ctrld.
 6. Man page for cmd-ctrld?
+7. Support 'make install', Save user information and ssl certificate file to configmanager.
 

+ 1 - 1
src/bin/cmd-ctrld/cmd-ctrld.py

@@ -83,7 +83,7 @@ class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
 
         reply_msg = []
         rcode = 200
-        if self.path == '/':
+        if self.path == '/login':
             reply_msg, rcode = self.check()
         elif "username" not in self.server.session[id]:
             reply_msg, rcode = ["please login!"], http.client.UNAUTHORIZED

+ 4 - 3
src/lib/bindctl/bindcmd.py

@@ -13,6 +13,7 @@ import inspect
 import pprint
 import ssl, socket
 import os, time, random, re
+import getpass
 from hashlib import sha1
 
 try:
@@ -67,10 +68,10 @@ class BindCmdInterpreter(Cmd):
         try:
             while count < 3:
                 count = count + 1
-                username = input("username:")
-                passwd = input("password:")
+                username = input("Username:")
+                passwd = getpass.getpass()
                 param = {'username': username, 'password' : passwd}
-                response = self.send_POST('/', param)
+                response = self.send_POST('/login', param)
                 data = response.read().decode()
                 print(data)