Web lists-archives.com

Re: Limiting the power of packages




On 10/4/18 12:23 PM, Jonathan Dowland wrote:
> On Thu, Oct 04, 2018 at 12:09:05PM +0200, Thomas Goirand wrote:
>> And prevent stuff like with the bumblebee uninstall disaster because of
>> an added space, for example:
>>
>> rm -rf /usr /share/foo/bar.conf
> 
> Yes, or the similar bug in steam-for-linux steam.sh. Although neither
> made it into the Debian archive, so adding the features being discussed
> won't protect users who run external install scripts like these two
> examples.

The same kind of mistake could happen in a postrm script. And we really
want to prevent that.

One thing which I really would love to have as a declarative thing:

owned_config_file=foo.conf,username:group

would create username and group if absent from the system, copy foo.conf
from /usr/share/package-name/foo.conf to /etc/foo/foo.conf, with correct
640 rights owned by root:group, and remove foo.conf on purge.

I don't mind where this is declared (in debian/rules, or elsewhere), but
this shouldn't go in a maintainer script, as it affects multiple ones
(ie: postinst, postrm, etc.).

>From my experience, the more declarative things there is, the less
errors one makes. I've been caught numerous time forgetting to remove
foo.conf on purge... (shame on me). Lucky there's puiparts to catch
them, though it should just not happen!

Cheers,

Thomas Goirand (zigo)