Commit abf424cf by Guido Trotter Committed by Daniel Lezcano

$(localstatedir) != $(prefix)/var

The current code assumes that localstatedir is equal to $(prefix)/var, thus failing for example on debian, where prefix is /usr and localstatedir is /var. This patch fixes this by expanding LXCPATH just once in configure.ac to $(localstatedir)/lib/lxc and expanding that variable everywhere else. install-exec-local is changed to just do one mkdir -p, and taking into account of the DESTDIR variable, user for example for packaging. Changing the permission of LXCPATH is done in lxc-setcap Signed-off-by: 's avatarGuido Trotter <ultrotter@quaqua.net> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 85a31821
......@@ -19,6 +19,7 @@ AS_AC_EXPAND(BINDIR, $bindir)
AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
AS_AC_EXPAND(LXCPATH, "${localstatedir}/lib/lxc")
AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink headers not found]),
[#include <linux/types.h>
......
INCLUDES= -I$(top_srcdir)/src -DLXCPATH="\"$(localstatedir)/lxc\"" \
INCLUDES= -I$(top_srcdir)/src -DLXCPATH="\"@LXCPATH@\"" \
-DLXCBINDIR="\"$(bindir)\"" \
-DLXCLIBEXECDIR="\"$(libexecdir)\""
AM_LDFLAGS= -lutil
......@@ -132,5 +132,4 @@ lxc_version_SOURCES = lxc_version.c
lxc_version_LDADD = liblxc.la
install-exec-local:
@mkdir -p $(localstatedir) && mkdir -p $(prefix)/var/lxc && \
chmod ugo+rw $(prefix)/var/lxc
@mkdir -p $(DESTDIR)@LXCPATH@
#!/bin/bash
lxcpath=@LOCALSTATEDIR@/lxc
lxcpath=@LXCPATH@
if [ ! -r $lxcpath ]; then
exit 0
......
#!/bin/bash
# set -ex
lxcpath=@LOCALSTATEDIR@/lxc
lxcpath=@LXCPATH@
exec=""
if [ ! -r $lxcpath ]; then
......
#!/bin/bash
# set -ex
lxcpath=@LOCALSTATEDIR@/lxc
lxcpath=@LXCPATH@
if [ ! -r $lxcpath ]; then
exit 0
......
......@@ -49,6 +49,7 @@ lxc_setcaps()
setcap $LXC_UNSHARE_CAPS=ep @BINDIR@/lxc-unshare
setcap $LXC_NETSTAT_CAPS=ep @BINDIR@/lxc-netstat
setcap $LXC_INIT_CAPS=ep @LIBEXECDIR@/lxc-init
chmod 2777 @LXCPATH@
}
lxc_dropcaps()
......@@ -60,6 +61,7 @@ lxc_dropcaps()
setcap -r @BINDIR@/lxc-unshare
setcap -r @BINDIR@/lxc-netstat
setcap -r @LIBEXECDIR@/lxc-init
chmod 0755 @LXCPATH@
}
if [ "$(id -u)" != "0" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment