PasswordMaker Forums
February 09, 2010, 12:28:02 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Don't echo Master Password in command-line tool  (Read 2505 times)
lewk
Newbie
*
Offline Offline

Posts: 1


WWW
« on: April 22, 2007, 08:56:15 AM »

This has probably been brought up before, but I don't know of any reason why the command-line tool needs to display your Master Password as you type it.  I personally don't want someone who happens to be looking over my shoulder to be able to see my master password, as well as all of the command-line arguments.

Below is a patch that will resolve this issue.

Code:
Index: cli/trunk/main.cpp
===================================================================
--- cli/trunk/main.cpp  (revision 188)
+++ cli/trunk/main.cpp  (working copy)
@@ -138,7 +138,9 @@
        if (settings.mpw == "\x01") {
                char tmpw[255]; // Hope this is enough for a master password
                cout << "Master Password :";
+               system("stty -echo");
                cin.getline(tmpw, 254);
+               system("stty echo");
                cout << endl;
                settings.mpw = tmpw;
        }
Logged
Miquel 'Fire' Burns
Administrator
*****
Offline Offline

Posts: 1003


Programmer


WWW
« Reply #1 on: April 23, 2007, 02:21:36 AM »

Windows don't have a stty command.

If you know of a cross platform way to do the same thing, let us know.
« Last Edit: April 23, 2007, 02:21:58 AM by miquelfire » Logged
Eric H. Jung
grimholtz
Administrator
*****
Offline Offline

Posts: 3262


WWW
« Reply #2 on: April 26, 2007, 01:47:56 AM »

Is it worth compiling into the non-Windows builds with precompiler directives?
Logged
Miquel 'Fire' Burns
Administrator
*****
Offline Offline

Posts: 1003


Programmer


WWW
« Reply #3 on: April 27, 2007, 02:28:30 AM »

Good idea. Might do that.

Anyway, a way to do this on Windows would be nice.
Logged
Eric H. Jung
grimholtz
Administrator
*****
Offline Offline

Posts: 3262


WWW
« Reply #4 on: April 30, 2007, 03:55:10 AM »

Quote from: miquelfire
Good idea. Might do that.

Anyway, a way to do this on Windows would be nice.

Found an example:
http://www.codeproject.com/dotnet/ConsolePasswordInput.asp
Although the author uses .NET, the code he's using to echo asterisks "Windows Console APIs imported to C# via DllImport attributes." In other words, we should be able to rip out the non-.NET stuff pretty easily to get the crux of the solution. I realize echoing asterisks isn't as good as echoing NOTHING, but this solution is better than none...
Logged
Eric H. Jung
grimholtz
Administrator
*****
Offline Offline

Posts: 3262


WWW
« Reply #5 on: June 01, 2007, 10:32:45 PM »

FYI, Miquel fixed this and released it on 22 May. Command-line edition no longer echoes typed passwerds [sic].
Logged
PasswordMaker Forums
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!