aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2009-07-20 21:01:13 +0200
committerTobias Brunner <tobias@strongswan.org>2009-07-20 21:01:13 +0200
commit7d2b06da6a73ed353075dd057a376719bc20f23d (patch)
tree551b510ca42f5d11aa12f44fe0c2c6be1eb06285 /configure.in
parentdef1777ecaaf370c5e10d9e0d9528297a02d2825 (diff)
downloadstrongswan-7d2b06da6a73ed353075dd057a376719bc20f23d.tar.bz2
strongswan-7d2b06da6a73ed353075dd057a376719bc20f23d.tar.xz
Translate the configured user and group to a numerical UID and GID.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index aefa2303e..e1fa786c2 100644
--- a/configure.in
+++ b/configure.in
@@ -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 =========================