diff options
author | jlam <jlam@pkgsrc.org> | 2002-10-04 23:46:26 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-10-04 23:46:26 +0000 |
commit | 561ca1b8b7fd84b59c991487a184066040d324e8 (patch) | |
tree | 05d13a1c2ca6a91794aca716a345bd5dc138b9df /mk/install | |
parent | 67a10bfe8a6e6e8376f01570e105dac2c03c8605 (diff) | |
download | pkgsrc-561ca1b8b7fd84b59c991487a184066040d324e8.tar.gz |
Add new bsd.pkg.install.mk tunable variable: SPECIAL_PERMS.
SPECIAL_PERMS are lists that look like:
file user group mode
At post-install time, file (it may be a directory) is changed to be
owned by user:group with mode permissions.
SPECIAL_PERMS should be used primarily to change permissions of files or
directories listed in the PLIST. This may be used to make certain files
set-uid or to change the ownership or a directory.
Packages that install setuid executables should list them in SPECIAL_PERMS
so that the correct user and group will be used for file ownership, even
if the uid/gid changes between the package creation and the package
installation.
Diffstat (limited to 'mk/install')
-rw-r--r-- | mk/install/install | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mk/install/install b/mk/install/install index 78323de6f92..70db7f40f48 100644 --- a/mk/install/install +++ b/mk/install/install @@ -1,6 +1,6 @@ # start of install # -# $NetBSD: install,v 1.14 2002/10/04 23:35:51 jlam Exp $ +# $NetBSD: install,v 1.15 2002/10/04 23:46:27 jlam Exp $ case ${STAGE} in PRE-INSTALL) @@ -262,6 +262,23 @@ EOF fi fi done + _print_special_header=1 + eval set -- ${SPECIAL_PERMS} + while [ $# -gt 0 ]; do + file="$1"; owner="$2"; group="$3"; mode="$4" + shift; shift; shift; shift + + if [ ${_print_special_header} -gt 0 ]; then + _print_special_header=0 + msgadd "" + msgadd "The following files and directories have special permissions:" + msgadd "" + fi + msgadd "#${file} (o=${owner}, g=${group}, m=${mode})" + ${CHOWN} "${owner}" "${file}" + ${CHGRP} "${group}" "${file}" + ${CHMOD} ${mode} "${file}" + done if ! msgempty; then ${ECHO} "===========================================================================" msgprint |