Browse Source

Fix merge not re-locking vault.

Thomas Kerber 7 months ago
parent
commit
a7a434e092
Signed by: Thomas Kerber <t.kerber@ed.ac.uk> GPG Key ID: 8489B911F9ED617B
6 changed files with 1022 additions and 923 deletions
  1. 234
    218
      Cargo.lock
  2. 782
    701
      Cargo.nix
  3. 1
    1
      Cargo.toml
  4. 1
    1
      default.nix
  5. 3
    1
      src/cmd/merge.rs
  6. 1
    1
      update.sh

+ 234
- 218
Cargo.lock
File diff suppressed because it is too large
View File


Cargo.nix
File diff suppressed because it is too large
View File


+ 1
- 1
Cargo.toml View File

@@ -1,6 +1,6 @@
1 1
 [package]
2 2
 name = "goblin"
3
-version = "0.3.1"
3
+version = "0.3.2"
4 4
 authors = ["Thomas Kerber <tk@drwx.org>"]
5 5
 description = "Version controlled password management."
6 6
 publish = false

+ 1
- 1
default.nix View File

@@ -1,5 +1,5 @@
1 1
 with import <nixpkgs> { };
2
-((callPackage ./carnix.nix { }).goblin { }).override {
2
+((callPackage ./Cargo.nix { }).goblin { }).override {
3 3
   release = false;
4 4
   crateOverrides = defaultCrateOverrides // {
5 5
     libgpg-error-sys = attrs: {

+ 3
- 1
src/cmd/merge.rs View File

@@ -55,7 +55,9 @@ pub fn main(matches: &ArgMatches) -> Result<()> {
55 55
         let _: () = cli.call("goblin.perms.unlock", (vec![spec], pass))?;
56 56
     }
57 57
     let res = merge(&cfg, &mut cli, matches.value_of("VAULT").unwrap());
58
-    if !already_unlocked && res.is_ok() && res.as_ref().unwrap() == &true {
58
+    if !already_unlocked &&
59
+        (res.is_err() || (res.is_ok() && res.as_ref().unwrap() == &true))
60
+    {
59 61
         let _: () = cli.call("goblin.perms.lock", (vec![
60 62
             Access::new(Scope::Global, true),
61 63
         ],))?;

+ 1
- 1
update.sh View File

@@ -1,4 +1,4 @@
1 1
 #!/bin/sh
2 2
 cargo update
3 3
 sed -i 's/?branch=[a-z\-]*//g' Cargo.lock
4
-carnix Cargo.lock -o carnix.nix
4
+carnix nix --src=./.

Loading…
Cancel
Save