Debian Bug report logs - #291320
[DPKG-DEB] dpkg-deb --build --owner=root option to avoid fakeroot

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Sergei Ivanov <svivanov@pdmi.ras.ru>

Date: Thu, 20 Jan 2005 01:33:01 UTC

Severity: wishlist

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#291320; Package dpkg-dev. Full text and rfc822 format available.

Acknowledgement sent to Sergei Ivanov <svivanov@pdmi.ras.ru>:
New Bug report received and forwarded. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Sergei Ivanov <svivanov@pdmi.ras.ru>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg-dev: let "dpkg-deb -b" have some "--owner=root" option
Date: Thu, 20 Jan 2005 04:35:21 +0300
Package: dpkg-dev
Version: 1.10.25
Severity: wishlist

Hello,

It would be nice if dpkg-deb could produce .deb archives where all 
files are owned by root:root, ignoring the ownership attributes from
the filesystem.

This seems easy to implement - maybe using "GNUtar --owner...",
or rewriting the headers in the output of tar.

I'd suggest to introduce an option for this, so that in debian/rules
one could call dpkg-deb with this option and not use dh_testroot (thus 
allowing non-fakeroot builds).

Moreover, I think this could become the default in the future.
Let me explain why. I claim that *any* package with non-standard file 
owners in the .deb is buggy. (Non-standard == not in base-passwd.)

Proof: Policy says that in this case "you must arrange for your package
to create the user or group if necessary using adduser in the preinst or
postinst script". Well, if it's in postinst, then the ownership within
the .deb does not work - the user does not exist when the package is
unpacked. With adduser in preinst, the installation may work. However,
how does one *build* the package? If it's not installed yet, the
username is not in /etc/passwd, and the build breaks. So the package
ends up build-depending on itself.  QED.

Background: I am a user who wants custom builds of some packages.
My problem is that it's hard to split the last stage of build
into "make local-install" and "make deb-archive". (The changes 
are often needed just between these steps.)

Thank you for consideration,
Sergei

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.25
Locale: LANG=C, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages dpkg-dev depends on:
ii  binutils                      2.15-5     The GNU assembler, linker and bina
ii  cpio                          2.5-1.1    GNU cpio -- a program to manage ar
ii  make                          3.80-9     The GNU version of the "make" util
ii  patch                         2.5.9-2    Apply a diff file to an original
ii  perl [perl5]                  5.8.4-5    Larry Wall's Practical Extraction 
ii  perl-modules                  5.8.4-5    Core Perl modules

-- no debconf information




Bug reassigned from package `dpkg-dev' to `dpkg'. Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug title. Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#291320; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Sergei Ivanov <svivanov@pdmi.ras.ru>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #14 received at 291320@bugs.debian.org (full text, mbox):

From: Sergei Ivanov <svivanov@pdmi.ras.ru>
To: 291320@bugs.debian.org
Subject: patch submission
Date: Tue, 25 Jan 2005 04:32:46 +0300
[Message part 1 (text/plain, inline)]
> It would be nice if dpkg-deb could produce .deb archives where all 
> files are owned by root:root, ignoring the ownership attributes from
> the filesystem.

Here is a patch for this, see rootowner.patch in the attachment.
It introduces options --root-owner, to create root-owned archives,
and --same-owner (the default).

The second patch is a usage example, it allows dpkg itself to be built
without (fake)root. It is relatively large as I had to remove all those
"-o root -g root" install arguments (useless anyway). Besides that, the 
patch only deletes the `id -u` test and adds --root-owner to dpkg-deb.

Could you drop me a note on whether the feature is worth considering
for inclusion to dpkg, at some point in the future? (I don't know, 
maybe I'm the only one who finds fakeroot inconvenient.)

Best regards,
Sergei Ivanov
[rootowner.patch (text/plain, attachment)]
[build.patch (text/plain, attachment)]

Tags added: patch Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#291320; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #21 received at 291320@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Sergei Ivanov <svivanov@pdmi.ras.ru>
Cc: 291320@bugs.debian.org
Subject: Re: patch submission
Date: Fri, 4 Jul 2008 16:39:07 +0200
On Tue, 25 Jan 2005, Sergei Ivanov wrote:
> Could you drop me a note on whether the feature is worth considering
> for inclusion to dpkg, at some point in the future? (I don't know, 
> maybe I'm the only one who finds fakeroot inconvenient.)

At first sight, it looks reasonable. I updated your patch so that it
applies correctly against the master branch and I pushed it in my private
repo:
Branch: http://git.debian.org/?p=users/hertzog/dpkg.git;a=shortlog;h=refs/heads/pu/bug291320-dpkg-deb-force-root-owner
Patch: http://git.debian.org/?p=users/hertzog/dpkg.git;a=commitdiff;h=5fe1d467797a1cf8f03d1f4e4b656ac2a4a70a58

I tested the patch and it works as expected.

Guillem, any opinon?

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#291320; Package dpkg. (Mon, 12 Jul 2010 15:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nigel Stewart <nigels.com@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 12 Jul 2010 15:15:03 GMT) Full text and rfc822 format available.

Message #26 received at 291320@bugs.debian.org (full text, mbox):

From: Nigel Stewart <nigels.com@gmail.com>
To: 291320@bugs.debian.org
Subject: dpkg-deb --build --owner=root option to avoid fakeroot
Date: Mon, 12 Jul 2010 10:11:02 -0500
[Message part 1 (text/plain, inline)]
I updated this patch for dpkg_1.14.29.tar.gz, attached here.

Avoiding fakeroot is important in our case, for building .deb packages
on various Linux build hosts
with the same statically linked dpkg-deb binary.  Since RedHat doesn't
tend to have fakeroot, it
seems rather problematic to deploy that, especially given possible
mixtures of 32-bit and 64-bit
tar, etc.  Unfortunately when fakeroot fails it results in results in
the wrong file permissions in
the .deb, but in a production environment it is a matter of tracking
down which build host the
broken build came from.

I'd recommend reconsidering this for dpkg-deb mainline, if only
because we don't want to
maintain a fork of dpkg-deb.

Regards,

Nigel Stewart
[dpkg-deb-root.diff (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#291320; Package dpkg. (Sat, 01 Mar 2014 21:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Benn Bollay <benn.bollay@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 01 Mar 2014 21:24:04 GMT) Full text and rfc822 format available.

Message #31 received at 291320@bugs.debian.org (full text, mbox):

From: Benn Bollay <benn.bollay@gmail.com>
To: 291320@bugs.debian.org
Subject: dpkg-dev: let "dpkg-deb -b" have some "--owner=root" option
Date: Sat, 1 Mar 2014 13:16:03 -0800
[Message part 1 (text/plain, inline)]
Any update on this issue?  While the patch doesn't apply cleanly anymore to
1.17.16, it requires only a few moments to recreate.  I've added the patch
to this email.

I would like to see tihs rolled into the mainline.  Is there anything
blocking that?

Cheers,
--B
[Message part 2 (text/html, inline)]
[dpkg-291320.patch (application/octet-stream, attachment)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 03:46:40 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.