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

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

Closed
Unit193 opened this issue Aug 11, 2021 · 4 comments
Closed

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

Unit193 opened this issue Aug 11, 2021 · 4 comments

Comments

@Unit193
Copy link
Contributor

Unit193 commented Aug 11, 2021

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_FAVORITE_VOLUMES 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
Copy link
Contributor Author

Unit193 commented Aug 11, 2021

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 added a commit that referenced this issue Aug 21, 2021
@idrassi
Copy link
Member

idrassi commented Aug 21, 2021

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

  • Issue 1 fixed in 49a1252. For redondency between IDM_ and HK_, there some duplicate but the functionality is different between them and one can modify HK_ without modifying IDM_. So for now, we keep like this until a better approach is found.
  • Issue 2 fixed in 0809f45
  • Issue 3 implemented in 7df5a58. I took your desktop file verbatim except "Exec" where I used full path to VeraCrypt binary (/usr/bin/veracrypt). I think this is safer since PATH can be manipulated.
  • I added /usr/sbin/mount.veracrypt as in your example in the same commit as above (7df5a58)

Let me know if you have further comments or remarks.

@Unit193
Copy link
Contributor Author

Unit193 commented Aug 23, 2021

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
Copy link
Member

idrassi commented Aug 23, 2021

Thank you for spotting the missing file. I have added it in f462160.
I will close this issue.
Your help for better Linux integration and wider usage by the Linux community is much appreciated.

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

No branches or pull requests

2 participants