Package: pastebinit
Version: 1.1-2
Severity: normal
Tags: squeeze patch

Users can not override pastebinit global config or add own service configs via
~/.pastebin.d conf files. This directory is not read by pastebinit, because of
an indention error in pastebinit code.

Only chance for users to override or add configs is to receive root priviliges
and change /etc/pastebin.d. For example to edit the expire time for
paste.debian.net (7 days as default is a really long time, even the website
offers only 72h as maximum). Changing global configs has the disadvantage of
checksum mismatch while new updates occour. And of course not every user has
the possibility to become root. Even if, this is not the prefered way because
pastebinit offers the possibility to use a local config directory for users.

You can test the bug if you move a config from /etc/pastebin.d to ~/.pastebin.d
and make a paste to this service. You will get an error that this service is
unknown.

The problem is an indention error in pastebinit function "def
preloadPastebins()". There are 2 nested for-loops. First to iterate all config
directories and the second to read all conf files inside of an config
directory. The return of the first loop has a too deep indention so it is
executed after the first run of the second for-loop. That means that pastebinit
does only read the conf files from the first config directory.

This bug was filled already for Ubuntu, see
https://bugs.launchpad.net/ubuntu/+source/pastebinit/+bug/701039
There is a fix mentioned in comment #2 in revision 81, see
http://bazaar.launchpad.net/~pastebinit-developers/pastebinit/trunk/revision/81

The patch just change the indention of the return so it will be executed just
after iteration of all config directories.

Best regards,
Max



-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-030200-generic (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pastebinit depends on:
ii  python                  2.6.6-3+squeeze6 interactive high-level object-orie
ii  python-configobj        4.7.2+ds-1       simple but powerful config file re

pastebinit recommends no packages.

pastebinit suggests no packages.

-- no debconf information
=== modified file 'pastebinit'
--- pastebinit  2010-04-11 16:13:29 +0000
+++ pastebinit  2010-12-10 15:46:59 +0000
@@ -67,7 +67,7 @@
                     print >> sys.stderr, _("%s: no 'basename' in [pastebin]") 
% filename
                     continue
                 pastebind[basename] = bininstance
-            return pastebind
+        return pastebind
 
     # pastey.net obfuscates parent ids for replies.  Rather than taking the
     # post ID given as the parent ID, we must handle this by going to that

Reply via email to