build-sys: Check whether tss user and group are available

If the tcsd (trousers) is available, TPM 1.2 support should work as well.
Typically the tss user and group should be defined at this point, but
this may not always be the case, so make sure that this user and group
are available on the system.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2020-07-23 14:17:44 -04:00 committed by Stefan Berger
parent b71a228538
commit aa88eebe32

View File

@ -407,6 +407,24 @@ AC_ARG_WITH([tss-group],
[TSS_GROUP="$withval"],
[TSS_GROUP="tss"]
)
case $have_tcsd in
yes)
AC_MSG_CHECKING([whether TSS_USER $TSS_USER is available])
if ! test $(id -u $TSS_USER); then
AC_MSG_ERROR(["$TSS_USER is not available"])
else
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([whether TSS_GROUP $TSS_GROUP is available])
if ! test $(id -g $TSS_GROUP); then
AC_MSG_ERROR(["$TSS_GROUP is not available"])
else
AC_MSG_RESULT([yes])
fi
;;
esac
AC_SUBST([TSS_USER])
AC_SUBST([TSS_GROUP])