Bernhard R. Link: File ownership and permissions in Debian packages
As you will know, every file on a unixoid system has some meta-data like owner,
group and permission bits.
This is of course also true for files part of some Debian package.
And it is not very surprising that different files should have different
permissions. Or even different owners or groups.
Which file has which settings is of course for the package maintainer to
decide and Debian would not be Debian if there were not ways for the
user to give their own preferences and have them preserved.
This post is thus about how those settings end up in the package and
what is to be observed when doing it.
As you will also have heard, a .deb file is simply a tar
archive stored as part of an ar archive, as you can verify by
unpacking a package manually:
$ ar t reprepro_4.8.1-1_amd64.deb debian-binary control.tar.gz data.tar.gz $ ar p reprepro_4.8.1-1_amd64.deb data.tar.gz gunzip tar -tvvf - drwxr-xr-x root/root 0 2011-10-10 12:05 ./ drwxr-xr-x root/root 0 2011-10-10 12:05 ./etc/ drwxr-xr-x root/root 0 2011-10-10 12:05 ./etc/bash_completion.d/ -rw-r--r-- root/root 19823 2011-10-10 12:05 ./etc/bash_completion.d/reprepro drwxr-xr-x root/root 0 2011-10-10 12:05 ./usr/ drwxr-xr-x root/root 0 2011-10-10 12:05 ./usr/share/ --More--(For unpacking stuff from scripts, you should of course use dpkg-deb --fsys-tarfile instead of ar gunzip. Above example is about the format, not a recipe to unpack files). This already explains how the information is usually encoded in the package: A tar file contains that information for each contained file and dpkg is simply using that information. (As tar stores numeric owner and group information, that limits group and owner information to users and groups with fixed numbers, i.e. 0-99. Other cases will be covered later.) The question for the maintainer is now: Where is the information which file has which owner/group/permissions in the .tar inside the .deb, and the answer is simple: It's taken from the files to be put into the .deb. This means that package tools could simply be implemented first by simply calling tar and there is no imminent need to write you own tar generator. It also means that the maintainer has full control and does not have to learn new descriptive languages or tools to change permissions, but can simply put the usually shell commands into debian/rules. There are some disadvantages, though: A normal user cannot change ownership of files and one has to make sure all files have proper permissions and owners. This means that dpkg-deb -b (or the usually used wrapper dh_builddeb) must be run in some context where you could change the file ownership to root first. This means you either need to be root, or at least to fake being root by using fakeroot. (While this could be considered some ugly workaround, it also means upstream's make install is run believing to be root, which also avoids some -- for a packager -- quite annoying automatisms in upstream build scripts assuming a package is not installed system wide if not installed as root). Another problem are random build host characteristics changing how files are created in the directory later given to dpkg-deb -b. For example an umask which might make all files non-world-readable by default. The usual workaround is to first fix up all those permissions. Most packages use dh_fixperms for this, which also sets executable bits according to some simple rules and has some more special cases so that the overall majority of packages does not need to look at permissions at all. So using some debhelper setup, every special permissions and all owner/group information for owner groups with fixed numbers only needs to be set using the normal command line tools between dh_fixperms and dh_builddeb. Everything else happens automatically. Note that games is a group with fixed gid. So it is not necessary (and usually a bug) to change group-ownership of files withing the package to group games in maintainer scripts (postinst,...). If a user wants to change permissions or ownership of a file, dpkg allows this using the dpkg-statoverride command. This command essentially manages a list of files to get special treatment and ownership and permission information they should get. This way a user can specify that files should have different permissions and this setting is applied if a new version of this file is installed by dpkg. Being a user setting especially means, that packages (that means their maintainer scripts) should not usually use dpkg-statoverride. There are two exceptions, though: Different permissions based on interaction with the user (e.g. asking question with debconf) and dynamically allocated users/groups with dynamic id. In both cases one should note that settings to dpkg-statoverride are settings of the user, so the same care should be given as to files in /etc, especially one should never override something the user has set in there. (I can think of no example where calling dpkg-statoverride --add without dpkg-statoverride --list in some maintainer script is not a serious bug: Either you override user settings or you are using debconf as a registry. Moral To recap, your package is doing something wrong if:
- Your maintainer scripts unconditionally change permissions of files within the package (Those should either be set within the package or you miss user configuration in dpkg-statoverride).
- Your maintainer scripts call dpkg-statoverride --add without having checked first whether the user already has done so with different values.
Content Security Policy is a
This is my monthly summary of my Debian related activities. If you re among the people who
Dpkg work
The month started with fixing newly reported bugs to prepare the 1.16.1.1 release:
Now the fundraising continues, but this time the goal is the liberation of the resulting book. For this to happen, we need to reach 25000 EUR in the liberation fund. So far we re at 37% of this goal with 9400 EUR in the liberation fund (which means that 59% of the money raised has been put in the liberation fund).
One of the things I liked about Gnome 2 was the ability to run a background 'slideshow' defined in an XML file with a list of background files to give me a change of scenery from time to time.
Switching to XFCE4 I can't seem to find a simple way to do that, but the ingredients are all there:
First thought is this: A bug's likelyhood of ever being fixed decays with
time, starting when I first read it. If I have to read it a second time,
the bug has already become more complex, since something prevented me from
just fixing it the first time. If more information has to be added to the
bug, that makes it yet more complex. If there is an argument in the bug
about whether it is a bug, or how to fix it, just revisiting the bug at a
later date can become more expensive than it's worth. Much of what is
involved in filing good and effective bug reports are obvious corollaries
of this. It also follows that it's best to either fix, or at least plan how
to fix a bug immediatly upon reading it.
Second thought is about "wontfix". A bug submitter and the developer
responsible for the bug see this state in very different ways, but the name
hides what it really means, which is that there is a meta-bug affecting
either the bug submitter, the developer, or both. Once you realize this,
wontfix bugs, from either side, become a bit personally insulting. They
also quickly decay to uselessness (see first thought), and then just lurk
there wasting the developer's time in various ways. Bug tracking systems
should not provide a "wontfix" state; if they want to track meta-bugs
they should provide a way to reassign such a bug to some other party who
can actually resolve such a meta-bug.
Executive summary
Debian should consider:
If you checkout
A few years ago I got up on stage and briefly talked about how the Linux community contained far too many people who were willing to engage in entirely inappropriate behaviour, how this discouraged people from getting involved and how we weren't very good at standing up against that sort of behaviour. Despite doing this in front of several hundred people, and despite the video of me doing so then being uploaded to the internet, this got me a sum total of:
If you ve ever had to migrate a service to a new machine, you ve probably
found

Well, when I got an invite to try G+, I decided to make my first foray
into social networking sites since friendster. It was mildly
interesting while it lasted, however it seems that it is over for me now.
I tried to use the name "Mike (stew) O'Connor" as I do on my gpg key.
This caused my accounted to get flagged as violating their "real
names" policy. I can't help but to feel a little offended that they
think they know what my name is better than I do. I have a bit of a
unique situation with my name. Pretty much NOBODY calls me "Mike" or
"Michael" save a few people from my childhood. Its been this way for
more than half of my life. My wife only ever has called me "stew".
My two year old knows my name is "stew" but doesn't know my name is
also "Mike". If I meet somebody new, I always introduce myself as
"stew". All my clients call me stew...
The instructions on google plus tell you "To help fight spam and
prevent fake profiles, use the name your friends, family or co-workers
usually call you.", So when my account was initially flagged. I tried
changing my name to "Stew O'Connor". My account was "pending review"
and I was still able to post and reply and the like. After review, my
account was suspended, some of my privacy settings were changed, and I
cannot change them back.
Out of the 60 or so people that added me on G+, only one of them
should ever be referring to me as "Mike". When someone calls me Mike
that isn't one of the handful of people that "should" be calling me
"Mike", my brain immediately puts them in the "oh, you don't know me
very well" category. Oh well, Google, amazingly, you don't know me
very well. After explaining to someone "oh, no you really should call
me stew like everyone else", you say "No, I'd rather just not talk to
you", now you are just being a jerk.
Now I guess I have a retort to people that use the phrase which I find
so annoying: "GIYF".
Update: I appealed to change my name to Stew O'Connor which was
denied, then appealed to change my name to Mike O'Connor which was
also denied. I guess I was supposed to use "Michael" or something?
Being denied "Mike", I deleted my suspeneded G+ account, feeling extra
flouncy, chnaged by default search engine to duckduckgo.com.