[Python-apps-team] Bug#608982: trac-sqlite2pg should not assume user has write access to conf/ directory
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Jan 5 05:46:16 UTC 2011
Package: trac
Version: 0.11.7-3~bpo50+1
Severity: wishlist
a tightly-configured trac instance might not always have write access to
its own conf/directory.
the trac-sqlite2pg contributed script in debian's trac package seems to
assume that it has write access in order to make a temporary copy of the
config.
i get the following error:
Traceback (most recent call last):
File "/usr/local/bin/trac-sqlite2pg", line 335, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/trac-sqlite2pg", line 331, in main
Main(opts)
File "/usr/local/bin/trac-sqlite2pg", line 244, in Main
pgenv = getPostgreSQLEnvironment(opts)
File "/usr/local/bin/trac-sqlite2pg", line 220, in getPostgreSQLEnvironment
x.environment_created()
File "/usr/lib/python2.5/site-packages/trac/env.py", line 504, in environment_created
self._update_sample_config()
File "/usr/lib/python2.5/site-packages/trac/env.py", line 545, in _update_sample_config
config.save()
File "/usr/lib/python2.5/site-packages/trac/config.py", line 211, in save
fileobj = AtomicFile(self.filename, 'w')
File "/usr/lib/python2.5/site-packages/trac/util/__init__.py", line 163, in __init__
(fd, self._temp) = tempfile.mkstemp(prefix=name + '-', dir=dir)
File "/usr/lib/python2.5/tempfile.py", line 302, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib/python2.5/tempfile.py", line 236, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/srv/trac/support/conf/trac.ini.sample-b3-m7y'
It would be better if this script created the sample config in /tmp, or
following $TMPDIR instead of trying to write a new file into conf/ (or
at least check for that error, and fall back to making the sample config
in /tmp if conf/ is unwritable by the user writing the query.
Regards,
--dkg
-- System Information:
Debian Release: 5.0.7
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-xen-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages trac depends on:
ii python 2.5.2-3 An interactive high-level object-o
ii python-central 0.6.8 register and build utility for Pyt
ii python-genshi 0.5.1-1 Python XML-based template engine
ii python-psycopg2 2.0.7-4 Python module for PostgreSQL
ii python-pysqlite2 2.4.1-1 Python interface to SQLite 3
ii python-setuptools 0.6c8-4 Python Distutils Enhancements
Versions of packages trac recommends:
ii apache2 2.2.9-10+lenny8 Apache HTTP Server metapackage
ii apache2-mpm-prefork [htt 2.2.9-10+lenny8 Apache HTTP Server - traditional n
ii libjs-jquery 1.2.6-2 JavaScript library for dynamic web
ii python-pygments 0.10-1 syntax highlighting package writte
ii python-subversion 1.5.1dfsg1-5 Python bindings for Subversion
ii python-tz 2008c-2 Python version of the Olson timezo
Versions of packages trac suggests:
ii libapache2-mod-python 3.3.1-7 Python-embedding module for Apache
ii python-docutils 0.5-2+lenny1 Utilities for the documentation of
pn python-textile <none> (no description available)
pn trac-accountmanager <none> (no description available)
pn trac-authopenid <none> (no description available)
pn trac-bitten <none> (no description available)
pn trac-bzr <none> (no description available)
pn trac-customfieldadmin <none> (no description available)
pn trac-email2trac <none> (no description available)
pn trac-git <none> (no description available)
pn trac-graphviz <none> (no description available)
pn trac-ja-resource <none> (no description available)
pn trac-mastertickets <none> (no description available)
pn trac-mercurial <none> (no description available)
pn trac-spamfilter <none> (no description available)
pn trac-wikiprint <none> (no description available)
pn trac-wikirename <none> (no description available)
pn trac-wysiwyg <none> (no description available)
pn trac-xmlrpc <none> (no description available)
-- no debconf information
More information about the Python-apps-team
mailing list