[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[rene@debian.org: Bug#205471: devscripts: running debuild could lead to deleting _all_ backup dirs/files on the system]



Does anyone have any suggestions as to a useful way forward on this
bug?  Note that accidentally running dpkg-buildpackage in the home
directory would have a similar impact in this scenario, although
debuild is worse as it climbs directories.

I'm not sure how best to handle this one, and would appreciate
people's thoughts.

   Julian

P.S. Please CC the bug report!

----- Forwarded message from Rene Engelhard <rene@debian.org> -----

Date: Thu, 14 Aug 2003 22:25:25 +0200
From: Rene Engelhard <rene@debian.org>
Subject: Bug#205471: devscripts: running debuild could lead to deleting _all_ backup dirs/files on the system
To: submit@bugs.debian.org

Package: devscripts
Version: 2.7.91
Severity: grave
Justification: causes data loss

Hi,

The following code present in debuild can cause serious data loss
(backup files maybe needed at some time or manually created foo.bak
files)

[...]
until (-e "debian/rules")
{
    chdir ".." or fatal "Can't chdir: $!";
    fatal "Cannot find debian/rules anywhere!  Are you in the source
    code tree?"
        if cwd() eq "/";
}
[...]
 system('dpkg-buildpackage', @dpkg_opts) == 0
        or fatal "dpkg-buildpackage failed!";
[...]

Why?

OK, let's explain: :)

I ocassionally duplicate some of mine debian dirs of e.g.
openoffice to work on two things simlultaneously and being
able to ci them indepently then. Or to test two different approaches.

Sometimes, I just copy debian/ to ~.

Now, when I accidentially don't issue debuild in an directory where
already a debian/rules is, debuild goes a step higher, doesn't find
debian/rules, goes a step higher, ... till it finds the debian/rules
in ~.

Since it then tries to build a package it runs clean. dh_clean
then apparently doesn't get the right info what to do and
tries to remove /etc/*.bak /etc/*~ (well, I think it just
does that under / so it affects all dirs, I stopped it after
a few secs when I got "Permission denied." messages thanks to
using fakeroot).

I am not sure whether this is a bug here or if debhelper should check
for that.
The ideal solution, though, would be that debhelper checks for
something like that but that debuild doesn't even has the chance to do
something like that. I see the sense of the code, though - it is
really nice if you want to run debuild directly from debian/patches or
so.

[...]

----- End forwarded message -----



Reply to: