From 2287e23f3571b8e733f7785a6343bef2452613ef Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Fri, 10 Feb 2012 20:13:51 +0100 Subject: [PATCH] FIXED: fixed bug in NOTEDB::mysql, which caused note t store NULL values in db, if encryption was off. A really dump failure :-( --- Changelog | 6 ++++++ NOTEDB/binary.pm | 11 +++++++++-- NOTEDB/mysql.pm | 24 ++++++++++++++++++------ README | 2 +- VERSION | 2 +- bin/note | 2 +- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Changelog b/Changelog index 663095c..624d103 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,11 @@ ================================================================================== +1.0.1: +FIXED: fixed bug in NOTEDB::mysql, which caused note t store NULL values + in db, if encryption was off. A really dump failure :-( + +================================================================================== + 1.0.0: CHANGED: removed install.sh. use now a Makefile for installation. ADDED: Encryption support. Note can now encrypt notes using IDEA diff --git a/NOTEDB/binary.pm b/NOTEDB/binary.pm index 6111cdf..5627eb5 100644 --- a/NOTEDB/binary.pm +++ b/NOTEDB/binary.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: binary.pm,v 1.4 2000/04/17 17:39:27 thomas Exp thomas $ +# $Id: binary.pm,v 1.5 2000/04/26 22:57:38 thomas Exp thomas $ # Perl module for note # binary database backend. see docu: perldoc NOTEDB::binary # @@ -25,7 +25,7 @@ BEGIN { my ($NOTEDB, $sizeof, $typedef,$version); my ($cipher); -$version = "(NOTEDB::binary, 1.4)"; +$version = "(NOTEDB::binary, 1.5)"; sub new @@ -348,6 +348,13 @@ NOTEDB::binary - module lib for accessing a notedb from perl # delete a certain note $db->set_del(5); + # turn on encryption. CryptMethod must be IDEA, DES or BLOWFISH + $db->use_crypt("passphrase", "CryptMethod"); + + # turn off encryption. This is the default. + $db->no_crypt(); + + =head1 DESCRIPTION You can use this module for accessing a note database. There are currently diff --git a/NOTEDB/mysql.pm b/NOTEDB/mysql.pm index 05a4da5..adc0b42 100644 --- a/NOTEDB/mysql.pm +++ b/NOTEDB/mysql.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: mysql.pm,v 1.3 2000/04/17 17:39:37 thomas Exp thomas $ +# $Id: mysql.pm,v 1.4 2000/04/26 22:57:50 thomas Exp thomas $ # Perl module for note # mysql database backend. see docu: perldoc NOTEDB::binary # @@ -28,7 +28,7 @@ $table = "note"; $fnum = "number"; $fnote = "note"; $fdate = "date"; -$version = "(NOTEDB::mysql, 1.3)"; +$version = "(NOTEDB::mysql, 1.4)"; # prepare some std statements... ##################################################################### my $sql_getsingle = "SELECT $fnote,$fdate FROM $table WHERE $fnum = ?"; @@ -243,8 +243,11 @@ sub uen if($NOTEDB::crypt_supported == 1) { eval { $T = pack("u", $cipher->encrypt($_[0])); - } + }; } + else { + $T = $_[0]; + } chomp $T; return $T; } @@ -255,9 +258,12 @@ sub ude if($NOTEDB::crypt_supported == 1) { eval { $T = $cipher->decrypt(unpack("u",$_[0])) - } - } - return $T; + }; + return $T; + } + else { + return $_[0]; + } } 1; # keep this! @@ -303,6 +309,12 @@ NOTEDB::mysql - module lib for accessing a notedb from perl # delete a certain note $db->set_del(5); + # turn on encryption. CryptMethod must be IDEA, DES or BLOWFISH + $db->use_crypt("passphrase", "CryptMethod"); + + # turn off encryption. This is the default. + $db->no_crypt(); + =head1 DESCRIPTION You can use this module for accessing a note database. There are currently diff --git a/README b/README index 73c8f49..0c6b1cf 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -note 1.0.0 by Thomas Linden, 18/04/2000 +note 1.0.1 by Thomas Linden, 18/04/2000 Introduction diff --git a/VERSION b/VERSION index 3eefcb9..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/bin/note b/bin/note index 3dde7ef..c0ea70d 100755 --- a/bin/note +++ b/bin/note @@ -121,7 +121,7 @@ $TIME_COLOR = "black"; $TOPIC_COLOR = "BLACK"; $TOPIC = 1; $TopicSep = '/'; -$version = "1.0.0"; +$version = "1.0.1"; if($TOPIC) { $CurDepth = 1; # the current depth inside the topic "directory" structure...