diff --git a/resources/ui/VaultWindow.ui b/resources/ui/VaultWindow.ui index ff41dbf..ebb77cf 100644 --- a/resources/ui/VaultWindow.ui +++ b/resources/ui/VaultWindow.ui @@ -250,6 +250,28 @@ 4 + + + True + False + start + Custom mount options + + + 0 + 5 + + + + + True + True + + + 1 + 5 + + diff --git a/src/Gocrypt.vala b/src/Gocrypt.vala index 17b2886..4547387 100644 --- a/src/Gocrypt.vala +++ b/src/Gocrypt.vala @@ -27,7 +27,7 @@ namespace Cryptor { } } - public static void mount_vault (string path, string mountpoint, string password, bool ro, bool reverse) throws Error { + public static void mount_vault (string path, string mountpoint, string password, bool ro, bool reverse, string custom_options) throws Error { string standard_error; int status; @@ -39,6 +39,9 @@ namespace Cryptor { if (reverse) { cmd += "-reverse "; } + if (custom_options != "") { + cmd += custom_options + " "; + } cmd += " -passfile " + pfile.get_path () + " -- " + path + " " + mountpoint; try { Process.spawn_command_line_sync (cmd, null, out standard_error, out status); diff --git a/src/data/Vault.vala b/src/data/Vault.vala index cbdc422..8a292ca 100644 --- a/src/data/Vault.vala +++ b/src/data/Vault.vala @@ -5,6 +5,7 @@ namespace Cryptor.Data { public string mount_point { get; set; } public string mode { get; set; } public bool reverse { get; set; } + public string custom_options { get; set; default = ""; } public bool is_mounted; } } diff --git a/src/ui/CryptorWindow.vala b/src/ui/CryptorWindow.vala index 2b1f5ad..85cf773 100644 --- a/src/ui/CryptorWindow.vala +++ b/src/ui/CryptorWindow.vala @@ -240,7 +240,7 @@ namespace Cryptor.UI { return; } try { - Gocrypt.mount_vault (vault.path, vault.mount_point, password, (vault.mode == "r"), vault.reverse); + Gocrypt.mount_vault (vault.path, vault.mount_point, password, (vault.mode == "r"), vault.reverse, vault.custom_options); vault.is_mounted = true; sync_treeview_from_conf (); } catch (Error e) { @@ -248,7 +248,7 @@ namespace Cryptor.UI { if (Utils.show_question (this, "%s\n\n%s\n%s".printf (e.message, _("Vault might be mounted already."), _("Shall I retry unmounting it first?"))) == ResponseType.YES) { try { Gocrypt.unmount_vault (vault.mount_point); - Gocrypt.mount_vault (vault.path, vault.mount_point, password, (vault.mode == "r"), vault.reverse); + Gocrypt.mount_vault (vault.path, vault.mount_point, password, (vault.mode == "r"), vault.reverse, vault.custom_options); vault.is_mounted = true; sync_treeview_from_conf (); } catch (Error e) { diff --git a/src/ui/VaultWindow.vala b/src/ui/VaultWindow.vala index c93b1c7..bb2f076 100644 --- a/src/ui/VaultWindow.vala +++ b/src/ui/VaultWindow.vala @@ -25,6 +25,9 @@ namespace Cryptor.UI { [GtkChild] private unowned CheckButton check_reverse; + [GtkChild] + private unowned Entry entry_custom_options; + public VaultWindow (Window parent, int row, Config config) { Object ( transient_for: parent @@ -38,6 +41,7 @@ namespace Cryptor.UI { entry_vault.text = v.path; entry_mountpoint.text = v.mount_point; combo_mode.active_id = v.mode; + entry_custom_options.text = v.custom_options; } if (row == -1) { this.title = _("New vault"); @@ -157,6 +161,7 @@ namespace Cryptor.UI { v.mount_point = entry_mountpoint.text; v.mode = combo_mode.active_id; v.reverse = check_reverse.active; + v.custom_options = entry_custom_options.text; config.changes_made = true;