1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-12-24 16:23:50 +03:00

Compare commits

..

8 Commits

Author SHA1 Message Date
Alasdair Kergon
a8778bbc5a Fix status overflow check in kernel patches. 2004-04-07 12:39:59 +00:00
Alasdair Kergon
a54e641f44 fix static selinux build 2004-04-06 20:32:02 +00:00
Alasdair Kergon
5c99efe87a 1.00.13 2004-04-06 18:57:13 +00:00
Alasdair Kergon
7da1d731ff add some selinux support 2004-04-06 18:54:00 +00:00
Alasdair Kergon
af9828e819 Fix sysfs filter to check fs type. 2004-04-06 16:47:59 +00:00
Alasdair Kergon
7a27136142 Update to 2.00.10 2004-04-06 15:17:53 +00:00
Alasdair Kergon
012ad2d423 More build fixes 2004-04-06 15:14:23 +00:00
Alasdair Kergon
ef3bdbf4da Fix dmsetup.static install. 2004-04-06 12:06:55 +00:00
10 changed files with 99 additions and 29 deletions

View File

@@ -1 +1 @@
2.00.09-cvs (2004-03-31)
2.00.10-cvs (2004-04-06)

View File

@@ -1,3 +1,7 @@
Version 2.00.10 - 6 Apr 2004
============================
More fixes for static build.
Version 2.00.09 - 31 Mar 2004
=============================
Update copyright notices for Red Hat.

View File

@@ -1,5 +1,21 @@
Version 1.00.15 - 7 Apr 2004
============================
Fix status overflow check in kernel patches.
Version 1.00.14 - 6 Apr 2004
============================
Fix static selinux build.
Version 1.00.13 - 6 Apr 2004
============================
Add some basic selinux support.
Version 1.00.12 - 6 Apr 2004
============================
Fix dmsetup.static install.
Version 1.00.11 - 5 Apr 2004
===========================
============================
configure --enable-static_link does static build in addition to dynamic.
Moved Makefile library targets definition into template.

View File

@@ -26,7 +26,7 @@ static int _locate_sysfs_blocks(const char *proc, char *path, size_t len)
char proc_mounts[PATH_MAX];
int r = 0;
FILE *fp;
char *split[2], buffer[PATH_MAX + 16];
char *split[4], buffer[PATH_MAX + 16];
if (!*proc) {
log_verbose("No proc filesystem found: skipping sysfs filter");
@@ -45,8 +45,8 @@ static int _locate_sysfs_blocks(const char *proc, char *path, size_t len)
}
while (fgets(buffer, sizeof(buffer), fp)) {
if (split_words(buffer, 2, split) == 2 &&
!strcmp(split[0], "sysfs")) {
if (split_words(buffer, 4, split) == 4 &&
!strcmp(split[2], "sysfs")) {
if (lvm_snprintf(path, len, "%s/%s", split[1],
"block") >= 0) {
r = 1;

View File

@@ -27,7 +27,7 @@ LIB_SHARED = $(interface)/libdevmapper.so
include ../make.tmpl
.PHONY: install_dynamic install_static \
install_@interface@ install_@interface@_static
install_fs install_ioctl install_ioctl_static
INSTALL_TYPE = install_dynamic

View File

@@ -29,6 +29,10 @@
#include <linux/dm-ioctl.h>
#include <linux/kdev_t.h>
#ifdef HAVE_SELINUX
# include <selinux/selinux.h>
#endif
#define DEV_DIR "/dev/"
static char _dm_dir[PATH_MAX] = DEV_DIR DM_DIR;
@@ -197,6 +201,31 @@ int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size,
return 1;
}
#ifdef HAVE_SELINUX
static int _set_selinux_context(const char *path)
{
security_context_t scontext;
log_debug("Setting SELinux context for %s", path);
if (is_selinux_enabled() <= 0)
return 0;
if (matchpathcon(path, 0, &scontext) < 0) {
log_error("%s: matchpathcon failed: %s", path, strerror(errno));
return 0;
}
if (lsetfilecon(path, scontext) < 0) {
log_error("%s: lsetfilecon failed: %s", path, strerror(errno));
free(scontext);
return 0;
}
free(scontext);
return 1;
}
#endif
static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor)
{
char path[PATH_MAX];
@@ -226,6 +255,10 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor)
log_error("Unable to make device node for '%s'", dev_name);
return 0;
}
#ifdef HAVE_SELINUX
if (!_set_selinux_context(path))
return 0;
#endif
return 1;
}

View File

@@ -72,10 +72,6 @@ endif
LD_FLAGS += -L$(top_srcdir)/lib -L$(libdir)
ifeq ("@STATIC_LINK@", "yes")
LD_FLAGS += -static
endif
#CFLAGS += -DDEBUG_POOL
#CFLAGS += -DBOUNDS_CHECK
@@ -140,16 +136,14 @@ $(TARGETS): $(OBJECTS)
%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
%.pot: %.c
%.pot: %.c Makefile
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
$(CFLAGS) $< > $@
%.pot: Makefile
%.so: %.o
$(CC) -c $(INCLUDES) $(CFLAGS) %< -o $@
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
%.so: $(OBJECTS) $(LD_DEPS)
$(LIB_SHARED): $(OBJECTS) $(LD_DEPS)
$(CC) $(SOFLAG) -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
$(CLDFLAGS) $(OBJECTS) -o $@

View File

@@ -16,7 +16,7 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
SOURCES=\
SOURCES =\
archiver.c \
dumpconfig.c \
lvchange.c \
@@ -57,20 +57,26 @@ SOURCES=\
vgscan.c \
vgsplit.c
TARGETS=\
TARGETS =\
.commands \
lvm
LVMLIBS=-llvm
INSTALL_TARGETS = install_tools_dynamic
INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic
INSTALL_TARGETS=\
install_lvm_tools
ifeq ("@STATIC_LINK@", "yes")
TARGETS += lvm.static
INSTALL_TARGETS += install_tools_static
INSTALL_CMDLIB_TARGETS += install_cmdlib_static
endif
CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a
LVMLIBS = -llvm
CLEAN_TARGETS = liblvm2cmd.so liblvm2cmd.a lvm lvm.static
ifeq ("@CMDLIB@", "yes")
TARGETS += liblvm2cmd.so
INSTALL_TARGETS += install_cmdlib
INSTALL_TARGETS += $(INSTALL_CMDLIB_TARGETS)
endif
ifeq ("@DEVMAPPER@", "yes")
@@ -80,7 +86,11 @@ endif
include ../make.tmpl
lvm: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
$(CC) -o lvm $(OBJECTS) lvm.o $(LD_FLAGS) $(LVMLIBS) $(LIBS)
$(CC) -o $@ $(OBJECTS) lvm.o $(LD_FLAGS) $(LVMLIBS) $(LIBS) -rdynamic
lvm.static: $(OBJECTS) lvm.o $(top_srcdir)/lib/liblvm.a
$(CC) -o $@ $(OBJECTS) lvm.o -static $(LD_FLAGS) $(LVMLIBS) $(LIBS) \
-rdynamic
liblvm2cmd.a: $(top_srcdir)/lib/liblvm.a $(OBJECTS)
cat $(top_srcdir)/lib/liblvm.a > $@
@@ -94,16 +104,24 @@ liblvm2cmd.so: liblvm2cmd.a $(LD_DEPS)
$(CC) -E -P cmdnames.h 2> /dev/null | \
egrep -v '^ *(|#.*|dumpconfig|help|pvdata|version) *$$' > .commands
.PHONY: install_lvm_tools install_cmdlib
.PHONY: install_cmdlib_dynamic install_cmdlib_static \
install_tools_dynamic install_tools_static
install_cmdlib: $(TARGETS)
install_cmdlib_dynamic: liblvm2cmd.so
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) liblvm2cmd.so \
$(libdir)/liblvm2cmd.so.$(LIB_VERSION)
$(LN_S) -f liblvm2cmd.so.$(LIB_VERSION) $(libdir)/liblvm2cmd.so
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 444 lvm2cmd.h \
$(includedir)/lvm2cmd.h
install_lvm_tools: $(TARGETS)
install_cmdlib_static: liblvm2cmd.a
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) liblvm2cmd.a \
$(libdir)/liblvm2cmd.a.$(LIB_VERSION)
$(LN_S) -f liblvm2cmd.a.$(LIB_VERSION) $(libdir)/liblvm2cmd.a
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 444 lvm2cmd.h \
$(includedir)/lvm2cmd.h
install_tools_dynamic: lvm .commands
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) lvm \
$(sbindir)/lvm
@echo Creating symbolic links for individual commands in $(sbindir)
@@ -114,5 +132,9 @@ install_lvm_tools: $(TARGETS)
done; \
)
install_tools_static: lvm.static
$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) lvm.static \
$(sbindir)/lvm.static
install: $(INSTALL_TARGETS)

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,