olcf / pkpass

PKI based password manager
https://pkpass.readthedocs.io/en/latest/
Other
16 stars 3 forks source link

Interpreter mode crashes out on empty line #205

Closed haunab-ornl closed 1 year ago

haunab-ornl commented 1 year ago

Providing an empty line to the interpreter results in a crash:

 % pkpass
Welcome to PKPass (Public Key Based Password Manager) v2.7.8!
Type ? to list commands
pkpass>
Generic exception caught:
    IndexError: list index out of range
ginsburgnm commented 1 year ago

yeah, we could do something with the postcmd function like adding the to beginning of the function the following

        if len(line.split()) == 0:
            return Cmd.postcmd(self, stop, line)

but something strange happens when you do that, and it will fix the empty line enter problem, but it will repeat previous commands as well. this would take additional investigation

carljbai commented 1 year ago

207 has a possible fix that avoids the issue with repeating previous commands.

seriousbusinessprofessional commented 1 year ago

207 has a possible fix that avoids the issue with repeating previous commands.

Tested this and it appears to be fixed.