mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-05 11:44:48 +00:00
$(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: Guido Trotter <ultrotter@quaqua.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
85a3182189
commit
abf424cf20
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
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@
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
lxcpath=@LOCALSTATEDIR@/lxc
|
||||
lxcpath=@LXCPATH@
|
||||
|
||||
if [ ! -r $lxcpath ]; then
|
||||
exit 0
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# set -ex
|
||||
|
||||
lxcpath=@LOCALSTATEDIR@/lxc
|
||||
lxcpath=@LXCPATH@
|
||||
exec=""
|
||||
|
||||
if [ ! -r $lxcpath ]; then
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/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
|
||||
|
Loading…
Reference in New Issue
Block a user