veracrypt / VeraCrypt

Disk encryption with strong security based on TrueCrypt
https://www.veracrypt.fr
Other
6.84k stars 944 forks source link

Several minor issues: typo, desktop file updates, etc #814

Closed Unit193 closed 3 years ago

Unit193 commented 3 years ago

Howdy,

First off, thanks for maintaining VeraCrypt, as always.

Issue #1: typo in source

While looking at the new language support, I noticed there's a typo on line 1021 of src/Main/GraphicUserInterface.cpp Gui->ShowInfo (LangStrin["LINUX_VC_RUNNING_ALREADY"]); should instead be Gui->ShowInfo (LangString["LINUX_VC_RUNNING_ALREADY"]);

While I'm on it, a lot of the IDM vs HK strings are just about the same, though I notice the DE translation of IDM_MOUNT_FAVORITEVOLUMES has & in it. The latter, HK, should be for hotkeys or thereabouts, but basically I'm just trying to ensure I add the language support correctly to my indicator patch. :)

Issue #2: Locale name output

Another minor one, I noticed when you run VeraCrypt from the console, it now will output the value of $LANG. This seems like something leftover from debugging.

Issue #3: Desktop file updates

So my .desktop file looks a bit different than the one upstream, and I'd like to reconcile that difference. Mine is below:

[Desktop Entry]
Type=Application
Name=VeraCrypt
GenericName=VeraCrypt volume manager
Comment=Create and mount VeraCrypt encrypted volumes
Icon=veracrypt
Exec=veracrypt %f
Categories=Security;Utility;Filesystem
Keywords=encryption,filesystem
Terminal=false
MimeType=application/x-veracrypt-volume;application/x-truecrypt-volume;

There are several differences:

  1. The exec line is such that it works with mime types.
  2. Categories were updated following the spec on main and additional categories.
  3. As was recommended by the linter, I added a couple keywords.
  4. I added MimeType since I also ship /usr/share/mime/packages/veracrypt.xml to associate the file types on Linux.

If you were curious, the contents of said file is:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/x-veracrypt-volume">
        <comment>VeraCrypt Volume</comment>
        <glob pattern="*.hc"/>
    </mime-type>
    <mime-type type="application/x-truecrypt-volume">
        <comment>TrueCrypt Volume</comment>
        <glob pattern="*.tc"/>
    </mime-type>
</mime-info>

I thought there were other minor things, but at this time I am not remembering them so I guess they can't be too important. Thanks for your consideration.

Unit193 commented 3 years ago

Ah!

Additionally, perhaps it may be useful to include a /usr/sbin/mount.veracrypt such that VeraCrypt could be used from fstab (and libpam-mount?)

Example:

#!/bin/bash
DEV="$1"
MNTPT="$2"
VCOPTIONS=""
OPTIONS=""

shift 3
IFS=','
for arg in $*; do
  case "$arg" in
    truecrypt)        VCOPTIONS=(${VCOPTIONS[*]} --truecrypt);;
    system)           VCOPTIONS=(${VCOPTIONS[*]} --mount-options=system);;
    fs=*)             VCOPTIONS=(${VCOPTIONS[*]} --filesystem=${arg#*=});;
    keyfiles=*)       VCOPTIONS=(${VCOPTIONS[*]} --keyfiles=${arg#*=});;
    password=*)       VCOPTIONS=(${VCOPTIONS[*]} --password=${arg#*=});;
    pim=*)            VCOPTIONS=(${VCOPTIONS[*]} --pim==${arg#*=});;
    protect-hidden=*) VCOPTIONS=(${VCOPTIONS[*]} --protect-hidden=${arg#*=});;
    slot=*)           VCOPTIONS=(${VCOPTIONS[*]} --slot=${arg#*=});;
    *)                OPTIONS="${OPTIONS}${arg},";;
  esac
done

/usr/bin/veracrypt --non-interactive --text ${VCOPTIONS[*]} --fs-options="${OPTIONS%,*}" ${DEV} ${MNTPT}
idrassi commented 3 years ago

Thank you for this contribution. The made several changes based on your proposals:

Let me know if you have further comments or remarks.

Unit193 commented 3 years ago

Wow, thanks very much, this is fantastic! About the only thing to note, seems you forgot to git add Setup/Linux/veracrypt.xml in 7df5a58.

I do not have anything else to add.

idrassi commented 3 years ago

Thank you for spotting the missing file. I have added it in https://github.com/veracrypt/VeraCrypt/commit/f462160542d59c79a5eeafcffec66951705bbb23. I will close this issue. Your help for better Linux integration and wider usage by the Linux community is much appreciated.