Author Topic: Command line edition enhancements  (Read 7784 times)

Offline dr4Ke

  • Normal Members
  • *
  • Posts: 7
Command line edition enhancements
« on: November 26, 2009, 09:24:59 AM »
Hello everybody.
I'm a happy user of the Firefox edition.
passwordmaker is not available for Google Chrome and i'm testing it now.
So, while waiting for a new edition for this software, i decided to try the command line edition (c++).

I've done some little work on the c++ command line edition.
Here are my changes :
leet.cpp :
  • FIX: don't compile on Linux (added '#include <cstring>' to fix)
  • FIX: warnings during compilation about (changed static char* to static const char*)
reading settings :
  • parse settings from args
  • THEN search account in the settings file
  • IF found, take only settings that were not given by a command line option
  • IF NOT found, use default account settings (if not cmd line option)
other changes :
  • Added a message if the given account was not found in the settings file
  • Print ********* instead of the master password in verbose mode
  • Show settings file name in verbose mode
  • Show trimzeroes setting in verbose mode
  • Show account name in verbose mode (including the default account name)

Attached a diff file.

Would you mind take a look at my changes ?

Thank you.
dr4Ke.

Offline Miquel 'Fire' Burns

  • Administrator
  • *****
  • Posts: 1157
  • Programmer
Re: Command line edition enhancements
« Reply #1 on: November 26, 2009, 02:12:09 PM »
I'll review when I have the chance.
"I'm not drunk, just sleep deprived."

Offline Miquel 'Fire' Burns

  • Administrator
  • *****
  • Posts: 1157
  • Programmer
Re: Command line edition enhancements
« Reply #2 on: November 26, 2009, 03:59:19 PM »
I reviewed it, and noticed that you messed up the default settings on the help screen.

How will someone know the default values when they view the help? I'll check on that later.
« Last Edit: November 26, 2009, 04:04:51 PM by Miquel 'Fire' Burns »
"I'm not drunk, just sleep deprived."

Offline dr4Ke

  • Normal Members
  • *
  • Posts: 7
Re: Command line edition enhancements
« Reply #3 on: November 26, 2009, 05:46:49 PM »
Ouch ! I didn't look much at the help screen.

I'll look at that tomorrow.

Offline dr4Ke

  • Normal Members
  • *
  • Posts: 7
Re: Command line edition enhancements
« Reply #4 on: November 27, 2009, 07:32:04 AM »
I checked on that. The default settings are the same as before :

My version :
$ ./passwordmaker --verbose
Master Password:
Master Password: ********
Using settings file: passwordmaker.rdf
Using Account:
Use l33t: none
l33t level: 0
Hash Algorithm: MD5
Triming trailing zeroes: yes
URL:
Generated Password Length: 8
Username:
Modifier:
Characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_-+={}|[]\:";'<>?,./
Generated Password Prefix:
Generated Password Suffix:
D4a8=qpD

Trunk version :
./passwordmaker --verbose
Master Password:
Master Password: youpi
Use l33t: none
l33t level: 0
Hash Algorithm: MD5
URL:
Generated Password Length: 8
Username:
Modifier:
Characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_-+={}|[]\:";'<>?,./
Generated Password Prefix:
Generated Password Suffix:
D4a8=qpD


The change is about separate reading settings on the command line and in the settings file. It's why I changed default values on the tclap (to see the difference between the default value and a user's option on the command line). The real defaults values (used to process the password) are set when the pwmdefaults object is created and are copied in the settings object by the function getSettings only if there was the corresponding option was not given on the command line.

I hope this will clarify what I changed.

Hope that my english is readable.

Anyway, thanks for checking my changes. I'll be glad to contribute to the project.
dr4Ke.

Offline Miquel 'Fire' Burns

  • Administrator
  • *****
  • Posts: 1157
  • Programmer
Re: Command line edition enhancements
« Reply #5 on: November 27, 2009, 06:50:05 PM »
Run ./passwordmaker -h as see what I mean by the default settings.
"I'm not drunk, just sleep deprived."

Offline dr4Ke

  • Normal Members
  • *
  • Posts: 7
Re: Command line edition enhancements
« Reply #6 on: November 30, 2009, 09:19:53 AM »
Run ./passwordmaker -h as see what I mean by the default settings.

I did.
I don't see any change between my version and the original version in trunk (except the description string shown at the end of the help screen).

PasswordMaker Forums

Re: Command line edition enhancements
« Reply #6 on: November 30, 2009, 09:19:53 AM »