Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sdibella (prolixpost)
tails
Commits
0936d58b
Commit
0936d58b
authored
Nov 30, 2020
by
anonym
Browse files
Try to detect corrupt GnuPG pubring.kbx and restore any backup (refs: #17807)
parent
0f0bda89
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/chroot_local-includes/usr/local/sbin/live-persist
View file @
0936d58b
...
...
@@ -120,6 +120,22 @@ migrate_persistence_preset()
fi
}
maybe_restore_gnupg_pubring
()
{
local
KEYRING
=
"/home/amnesia/.gnupg/pubring.kbx"
local
KEYRING_BAK
=
"
${
KEYRING
}
~"
local
KEYRING_SIZE
=
"
$(
stat
-c
%s
${
KEYRING
}
||
echo
0
)
"
if
[
!
-f
"
${
KEYRING
}
"
]
||
[
"
${
KEYRING_SIZE
}
"
-le
32
]
;
then
warning
"It seems the GnuPG keyring is corrupt"
if
[
-f
"
${
KEYRING_BAK
}
"
]
;
then
warning
"Restoring backup of GnuPG keyring"
cp
"
${
KEYRING_BAK
}
"
"
${
KEYRING
}
"
chmod
u
=
rw,go
=
"
${
KEYRING
}
"
fi
fi
}
# We override live-boot's logging facilities to get more useful error messages
log_warning_msg
()
{
...
...
@@ -463,6 +479,11 @@ activate_volumes ()
echo
" -
${
vol
}
"
done
fi
if
mountpoint
-q
/home/amnesia/.gnupg
;
then
maybe_restore_gnupg_pubring
fi
exit
${
ret
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment