Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change command line option processing #82

Merged
merged 3 commits into from May 31, 2022
Merged

Conversation

jmwilson
Copy link
Contributor

There wasn't a strong consensus in #76, but it seems keeping similar command syntax is favored. This allows encrypt and decrypt options to be specified separately. The preferred syntax is now

stenc -f /dev/nst0 -e on -d mixed -k key.txt

Leaving out one of -e or -d will cause stenc to set the modes in tandem.

Breaking changes:

  • -e mixed no longer works, prefer -e on -d mixed or simplify -d mixed
  • Interactive prompting for keys has changed. I do not think it is practical to key in 64 hex digits manually (twice). People using the key prompt are probably cutting & pasting from a credential manager. It would be better to allow people to enter in the contents of a regular key file on standard input, so the cut & paste workflow can continue, but the key file can also be obtained by piping from a key manager. For example with Bitwarden CLI, one could do bw get <id> | stenc --encrypt=on --key-file=-
  • Rename the (un)protect options as explicit --allow-raw-read or --no-allow-raw-read (following GNU style).

If approved, I will need to rewrite the man page to reflect the option syntax.

Changes command line option processing:

  • Use getopt_long in libc and support long options
  • GNU style option processing (don't try to enforce non-conflicting options)
  • GNU style usage message
  • Separate encrypt and decrypt settings
  • --unprotect -> --allow-raw-read, --protect -> --no-allow-raw-read for clarification
  • Change reading key file from stdin using --key-file=-
  • Always print detailed status, remove summary "Drive Encryption" line

  - Use getopt_long in libc and support long options
  - GNU style option processing (don't try to enforce non-conflicting options)
  - GNU style usage message
  - Separate encrypt and decrypt settings
  - --unprotect -> --allow-raw-read, --protect -> --no-allow-raw-read for clarification
  - Change reading key file from stdin using --key-file=-
  - Always print detailed status, remove summary "Drive Encryption" line
@jmwilson jmwilson changed the title Getopt Change command line option processing May 29, 2022
@jonasstein
Copy link
Collaborator

@ninthclowd do you have any objections?

@jonasstein jonasstein merged commit 23f8d82 into scsitape:master May 31, 2022
@jmwilson jmwilson deleted the getopt branch June 6, 2022 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants