package Lintian::cpy_check; use strict; use warnings; use autodie; sub run my ($pkg, undef, $info) = @_; my $filename = "usr/share/doc/$pkg/copyright"; # BAD: This is an example of doing it wrong open(my $fd, '<', $info->unpacked($filename)); ...; close($fd); return;This has two trivial vulnerabilities[2].
package Lintian::cpy_check;
use strict; use warnings; use autodie;
use Lintian::Util qw(is_ancestor_of);
sub run
my ($pkg, undef, $info) = @_;
my $filename = "usr/share/doc/$pkg/copyright";
my $root = $info->unpacked
my $path = $info->unpacked($filename);
if ( -f $path and is_ancestor_of($root, $path))
open(my $fd, '<', $path);
...;
close($fd);
return;
Where is_ancestor_of is the only available utility to assist you currently. It hides away some 10-12 lines of code to resolve the two paths and correctly asserting that $path is (an ancestor of) $root. Prior to Lintian 2.5.12, you would have to do that ancestor check by hand in each and every check[4].
In the new version, the correct code would look something like this:
package Lintian::cpy_check;
use strict; use warnings; use autodie;
sub run
my ($pkg, undef, $info) = @_;
my $filename = "usr/share/doc/$pkg/copyright";
my $path = $info->index_resolved_path($filename);
if ($path and $path->is_open_ok)
my $fd = $path->open;
...;
close($fd);
return;
Now, you may wonder how that promotes safer code. At first glance, the checking code is not a lot simpler than the previous correct example. However, the new code has the advantage of being safer even if you forget the checks. The reasons are:
This is my monthly summary of my free software related activities. If you re among the people who made a donation to support my work (548.59 , thanks everybody!), then you can learn how I spent your money. Otherwise it s just an interesting status update on my various projects.
Distro Tracker
Now that tracker.debian.org is live, people reported bugs (on the new tracker.debian.org pseudo-package that I requested) faster than I could fix them. Still I spent many, many hours on this project, reviewing submitted patches (thanks to Christophe Siraut, Joseph Herlant, Dimitri John Ledkov, Vincent Bernat, James McCoy, Andrew Starr-Bochicchio who all submitted some patches!), fixing bugs, making sure the code works with Django 1.7, and started the same with Python 3.
I added a tox.ini so that I can easily run the test suite in all 4 supported environments (created by tox as virtualenv with the combinations of Django 1.6/1.7 and Python 2.7/3.4).
Over the month, the git repository has seen 73 commits, we fixed 16 bugs and other issues that were only reported over IRC in #debian-qa. With the help of Enrico Zini and Martin Zobel, we enabled the possibility to login via sso.debian.org (Debian s official SSO) so that Debian developers don t even have to explicitly create their account.
As usual more help is needed and I ll gladly answer your questions and review your patches.
Misc packaging work
Publican. I pushed a new upstream release of publican and dropped a useless build-dependency that was plagued by a difficult to fix RC bug (#749357 for the curious, I tried to investigate but it needs major work for make 4.x compatibility).
GNOME 3.12. With gnome-shell 3.12 hitting unstable, I had to update gnome-shell-timer (and filed an upstream ticket at the same time), a GNOME Shell extension to start some run-down counters.
Django 1.7. I packaged python-django 1.7 release candidate 1 in experimental (found a small bug, submitted a ticket with a patch that got quickly merged) and filed 85 bugs against all the reverse dependencies to ask their maintainers to test their package with Django 1.7 (that we want to upload before the freeze obviously). We identified a pain point in upgrade for packages using South and tried to discuss it with upstream, but after closer investigation, none of the packages are really affected. But the problem can hit administrators of non-packaged Django applications.
Misc stuff. I filed a few bugs (#754282 against git-import-orig uscan, #756319 against wnpp to see if someone would be willing to package loomio), reviewed an updated package for django-ratelimit in #755611, made a non-maintainer upload of mairix (without prior notice) to update the package to a new upstream release and bring it to modern packaging norms (Mako failed to make an upload in 4 years so I just went ahead and did what I would have done if it were mine).
Kali work resulting in Debian contributions
Kali wants to switch from being based on stable to being based on testing so I did try to setup britney to manage a new kali-rolling repository and encountered some problems that I reported to debian-release. Niels Thykier has been very helpful and even managed to improve britney thanks to the very specific problem that the kali setup triggered.
Since we use reprepro, I did write some Python wrapper to transform the HeidiResult file in a set of reprepro commands but at the same time I filed #756399 to request proper support of heidi files in reprepro. While analyzing britney s excuses file, I also noticed that the Kali mirrors contains many source packages that are useless because they only concern architectures that we don t host (and I filed #756523 against reprepro). While trying to build a live image of kali-rolling, I noticed that libdb5.1 and db5.1-util were still marked as priority standard when in fact Debian already switched to db5.3 and thus should only be optional (I filed #756623 against ftp.debian.org).
When doing some upgrade tests from kali (wheezy based) to kali-rolling (jessie based) I noticed some problems that were also affecting Debian Jessie. I filed #756629 against libfile-fcntllock-perl (with a patch), and also #756618 against texlive-base (missing Replaces header). I also pinged Colin Watson on #734946 because I got a spurious base-passwd prompt during upgrade (that was triggered because schroot copied my unstable s /etc/passwd file in the kali chroot and the package noticed a difference on the shell of all system users).
Thanks
See you next month for a new summary of my activities.
One comment Liked this article? Click here. My blog is Flattr-enabled.
I just did some Debian package review in a somewhat unusual way, and I
wanted to share that. I'm hoping other Debian developers (and other free
software contributors) that need to review others' contributions can
learn something from this, and that I can use this blog post as a way to
find out if other people are doing something similar.
It was pretty exciting! At the end of it, I joined #debian-mentors to talk
about how my cool process. Someone summarized it very accurately:
<sney> it almost sounds like you're working to replace yourself with automation
I got an error in the man page generation phase -- because at
build-time, I don't have requests-oauthlib:
make[2]: Leaving directory /tmp/python-pypump-0.5-1+dfsg/docs'
help2man --no-info \
-n 'sets up an environment and oauth tokens and allows for interactive testing' \
--version-string=0.5.1 /tmp/python-pypump-0.5-1+dfsg/pypump-shell > /tmp/python-pypump-0.5-1+dfsg/debian/pypump-shell.1
help2man: can't get --help' info from /tmp/python-pypump-0.5-1+dfsg/pypump-shell
Try --no-discard-stderr' if option outputs to stderr
make[1]: *** [override_dh_auto_build] Error 1
This seems to be because:
python-pypump-0.5-1+dfsg ./pypump-shell
Traceback (most recent call last):
File "./pypump-shell", line 26, in <module>
from pypump import PyPump, Client
File "/tmp/python-pypump-0.5-1+dfsg/pypump/__init__.py", line 19, in <module>
from pypump.pypump import PyPump, WebPump
File "/tmp/python-pypump-0.5-1+dfsg/pypump/pypump.py", line 28, in <module>
from six.moves.urllib import parse
ImportError: No module named urllib
$ ./pypump-shell
Traceback (most recent call last):
File "./pypump-shell", line 26, in <module>
from pypump import PyPump, Client
File "/tmp/python-pypump-0.5-1+dfsg/pypump/__init__.py", line 19, in <module>
from pypump.pypump import PyPump, WebPump
File "/tmp/python-pypump-0.5-1+dfsg/pypump/pypump.py", line 29, in <module>
from requests_oauthlib import OAuth1
ImportError: No module named requests_oauthlib
The deeper problem was a missing build-dependency, and I explained that
in my email. But the meta problem is that Simon didn't try building
this in a pbuilder, or otherwise clean build environment.
Simon fixed these problems, and submitted a fresh package to
Paul Tagliamonte and myself. It happened to
have some typos in the names of the new build dependencies. Paul
reviewed the fixed package, noticed the typos, fixed them, and uploaded
it. Simon had forgotten to do a test build the second time, too, which
is an understandable human failure. There was a two-day delay between
Simon's fixed resubmission, and Paul signing+uploading the fixed result.
In a pedagogical sense, there's something disappointing about that
exchange for me: Paul fixed an error Simon introduced, so we're not
teaching Simon to take total responsibility for his packages in Debian,
nor to understand the Debian system as well as he could. (Luckily, I
think Simon already understands the importance of taking responsibility!
In this case, it's just a hypothetical in this case.)
<paulproteus> The automation here, I think, is really interesting. <paulproteus> What I really want is for mentees to show up to me and say "Here is my package + build log with pbuilder, can you sponsor it please?" <Unit193> Oooooh! -*- Unit193 gets ideas. <paulproteus> Although the irony is that I actually like the community-building and relationship-building nature of having these things be conversations. <bremner> how will this brave new world cope with licensing issues? <paulproteus> bremner: It's not a replacement for actual review, just a tool-assist. <paulproteus> bremner: You might be relieved to know that much of Unit193's and my back and forth related to get-orig-source and licensing. (-: <bremner> I didn't doubt you ;). <paulproteus> If necessary I can just be a highly productive reviewer, but I would prefer to figure out some way that I can get other non-paulproteus people to get a similar assist. <paulproteus> I think the current blocker is "omg travis why are you bound to githubbbbbbbb" which is a reasonable concern.
Some jenkins.debian.net activities
Yesterday and today I've spent some time time on jenkins.debian.net, so that it's finally only available via https, or so I thought. I quickly learned that it's better still serving via http, but only when queried from localhost
Second, I've moved the git repo to QA group namespace on alioth and set up IRC notifications using the wonderful KGB client. There is no mailinglist which receives commit diffs yet, but thats also because it's mostly still me working on this. Though since yesterday there are now seven committers in the git history, which is two more than before:
Niels Thykier submitted job configuratios for running the lintian testsuite on stable, testing and sid on every commit to the lintian git repo. The test suite passes nicely on testing and unstable but fails for stable as it needs backports and we need to make the job to install those.
Gabriele Giacone submitted several patches so that soon hurd wgnu/hurd can be tested too. Currently this fails for two reasons, both of which are very temporarily: the hurd .iso image which was here this morning is gone now, and secondly I haven't installed (the locally build packages for) qemu and qemu-kvm packages with the fixes for #742386 as that .iso ain't there so this is pointless atm
But I'm very happy to have a hopefully soon working job which will regularily test installation of Debian hurd and I do hope that some Debian kfreebsd enthusiasts will pick up and fix the existing jobs for kfreebsd tests. (Hint hint hint! I'm also totally happy to help with that!)
This reminds me to mention one last bit: Thanks to Paul Wise, jenkins.d.n bugs are now tracked in the BTS among other Debian QA group bugs!
My last update about ongoing development of botch, the bootstrap/build ordering
tool chain, was three months ago with the announcement of
bootstrap.debian.net. Since then a number of things happened, so I thought
an update was due.
Build-Depends: large (>= 1.0), small <!profile.stage1>
But until packages with that syntax can hit the archive, a few more tools need
to understand the syntax. The patch we have for sbuild is very simple
because sbuild relies on libdpkg for dependency parsing.
We have a patch for apt too, but we have to rebase it for the current apt
version and have to adapt it so that it works exactly like the functionality
dpkg implements. But before we can do that we have to decide how to handle
mixed positive and negative qualifiers or whether to remove this feature
altogether because it causes too much confusion. The relevant thread on
debian-dpkg starts here.
./tools directory contains many Python
scripts using the networkx module to modify GraphML and the apt_pkg module to
modify rfc822 files.
tred tool which is part of graphviz and
allows to calculate the transitive reduction of a graph. This can help
making horrible situations much better.
Today I had to pleasure of releasing Lintian 2.5.18.1. It is a minor bug fix release on top of Lintian 2.5.18 (which I also released today ). When I was about to deploy the new version of Lintian on lintian.debian.org, I noticed a couple of errors in the log file that smelled of bugs. Indeed, when I investigated them I found two bugs, which were both introduced in Lintian 2.5.17.
Due to another bug in 2.5.17 and the some of the false-positives fixes, we are now doing a full run on lintian.debian.org. After having run for 7 hours, Lintian passed cipux . My rough estimate suggests that it will take 8 days at the current rate. For comparision, when we added amd64, Lintian spent 5 days processing all the new binaries (plus their source and the old binaries built from those source packages).
Of course estimate is rather rough. In particular, I am not sure that the heavy duty groups (e.g. linux and libreoffice) are evenly spread out among the letters of the alphabeth. Anyhow, there will be no updates on lintian.debian.org for the next week or so.
Next.