Skip to content

Commit b048a3e

Browse files
authored
Merge a2b9361 into f8ecd52
2 parents f8ecd52 + a2b9361 commit b048a3e

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

NEWS.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ several `FSD` notifications into one executed action. [PR #3097]
263263
include the source distribution (was posted for NUT v2.8.1 and v2.8.2
264264
tagged releases, but absent for v2.8.3 and v2.8.4). [#3056]
265265

266+
- The `configure` script would now probe (if it can) the operating systems for
267+
more user and group account names, such as `upsmon`, `nutmon`, `ups`, `nut`
268+
(last hit wins, separately for user and groups accounts) settling on one of
269+
those if detected instead of `nobody` (and optionally `nogroup`). It would
270+
also warn if `nobody` or `nogroup` end up being used for a build. [#3173]
271+
266272
- Updated `make spellcheck` to help avoid asciidoc admonition blocks with
267273
visually invalid sentences (after rendering as a box in HTML or PDF). [#3077]
268274

UPGRADING.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ Changes from 2.8.4 to 2.8.5
7171
to match the driver program name. Packaging recipes may have to be updated.
7272
Follow-up from slightly botched renaming in original contribution. [PR #545]
7373
74+
- The `configure` script would now probe (if it can) the operating systems for
75+
more user and group account names, such as `upsmon`, `nutmon`, `ups`, `nut`
76+
(last hit wins, separately for user and groups accounts) settling on one of
77+
those if detected instead of `nobody` (and optionally `nogroup`). It would
78+
also warn if `nobody` or `nogroup` end up being used for a build. This is
79+
not likely to affect package builds (which usually define the accounts to
80+
use), but may (hopefully positively) affect rebuilds of NUT on systems where
81+
an older version is already deployed. [#3173]
82+
7483
- The `configure` script should now try harder to report specifically
7584
the "purelib" location as `PYTHON*_SITE_PACKAGES`. Packaging recipes
7685
may have to be updated. [#1209]

configure.ac

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ AS_IF([test -n "`${PROBE_OS_GROUP} nogroup`" && test -z "`${PROBE_OS_GROUP} "${R
509509
[RUN_AS_GROUP="nogroup"]
510510
)
511511

512+
dnl Last hit wins, user and groups accounts separately
513+
for TOKEN in upsmon nutmon ups nut; do
514+
AS_IF([test -n "`${PROBE_OS_USER} ${TOKEN}`"], [RUN_AS_USER="${TOKEN}"])
515+
AS_IF([test -n "`${PROBE_OS_GROUP} ${TOKEN}`"], [RUN_AS_GROUP="${TOKEN}"])
516+
done
517+
unset TOKEN
518+
512519
dnl NOTE: NUT legacy default, keep as is for least surprise
513520
dnl Distributions are however welcome to specify the option to use tmpfs
514521
AS_CASE([${target_os}],
@@ -6943,6 +6950,12 @@ AS_IF([test -s "${ABS_TOP_SRCDIR}/install-sh" && ${GREP} -w MKDIRPROG "${ABS_TOP
69436950
])
69446951
])
69456952

6953+
AS_IF([test x"${RUN_AS_USER}" = xnobody || test x"${RUN_AS_GROUP}" = xnobody || test x"${RUN_AS_GROUP}" = xnogroup], [
6954+
AC_MSG_NOTICE([==========================================================])
6955+
AC_MSG_NOTICE([You have configured a build for default user '${RUN_AS_USER}' or])
6956+
AC_MSG_NOTICE([group '${RUN_AS_GROUP}' account names. This may be not safe.])
6957+
])
6958+
69466959
AS_IF([test x"${NUT_VERSION_DEPLOYED-}" = x"<reenter>"], [
69476960
AC_MSG_NOTICE([==========================================================])
69486961
AC_MSG_NOTICE([You have configured a build for "in-place" replacement])

docs/configure.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,12 @@ This was done since it's slightly better than staying around as
820820
hack for NFS access. You should create at least one separate user
821821
for this software.
822822

823+
Starting from NUT v2.8.5, further default user and group account names
824+
are probed in the operating system (which might exist if a different
825+
version of NUT was already installed before the build), currently trying
826+
`upsmon`, `nutmon`, `ups` or `nut` (last hit wins, separately for groups
827+
and users).
828+
823829
When such NUT daemons `setuid()` to some user account (whether built-in,
824830
or specified in configuration files, or passed on command line), they
825831
also typically assume that account's primary group via `setgid()`.

0 commit comments

Comments
 (0)