#155931 debhelper: please consider adding exception file to dh_fixperms or dedicated dh_setownerperm helper

#155931#5
Date:
2002-08-08 13:51:22 UTC
From:
To:
Hi,

dh_fixperms is almost unconfigurable. You'll have to fix all your
permissions and owners after running dh_fixperms.

Please consider adding an exception file ($PACKAGE.fixperms, for
example), that dh_fixperms would honor. It could contain lines like

/var/log/exim mail.mail 755
/usr/sbin/exim root.root 4755

or be even compatible to /var/lib/dpkg/statoverride, stating

mail adm 2750 /var/log/exim
root.root 4750 /usr/sbin/exim

This would save the package maintainer from manually setting
permissions after calling dh_fixperms.

Optionally, this functionality could be implemented in a new helper
dh_setownerperm that should then be called _after_ dh_fixperms.

Please consider adding that functionality.

Greetings
Marc

#155931#10
Date:
2002-08-08 14:49:15 UTC
From:
To:
Marc Haber wrote:

No you don't, you can use dh_fixperms -X.

#155931#15
Date:
2002-08-08 14:49:15 UTC
From:
To:
Marc Haber wrote:

No you don't, you can use dh_fixperms -X.

#155931#20
Date:
2002-08-08 16:37:07 UTC
From:
To:
Most of the other debhelpers can be controlled by a file as well. I
would find that a good idea for dh_fixperms as well.

a debhelperized exim package would need 8 -X clauses.

Greetings
Marc

#155931#25
Date:
2002-09-04 17:37:54 UTC
From:
To:
I'd also like this feature.  -X is inconvenient when you want fixperms
to operate on the contents of a directory, but leave the directory
itself alone.  For instance, consider this partial --contents listing:

drwxr-xr-x root/root         0 2002-09-03 17:16:33 ./var/games/
drwxr-xr-x root/root         0 2002-09-03 17:16:34 ./var/games/zangband/
drwxrwxr-x root/games        0 2002-09-03 17:16:33 ./var/games/zangband/apex/
-rw-r--r-- root/root       108 2002-09-03 17:16:33 ./var/games/zangband/apex/readme.txt
-rw-r--r-- root/root     10880 2002-09-03 17:16:33 ./var/games/zangband/apex/z_scores.raw

The directory var/games/zangband/apex needs to be mode 775 and group
games, but the files installed there by the package should have their
permissions adjusted.  If I use -X var/games/zangband/apex, dh_fixperms
does not adjust the permissions on readme.txt or z_scores.raw, which
means they get left as mode 664 root/root (due to the default umask).

I'd also like to point out that an exceptions file that explicitly lists
the files with unusual permissions, with the ownership and mode they
should have, would insulate packagers from problems with the upstream
'make install' and be less error-prone than a list of explicit chmod
operations.

zw

#155931#30
Date:
2004-11-28 00:58:26 UTC
From:
To:
tags 155931 +patch
thanks

Hi,

Jörg Jaspert and I wrote a patch that adds exception handling to
dh_fixperms.  Files called package.fixperms contain lines, each defining
ownership and a mode for a list of files and directories, similar to
entries in package.install files.  It was tested
with tinyca and nagios packages.

Regards,

uLI

#155931#35
Date:
2004-11-28 00:58:26 UTC
From:
To:
tags 155931 +patch
thanks

Hi,

Jörg Jaspert and I wrote a patch that adds exception handling to
dh_fixperms.  Files called package.fixperms contain lines, each defining
ownership and a mode for a list of files and directories, similar to
entries in package.install files.  It was tested
with tinyca and nagios packages.

Regards,

uLI

#155931#40
Date:
2015-01-02 07:17:51 UTC
From:
To:
package debhelper
tags 155931 - patch
thanks

That patch needs some improvements:
- chown after chmod will revert some permissions (like suid)
- no error handling:
  lines with exactly three words in in will be silently ignored
Possible further improvements:
- globbing (can't use filedoublearray's but would needs its own just
  like dh_install)
- input validation (for permissions? is there a way to avoid people
  using dynamic user/group names here?)

	Bernhard R. Link