~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kexi/3rdparty/kexisql3/src/ksqlite2to3

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#   This file is part of the KDE project
 
3
#   Copyright (C) 2004-2005 Jaroslaw Staniek <js@iidea.pl>
 
4
#
 
5
#   This program is free software; you can redistribute it and/or
 
6
#   modify it under the terms of the GNU General Public
 
7
#   License as published by the Free Software Foundation; either
 
8
#   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
# Performs migration from SQLite2 format to SQLite3 format
 
11
# usage: ksqlite2to3 <sqlite2-db-file>
 
12
 
 
13
if test $# -lt 1 ; then
 
14
        echo "usage: ksqlite2to3 <sqlite2-db-file>"
 
15
        exit 1
 
16
fi
 
17
 
 
18
basename=`basename $0`
 
19
temp=`mktemp -q "$basename"-XXXXXX 2> /dev/null || date +%y%m%d%H%M2`
 
20
dbfile=$1
 
21
dir=`dirname $dbfile`
 
22
 
 
23
ksqlite2 $dbfile .quit 2> /dev/null
 
24
if test $? -ne 0 ; then
 
25
        echo "This file is not in SQLite2 format"
 
26
        rm -f "$dir/$temp"
 
27
        exit 1
 
28
fi
 
29
 
 
30
ksqlite2 -verbose-dump $dbfile .dump | ksqlite "$dir/$temp"
 
31
if test $? -ne 0 ; then
 
32
        echo "Error during converting"
 
33
        rm -f "$dir/$temp"
 
34
        exit 2
 
35
fi
 
36
 
 
37
mv "$dir/$temp" $dbfile 2> /dev/null || exit 3
 
38