diff options
author | Colin Watson <cjwatson@debian.org> | 2016-12-06 23:57:04 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-12-09 20:47:58 +0000 |
commit | 0f8b5518949866075c25787bdc4e9c064597c21e (patch) | |
tree | c7128682da7b9edb2370bb52e7e7f3bb1c49e3dc /m4 | |
parent | 62cec68b0cca39e7542985c9143a98c055624808 (diff) |
Separate cache owner from --enable-setuid option
It's useful to have a notion of the cache owner even when man is not
installed setuid. --enable-setuid no longer takes an argument, and the
owner is now set by the --enable-cache-owner option instead.
* m4/man-arg-cache-owner.m4: New file.
* m4/man-arg-setuid.m4: Stop accepting an argument. Only set man_mode,
not man_owner.
* configure.ac: Call MAN_ARG_CACHE_OWNER.
* src/Makefile.am (install-exec-hook): Only chown man and mandb if
man_mode is 4755 (as well as the existing test for man_owner being
non-empty).
Diffstat (limited to 'm4')
-rw-r--r-- | m4/man-arg-cache-owner.m4 | 27 | ||||
-rw-r--r-- | m4/man-arg-setuid.m4 | 26 |
2 files changed, 38 insertions, 15 deletions
diff --git a/m4/man-arg-cache-owner.m4 b/m4/man-arg-cache-owner.m4 new file mode 100644 index 00000000..dae9ecc3 --- /dev/null +++ b/m4/man-arg-cache-owner.m4 @@ -0,0 +1,27 @@ +# man-arg-cache-owner.m4 serial 1 +dnl MAN_ARG_CACHE_OWNER +dnl Add an --enable-cache-owner option. + +AC_DEFUN([MAN_ARG_CACHE_OWNER], +[ +AC_ARG_ENABLE([cache-owner], +[AS_HELP_STRING([--enable-cache-owner[=ARG]], [make system-wide cache files be owned by user ARG [arg=man]]) +AS_HELP_STRING([--disable-cache-owner], [don't constrain ownership of system-wide cache files])], + [if test "$enableval" = "yes" + then + enableval=man + fi + if test "$enableval" = "no" + then + man_owner= + AC_MSG_NOTICE([System-wide cache files will have unconstrained ownership]) + else + man_owner=$enableval + AC_MSG_NOTICE([System-wide cache files will be owned by $enableval]) + AC_DEFINE_UNQUOTED([SECURE_MAN_UID], ["$man_owner"], + [Define as the owner of system-wide cache files.]) + fi], + [man_owner=man + AC_DEFINE_UNQUOTED([SECURE_MAN_UID], ["$man_owner"])]) +AC_SUBST([man_owner]) +]) diff --git a/m4/man-arg-setuid.m4 b/m4/man-arg-setuid.m4 index e8de9e04..d5a89bfc 100644 --- a/m4/man-arg-setuid.m4 +++ b/m4/man-arg-setuid.m4 @@ -1,31 +1,27 @@ -# man-arg-setuid.m4 serial 1 +# man-arg-setuid.m4 serial 2 dnl MAN_ARG_SETUID dnl Add an --enable-setuid option. AC_DEFUN([MAN_ARG_SETUID], [ AC_ARG_ENABLE([setuid], -[AS_HELP_STRING([--enable-setuid[=ARG]], [install man setuid to user ARG [ARG=man]]) +[AS_HELP_STRING([--enable-setuid], [install man setuid]) AS_HELP_STRING([--disable-setuid], [don't install man setuid])], [if test "$enableval" = "yes" then - enableval=man - fi - if test "$enableval" = "no" + if test -z "$man_owner" + then + AC_MSG_ERROR([--enable-setuid is incompatible with --disable-cache-owner]) + fi + man_mode="4755" + AC_MSG_NOTICE([Man will be installed setuid $man_owner]) + elif test "$enableval" = "no" then - man_owner= man_mode="755" AC_MSG_NOTICE([Man will not be installed setuid]) else - man_owner=$enableval - man_mode="4755" - AC_MSG_NOTICE([Man will be installed setuid $enableval]) - AC_DEFINE_UNQUOTED([SECURE_MAN_UID], ["$man_owner"], - [Define as the setuid owner of man or undefine if not installing setuid.]) + AC_MSG_ERROR([--enable-setuid=$enableval is no longer valid; consider --enable-cache-owner=$enableval --enable-setuid instead]) fi], - [man_owner=man - man_mode="4755" - AC_DEFINE_UNQUOTED([SECURE_MAN_UID], ["$man_owner"])]) -AC_SUBST([man_owner]) + [man_mode="4755"]) AC_SUBST([man_mode]) ]) |