Translate the configured user and group to a numerical UID and GID.

This commit is contained in:
Tobias Brunner 2009-07-20 21:01:13 +02:00
parent def1777eca
commit 7d2b06da6a
1 changed files with 19 additions and 0 deletions

View File

@ -763,6 +763,7 @@ dnl =========================
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_EGREP
AC_PROG_AWK
AC_PROG_LEX
AC_PROG_YACC
@ -781,6 +782,24 @@ else
AC_MSG_RESULT([not found])
fi
dnl translate user/group to numercial ids
AC_MSG_CHECKING([for uid of user "$ipsecuser"])
ipsecuid=`id -u $ipsecuser 2>/dev/null`
if test -n "$ipsecuid"; then
AC_MSG_RESULT([$ipsecuid])
AC_SUBST(ipsecuid)
else
AC_MSG_ERROR([not found])
fi
AC_MSG_CHECKING([for gid of group "$ipsecgroup"])
ipsecgid=`$EGREP "^$ipsecgroup" /etc/group | $AWK -F: '{ print $3 }'`
if test -n "$ipsecgid"; then
AC_MSG_RESULT([$ipsecgid])
AC_SUBST(ipsecgid)
else
AC_MSG_ERROR([not found])
fi
dnl =========================
dnl dependency calculation
dnl =========================