Commit fa0b85f8 authored by Tanguy Ortolo's avatar Tanguy Ortolo

Debian revision 0.13.4-3+squeeze3

parent 368dafae
gajim for Debian
----------------
If you want to use OpenPGP in gajim, you have to install python-gnupginterface.
-- Yann Le Boulanger <asterix@lagaule.org>, Mon, 20 Jun 2005 12:02:31 +0200
gajim (0.13.4-3+squeeze3) stable-security; urgency=high
* Non-maintainer upload by the Security Team.
* Fix regression introduced by last update if latx conversion
utilities are not installed, check_latex("test") fails.
(Closes: #668710, #669100, #669105, #669106)
-- Nico Golde <nion@debian.org> Tue, 17 Apr 2012 16:01:14 +0000
gajim (0.13.4-3+squeeze2) stable-security; urgency=high
* Non-maintainer upload by the Security Team.
* This update fixes the following security issues:
- CVE-2012-2086: SQL injections via jids in logging code
- CVE-2012-2085: assisted code execution via crafted messages due
to insecurely processing input with popen.
- CVE-2012-2093: insecure use of temporary files when convering LaTeX
IM messages to png images.
(Closes: #668710, #668038)
-- Nico Golde <nion@debian.org> Sun, 15 Apr 2012 20:35:02 +0000
gajim (0.13.4-3+squeeze1) stable; urgency=low
[ Étienne Loks ]
* Fix CPU high load when connecting first. Closes: #634880
-- Yann Leboulanger <asterix@lagaule.org> Thu, 21 Jul 2011 21:15:34 +0100
gajim (0.13.4-3) unstable; urgency=low
* Fix a problem when canceling password keyring creation.
-- Yann Leboulanger <asterix@lagaule.org> Thu, 04 Nov 2010 20:40:52 +0100
gajim (0.13.4-2) unstable; urgency=low
* don't fail to build with python != 2.5. Closes: #595870
* fix minimum python-openssl version to 0.9. Closes: #594772
-- Yann Leboulanger <asterix@lagaule.org> Tue, 07 Sep 2010 09:28:03 +0200
gajim (0.13.4-1) unstable; urgency=low
* New upstream release.
* Fix flood when trying to join a full MUC. Closes: #575688
-- Yann Leboulanger <asterix@lagaule.org> Fri, 02 Apr 2010 10:19:59 +0200
gajim (0.13.3-1) unstable; urgency=low
* New upstream release.
* Fix connection to facebook. Closes: #569767
-- Yann Leboulanger <asterix@lagaule.org> Tue, 23 Feb 2010 21:00:41 +0100
gajim (0.13.2-1) unstable; urgency=low
* New upstream release.
* Fix gnomekeyring usage. Closes: #562913
* Fix completion. Closes: #563930
* Fix typo in suggests list. Closes: #564754
-- Yann Leboulanger <asterix@lagaule.org> Thu, 14 Jan 2010 21:23:36 +0100
gajim (0.13.1-1) unstable; urgency=low
* New upstream release. Closes: #559905
* Update PyGTK requirement to 2.12.0 minimum
* Fix filetransfer proxies testing, keepalive handling, memory leak.
Closes: #524514
* Better connection. Closes: #547267
* Fix proxy test on startup. Closes: #453910
* Fix sound playing. Closes: #527275
* Update debhelper compatibility level to 7
-- Yann Leboulanger <asterix@lagaule.org> Sun, 29 Nov 2009 01:21:04 +0100
gajim (0.12.5-1) unstable; urgency=low
* New upstream release which fixes file transfer. Closes: #544466
* Fix history manager. Closes: #539109
* Fix custom host / port usage. Closes: #539267
* update python-gnome* dependancies. Closes: #541553
-- Yann Leboulanger <asterix@lagaule.org> Sun, 08 Aug 2009 00:06:15 +0100
gajim (0.12.3-1) unstable; urgency=low
* New upstream release.
* OS info are now caches. Closes: #509675
* keepalive system has been improved. Closes: #521144
* Recommends python-crypto for encryption. Closes: #513892
* update to 3.8.2 Debian Policy
* update to debhelper V6
* added watch file
-- Yann Leboulanger <asterix@lagaule.org> Sun, 24 Jun 2009 20:46:15 +0100
gajim (0.12.1-1) unstable; urgency=low
* New upstream release.
* Fix coming back from suspend. Closes: #500523
* Fix menuitem shortcut. Closes: #440530
* Warn user when logs database is brocken. Closes: #447889
* Check server certificate using python-openssl. Closes: #450756
* Don't pool to get played music from Banshee. Closes: #472862
* Escape non-ascii password correcly. Closes: #495540
* Fix URL recognition. Closes: #407806
* Suggest python-kerberos for GSSAPI authentication.
* Suggest python-sexy for clickable links in chat banners.
* Recommends python-openssl instead of python-pyopenssl. Package name has
changed.
* Depends on libc6 for gtkspell.so module
* Build Gajim modules against python2.5
-- Yann Leboulanger <asterix@lagaule.org> Wed, 21 Dec 2008 14:40:16 +0100
gajim (0.11.4-1) unstable; urgency=low
* New upstream release.
* Fix tab switching. Closes: #452257
* update to 3.7.3 Debian Policy
* Add Homepage, Vcs-Svn, Vcs-Browser fields to control file
-- Yann Leboulanger <asterix@lagaule.org> Wed, 05 Dec 2007 22:23:30 +0100
gajim (0.11.3-1) unstable; urgency=low
* New upstream release.
* Fix depand list so that Gajim will work when python2.5 will be the
default. Closes: #445275
* Fix focus bug. Closes: #447985
* Depend on dnsutils to use SRV records. Closes: #434690
-- Yann Leboulanger <asterix@lagaule.org> Fri, 16 Nov 2007 19:01:54 +0100
gajim (0.11.2-1) unstable; urgency=low
* New upstream release.
* Don't optionaly depend on python2.5. Closes: #418252
* Better handle gnome-keyring. Closes: #433315, #424293
* Handle dbus restart. Closes: #434993
* Don't allow bookmark creation on server that don't support that.
Closes: #438620
* Fix list_contact dbus signature. Closes: #440225
* Remove changelog.gz from /usr/share/doc/gajim. Closes: #412632
-- Yann Le Boulanger <asterix@lagaule.org> Sun, 22 Sep 2007 22:22:34 +0100
gajim (0.11.1-1) unstable; urgency=low
* New upstream release.
* Don't depend on python2.4 specifically
* Don't recommand libdbus, python-dbus does
* Tooltips in chat window are now correctly destroyed. Closes: #404693
-- Yann Le Boulanger <asterix@lagaule.org> Sun, 18 Feb 2007 22:15:57 +0100
gajim (0.11-2) unstable; urgency=low
* Add missing build depends to get gajim-remote. Closes: #405969
* Update recommands to support dbus. Closes: #402355
* Make python-gnupginterface a recommanded package. Closes: #405808
-- Yann Le Boulanger <asterix@lagaule.org> Tue, 09 Jan 2007 18:32:26 +0100
gajim (0.11-1) unstable; urgency=low
* New upstream release. Closes: #403806
* Enable IPv6 support. Closes: #386062
* Fix popup-menu binding. Closes: #388564
* Fix quick access letter with spanish translation. Closes: #385410
* Fix typo in german translation. Closes: #398195
* Fix a bug with Gaim avatars. Closes: #398911
-- Yann Le Boulanger <asterix@lagaule.org> Tue, 19 Dec 2006 14:25:32 +0100
gajim (0.10.1-6) unstable; urgency=low
* fix LDFLAGS problem. Closes: #384439
-- Yann Le Boulanger <asterix@lagaule.org> Mon, 24 Jul 2006 14:45:34 +0200
gajim (0.10.1-5) unstable; urgency=low
* Add dependance on python2.4. Closes: #379662
-- Yann Le Boulanger <asterix@lagaule.org> Mon, 19 Jul 2006 21:30:08 +0200
gajim (0.10.1-4) unstable; urgency=low
* Fix warning at installation. Closes: #366725
* Fix pt_BR translation.
-- Yann Le Boulanger <asterix@lagaule.org> Mon, 19 Jul 2006 21:30:08 +0200
gajim (0.10.1-3) unstable; urgency=low
* Updated for new Python policy.
* nautilus-sendto is now suggested. Closes: #377309
-- Yann Le Boulanger <asterix@lagaule.org> Mon, 17 Jul 2006 16:46:58 +0200
gajim (0.10.1-2) unstable; urgency=low
* new pytyhon policy Closes: #375310
* default player is now 'aplay -q' Closes: #374529
* python-gnupginterface now support python2.4. Recommends this one.
* Standards-version updated to 3.7.2 (no changes needed).
-- Yann Le Boulanger <asterix@lagaule.org> Tue, 27 Jun 2006 22:47:08 +0200
gajim (0.10.1-1) unstable; urgency=low
* new upstream release
-- Yann Le Boulanger <asterix@lagaule.org> Fri, 2 Jun 2006 22:07:29 +0200
gajim (0.10-1) unstable; urgency=low
* new upstream release
* fix description typo Closes: #349249
* Gajim now recommends dnsutils instead of python-dns
* Gajim now depends on python2.4 Closes: #357777, #364078
* Use Gajim's GnuPGInterface file as there is no python2.4-gnupginterface
package
-- Yann Le Boulanger <asterix@lagaule.org> Wed, 12 Apr 2006 10:55:16 +0100
gajim (0.9.1-2) unstable; urgency=low
* fix group bug Closes: #345306
-- Yann Le Boulanger <asterix@lagaule.org> Fri, 30 Dec 2005 13:09:55 +0100
gajim (0.9.1-1) unstable; urgency=low
* new upstream release
* Gajim now reconnects when connection is lost Closes: #329376
* Status-changer widget's behaviour has been improved Closes: #340499
* Gajim now recommends python-dns Closes: #340492
* new russian translation Closes: #337971
* Gajim now depends on python-pysqlite2, recommends python-dbus and
notification-daemon, and suggests python-gnome2
-- Yann Le Boulanger <asterix@lagaule.org> Fri, 27 Dec 2005 01:20:54 +0100
gajim (0.8.2-1) unstable; urgency=low
* all files in ~/.gajim are not 700: Closes: #325080
* gajim-remote.py is now in package: Closes: #324481
* updated russian translation: Closes: #325126
* theme issue fixed: Closes: #324493
* Gajim can now use python-dns so SRV works: Closes: #326655
* Gajim now depends on python-gtk2 >= 2.6.0
-- Yann Le Boulanger <asterix@lagaule.org> Sun, 02 Sep 2005 14:56:48 +0200
gajim (0.8-1) unstable; urgency=low
* new upstream release
* use cdbs
* build-depend on libxss-dev Closes: #323524
* translation improved Closes: #324094,#323993
* Standards-version updated to 3.6.2 (no changes needed).
-- Yann Le Boulanger <asterix@lagaule.org> Fri, 1 Jul 2005 18:35:02 +0200
gajim (0.7.1-1) unstable; urgency=low
* Initial Release. Closes: #311215
* GnuPGInterface module is in debian, no need to keep it in sources.
-- Yann Le Boulanger <asterix@lagaule.org> Wed, 15 Jun 2005 23:22:19 +0200
Source: gajim
Section: net
Priority: optional
Maintainer: Yann Leboulanger <asterix@lagaule.org>
Build-Depends: debhelper (>= 7), cdbs (>= 0.4.43), python-support (>= 0.7.1), python-dev, libgtk2.0-dev, python-gtk2-dev, gettext (>= 0.17-4), intltool (>= 0.40.1), imagemagick, python-central (>= 0.5)
Build-Conflicts: python2.3
XS-Python-Version: >= 2.4
Standards-Version: 3.8.3
Homepage: http://www.gajim.org
Vcs-Hg: http://hg.gajim.org/gajim/
Vcs-Browser: http://hg.gajim.org/gajim/file
Package: gajim
Architecture: any
XB-Python-Version: ${python:Versions}
Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}, python-support (>= 0.7.1), python-glade2 (>= 2.12.0), python-gtk2 (>= 2.12.0), dnsutils
Recommends: dbus, python-dbus, notification-daemon, python-gnupginterface, python-openssl (>= 0.9), python-crypto
Suggests: python-gconf, python-gnome2, nautilus-sendto, avahi-daemon, python-avahi, network-manager, libgtkspell0, aspell-en, python-gnomekeyring, gnome-keyring, python-sexy, python-kerberos (>= 1.1), texlive-latex-base, dvipng
Description: Jabber client written in PyGTK
Gajim is a Jabber client. It has a tabbed user interface with normal chats,
group chats, and has many features such as, TLS, GPG, SSL, multiple accounts,
avatars, file transfers, D-Bus and Metacontacts.
This package was debianized by Yann Leboulanger asterix@lagaule.org on
Wed, 16 Jun 2005 20:00:00 +0100.
It was downloaded from:
http://www.gajim.org/downloads/
Upstream Authors:
- Yann Le Boulanger <asterix@lagaule.org>
- Jean-Marie Traissard <jim@lapin.org>
- Stephan Erb <steve-e@h3c.de>
Copyright: (c) 2003-2009 Gajim Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Debian system; see the file /usr/share/common-licenses/GPL-3. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
usr/bin
usr/share/gajim
usr/share/man/man1
usr/share/pixmaps
usr/share/applications
usr/share/menu
usr/share/lintian/overrides
usr/lib/gajim
.\" 20050901
.TH "Gajim-history-manager" "1" "September 01, 2005" "Gajim dev team" ""
.SH "NAME"
Gajim-history-manager \- Tool to manage gajim logs
.SH "SYNOPSIS"
.B gajim-history-manager [\-c config-path] [\-h]
.SH "DESCRIPTION"
.B Gajim-history-manager
is a tool to manage (do some cleanup) log file of Gajim jabber client.
.PP
.SH "OPTIONS"
.TP
\fB\-c\fR, \fB\-\-config-path\fR path
Path where logs.db is located. ~/.gajim by default.
.TP
\fB\-h\fR, \fB\-\-help\fR
Print this help.
.SH "FEEDBACK"
You can report bugs or feature requests in http://trac.gajim.org or in the mailing list: http://lists.gajim.org/cgi\-bin/listinfo/gajim\-devel. You can also find us in our room gajim@conference.gajim.org
.SH "AUTHORS"
Written by Yann Le Boulanger <asterix@lagaule.org>, Nikos Kouremenos <kourem@gmail.com> and Dimitur Kirov <dkirov@gmail.com>.
data/gajim.1
data/gajim-remote.1
debian/gajim-history-manager.1
?package(gajim): \
needs="X11" \
section="Applications/Network/Communication" \
command="/usr/bin/gajim" \
icon="/usr/share/pixmaps/gajim.xpm" \
title="Gajim" \
longtitle="Gajim: GTK Jabber Client" \
description="GTK Jabber Client."
Index: Makefile.am
===================================================================
--- Makefile.am (revision 7202)
+++ Makefile.am (working copy)
@@ -9,7 +9,6 @@
docfiles_DATA = README \
README.html \
ChangeLog \
- COPYING \
THANKS \
AUTHORS
--- Makefile.in
+++ Makefile.in
@@ -273,7 +273,6 @@
docfiles_DATA = README \
README.html \
ChangeLog \
- COPYING \
THANKS \
AUTHORS
Index: src/common/passwords.py
===================================================================
--- src/common/passwords.py Sun Apr 25 21:13:15 2010 +0200
+++ src/common/passwords.py Thu Nov 04 20:33:05 2010 +0100
@@ -197,7 +197,8 @@
if USER_USES_GNOMEKEYRING:
try:
storage = GnomePasswordStorage()
- except (gnomekeyring.NoKeyringDaemonError, gnomekeyring.DeniedError):
+ except (gnomekeyring.NoKeyringDaemonError, gnomekeyring.DeniedError,
+ gnomekeyring.CancelledError):
storage = None
if storage is None:
if gajim.config.get('use_kwalletcli'):
Index: src/common/xmpp/idlequeue.py
===================================================================
--- src/common/xmpp/idlequeue.py Sun Sep 18 12:54:42 2011 +0200
+++ src/common/xmpp/idlequeue.py Sun Sep 18 12:54:42 2011 +0200
@@ -362,20 +362,25 @@
self.unplug_idle(fd)
return False
+ read_write = False
if flags & PENDING_READ:
#print 'waiting read on %d, flags are %d' % (fd, flags)
obj.pollin()
- return True
+ read_write = True
- elif flags & PENDING_WRITE:
+ elif flags & PENDING_WRITE and not flags & IS_CLOSED:
obj.pollout()
- return True
+ read_write = True
- elif flags & IS_CLOSED:
+ if flags & IS_CLOSED:
# io error, don't expect more events
self.remove_timeout(obj.fd)
self.unplug_idle(obj.fd)
obj.pollend()
+ return False
+
+ if read_write:
+ return True
return False
def process(self):
diff -Nurad gajim-0.13.4.orig//src/common/helpers.py gajim-0.13.4/src/common/helpers.py
--- gajim-0.13.4.orig//src/common/helpers.py 2012-04-17 15:59:08.000000000 +0000
+++ gajim-0.13.4/src/common/helpers.py 2012-04-17 15:59:18.000000000 +0000
@@ -39,6 +39,7 @@
import base64
import sys
import hashlib
+import shlex
from encodings.punycode import punycode_encode
@@ -355,8 +356,17 @@
pass
return False
-def exec_command(command):
- subprocess.Popen('%s &' % command, shell=True).wait()
+def exec_command(command, use_shell=False):
+ """
+ execute a command. if use_shell is True, we run the command as is it was
+ typed in a console. So it may be dangerous if you are not sure about what
+ is executed.
+ """
+ if use_shell:
+ subprocess.Popen('%s &' % command, shell=True).wait()
+ else:
+ args = shlex.split(command.encode('utf-8'))
+ p = subprocess.Popen(args)
def build_command(executable, parameter):
# we add to the parameter (can hold path with spaces)
diff -Nurad gajim-0.13.4.orig//src/common/latex.py gajim-0.13.4/src/common/latex.py
--- gajim-0.13.4.orig//src/common/latex.py 2012-04-17 15:59:08.000000000 +0000
+++ gajim-0.13.4/src/common/latex.py 2012-04-17 15:59:54.000000000 +0000
@@ -29,7 +29,7 @@
import os
import random
-from tempfile import gettempdir
+from tempfile import gettempdir,mkstemp,mkdtemp
from subprocess import Popen, PIPE
import logging
@@ -57,10 +57,10 @@
return True
return False
-def get_tmpfile_name():
+def get_tmpfile_name(tmpdir):
random.seed()
int_ = random.randint(0, 100)
- return os.path.join(gettempdir(), 'gajimtex_' + int_.__str__())
+ return os.path.join(tmpdir, 'gajimtex_' + int_.__str__())
def write_latex(filename, str_):
texstr = '\\documentclass[12pt]{article}\\usepackage[dvips]{graphicx}'
@@ -78,12 +78,12 @@
# a wrapper for Popen so that no window gets opened on Windows
# (i think this is the reason we're using Popen rather than just system())
# stdout goes to a pipe so that it can be read
-def popen_nt_friendly(command):
+def popen_nt_friendly(command, directory):
if os.name == 'nt':
# CREATE_NO_WINDOW
- return Popen(command, creationflags=0x08000000, cwd=gettempdir(), stdout=PIPE)
+ return Popen(command, creationflags=0x08000000, cwd=directory, stdout=PIPE)
else:
- return Popen(command, cwd=gettempdir(), stdout=PIPE)
+ return Popen(command, cwd=directory, stdout=PIPE)
def check_for_latex_support():
'''check is latex is available and if it can create a picture.'''
@@ -98,9 +98,9 @@
except LatexError:
return False
-def try_run(argv):
+def try_run(argv, directory):
try:
- p = popen_nt_friendly(argv)
+ p = popen_nt_friendly(argv, directory)
out = p.communicate()[0]
log.info(out)
return p.wait()
@@ -125,21 +125,28 @@
# we triggered the blacklist, immediately return None
return None
- tmpfile = get_tmpfile_name()
+ tmpdir = ""
+ tmppng = ""
+ try:
+ tmpdir = mkdtemp(prefix="gajim")
+ tmppng = mkstemp(suffix=".png")[1]
+ except Exception:
+ raise LatexError("could not securely create one or more temporary files for LaTeX conversion")
+ tmpfile = get_tmpfile_name(tmpdir)
# build latex string
write_latex(os.path.join(tmpfile + '.tex'), str_)
# convert TeX to dvi
exitcode = try_run(['latex', '--interaction=nonstopmode',
- tmpfile + '.tex'])
+ tmpfile + '.tex'], tmpdir)
if exitcode == 0:
# convert dvi to png
latex_png_dpi = gajim.config.get('latex_png_dpi')
exitcode = try_run(['dvipng', '-bg', bg_str, '-fg', fg_str, '-T',
'tight', '-D', latex_png_dpi, tmpfile + '.dvi', '-o',
- tmpfile + '.png'])
+ tmpfile + '.png'], tmpdir)
# remove temp files created by us and TeX
extensions = ['.tex', '.log', '.aux', '.dvi']
@@ -149,11 +156,17 @@
except Exception:
pass
+ if exitcode == 0:
+ os.rename(tmpfile + '.png', tmppng)
+ else:
+ os.remove(tmppng)
+
+ os.rmdir(tmpdir)
if isinstance(exitcode, (unicode, str)):
raise LatexError(exitcode)
if exitcode == 0:
- result = tmpfile + '.png'
+ result = tmppng
return result
diff -Nurad gajim-0.13.4.orig//src/common/logger.py gajim-0.13.4/src/common/logger.py
--- gajim-0.13.4.orig//src/common/logger.py 2012-04-17 15:59:08.000000000 +0000
+++ gajim-0.13.4/src/common/logger.py 2012-04-17 15:59:18.000000000 +0000
@@ -527,7 +527,7 @@
except exceptions.PysqliteOperationalError, e:
# Error trying to create a new jid_id. This means there is no log
return []
- where_sql = self._build_contact_where(account, jid)
+ where_sql, jid_tuple = self._build_contact_where(account, jid)
now = int(float(time.time()))
timed_out = now - (timeout * 60) # before that they are too old
@@ -539,10 +539,9 @@
WHERE (%s) AND kind IN (%d, %d, %d, %d, %d) AND time > %d
ORDER BY time DESC LIMIT %d OFFSET %d
''' % (where_sql, constants.KIND_SINGLE_MSG_RECV,
- constants.KIND_CHAT_MSG_RECV, constants.KIND_SINGLE_MSG_SENT,
- constants.KIND_CHAT_MSG_SENT, constants.KIND_ERROR,
- timed_out, restore_how_many_rows, pending_how_many)
- )
+ constants.KIND_CHAT_MSG_RECV, constants.KIND_SINGLE_MSG_SENT,
+ constants.KIND_CHAT_MSG_SENT, constants.KIND_ERROR, timed_out,
+ restore_how_many_rows, pending_how_many), jid_tuple)
results = self.cur.fetchall()
except sqlite.DatabaseError:
@@ -569,7 +568,7 @@
except exceptions.PysqliteOperationalError, e:
# Error trying to create a new jid_id. This means there is no log
return []
- where_sql = self._build_contact_where(account, jid)
+ where_sql, jid_tuple = self._build_contact_where(account, jid)
start_of_day = self.get_unix_time_from_date(year, month, day)
seconds_in_a_day = 86400 # 60 * 60 * 24
@@ -580,7 +579,7 @@
WHERE (%s)
AND time BETWEEN %d AND %d
ORDER BY time
- ''' % (where_sql, start_of_day, last_second_of_day))
+ ''' % (where_sql, start_of_day, last_second_of_day), jid_tuple)
results = self.cur.fetchall()
return results
@@ -603,13 +602,13 @@
return results
else: # user just typed something, we search in message column
- where_sql = self._build_contact_where(account, jid)
+ where_sql, jid_tuple = self._build_contact_where(account, jid)
like_sql = '%' + query.replace("'", "''") + '%'
self.cur.execute('''
SELECT contact_name, time, kind, show, message, subject FROM logs
WHERE (%s) AND message LIKE '%s'
ORDER BY time
- ''' % (where_sql, like_sql))
+ ''' % (where_sql, like_sql), jid_tuple)
results = self.cur.fetchall()
return results
@@ -622,7 +621,7 @@
# Error trying to create a new jid_id. This means there is no log
return []
days_with_logs = []
- where_sql = self._build_contact_where(account, jid)
+ where_sql, jid_tuple = self._build_contact_where(account, jid)
# First select all date of month whith logs we want
start_of_month = self.get_unix_time_from_date(year, month, 1)
@@ -640,7 +639,7 @@
AND kind NOT IN (%d, %d)
ORDER BY time
''' % (where_sql, start_of_month, last_second_of_month,
- constants.KIND_STATUS, constants.KIND_GCSTATUS))
+ constants.KIND_STATUS, constants.KIND_GCSTATUS), jid_tuple)
result = self.cur.fetchall()
# convert timestamps to day of month
@@ -654,19 +653,20 @@
we had logs (excluding statuses)'''
where_sql = ''
if not is_room:
- where_sql = self._build_contact_where(account, jid)
+ where_sql, jid_tuple = self._build_contact_where(account, jid)
else:
try:
jid_id = self.get_jid_id(jid, 'ROOM')
except exceptions.PysqliteOperationalError, e:
# Error trying to create a new jid_id. This means there is no log
return None
- where_sql = 'jid_id = %s' % jid_id
+ where_sql = 'jid_id = ?'
self.cur.execute('''
SELECT MAX(time) FROM logs
WHERE (%s)
AND kind NOT IN (%d, %d)
- ''' % (where_sql, constants.KIND_STATUS, constants.KIND_GCSTATUS))
+ ''' % (where_sql, constants.KIND_STATUS, constants.KIND_GCSTATUS),
+ jid_tuple)
results = self.cur.fetchone()
if results is not None:
@@ -683,11 +683,13 @@
except exceptions.PysqliteOperationalError, e:
# Error trying to create a new jid_id. This means there is no log
return None
- where_sql = 'jid_id = %s' % jid_id
+ where_sql = 'jid_id = ?'
+ jid_tuple = (jid_id,)
+
self.cur.execute('''
SELECT time FROM rooms_last_message_time
WHERE (%s)
- ''' % (where_sql))
+ ''' % (where_sql), jid_tuple)
results = self.cur.fetchone()
if results is not None:
@@ -709,6 +711,7 @@
'''build the where clause for a jid, including metacontacts
jid(s) if any'''
where_sql = ''
+ jid_tuple = ()
# will return empty list if jid is not associated with
# any metacontacts
family = gajim.contacts.get_metacontacts_family(account, jid)
@@ -718,13 +721,15 @@
jid_id = self.get_jid_id(user['jid'])
except exceptions.PysqliteOperationalError, e:
continue
- where_sql += 'jid_id = %s' % jid_id
+ where_sql += 'jid_id = ?'
+ jid_tuple += (jid_id,)
if user != family[-1]:
where_sql += ' OR '
else: # if jid was not associated with metacontacts
jid_id = self.get_jid_id(jid)
- where_sql = 'jid_id = %s' % jid_id
- return where_sql
+ where_sql = 'jid_id = ?'
+ jid_tuple += (jid_id,)
+ return where_sql,jid_tuple
def save_transport_type(self, jid, type_):
'''save the type of the transport in DB'''
diff -Nurad gajim-0.13.4.orig//src/notify.py gajim-0.13.4/src/notify.py
--- gajim-0.13.4.orig//src/notify.py 2012-04-17 15:59:08.000000000 +0000
+++ gajim-0.13.4/src/notify.py 2012-04-17 15:59:18.000000000 +0000
@@ -323,7 +323,7 @@
command = gajim.config.get_per('notifications', str(advanced_notif_num),
'command')
try: