#608982 trac-sqlite2pg should not assume user has write access to conf/ directory

Package:
trac
Source:
trac
Submitter:
Daniel Kahn Gillmor
Date:
2021-01-11 01:15:17 UTC
Severity:
wishlist
#608982#5
Date:
2011-01-05 05:46:16 UTC
From:
To:
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,

#608982#10
Date:
2020-01-09 06:08:43 UTC
From:
To:
Dear submitter,

as the package trac has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/948052

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)