mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 12:41:10 +01:00
fixed checking of encrypted notes when encryption is turned off
This commit is contained in:
9
bin/note
9
bin/note
@@ -144,7 +144,7 @@ $CONF = File::Spec->catfile($ENV{HOME}, ".noterc");
|
|||||||
$USER = getlogin || getpwuid($<);
|
$USER = getlogin || getpwuid($<);
|
||||||
chomp $USER;
|
chomp $USER;
|
||||||
$TOPIC = 1;
|
$TOPIC = 1;
|
||||||
$version = "1.3.15";
|
$version = "1.3.16";
|
||||||
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
||||||
$maxlen = "auto";
|
$maxlen = "auto";
|
||||||
$timelen = 22;
|
$timelen = 22;
|
||||||
@@ -467,9 +467,10 @@ else {
|
|||||||
$db->no_crypt;
|
$db->no_crypt;
|
||||||
|
|
||||||
# does: NOTEDB::crypt_supported = 0;
|
# does: NOTEDB::crypt_supported = 0;
|
||||||
my ($cnote, $cdate) = $db->get_single(1);
|
my %all = $db->get_all();
|
||||||
if ($cdate ne "") {
|
if(scalar keys %all > 0) {
|
||||||
if ($cdate !~ /^\d+\.\d+?/) {
|
my $id = (keys %all)[0];
|
||||||
|
if($all{$id}->{date} !~ /^\d+\.\d+?/) {
|
||||||
print "notedb seems to be encrypted!\n";
|
print "notedb seems to be encrypted!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user