diff --git a/WHATS_NEW b/WHATS_NEW index 099ae0450..892fce126 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.00 - =================================== + Move set_selinux_context into libdevmapper. Fix automatic text metadata buffer expansion (using macro). Cache formatted text metadata buffer between metadata area writes. Add pe_start field to pvs. diff --git a/include/.symlinks b/include/.symlinks index c11c0acb8..6fa487af5 100644 --- a/include/.symlinks +++ b/include/.symlinks @@ -40,7 +40,6 @@ ../lib/misc/lvm-exec.h ../lib/misc/lvm-file.h ../lib/misc/lvm-string.h -../lib/misc/selinux.h ../lib/misc/sharedlib.h ../lib/regex/matcher.h ../lib/report/report.h diff --git a/lib/Makefile.in b/lib/Makefile.in index 5065c1cce..5323cd93a 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -133,10 +133,6 @@ ifeq ("@HAVE_LIBDL@", "yes") misc/sharedlib.c endif -ifeq ("@HAVE_SELINUX@", "yes") - SOURCES += misc/selinux.c -endif - LIB_STATIC = liblvm.a $(SUBDIRS): $(LIB_STATIC) diff --git a/lib/activate/fs.c b/lib/activate/fs.c index dfe2d142e..d653d26fa 100644 --- a/lib/activate/fs.c +++ b/lib/activate/fs.c @@ -20,10 +20,6 @@ #include "lvm-file.h" #include "memlock.h" -#ifdef HAVE_SELINUX -# include "selinux.h" -#endif - #include #include #include @@ -179,7 +175,7 @@ static int _mk_link(const char *dev_dir, const char *vg_name, } #ifdef HAVE_SELINUX - if (!set_selinux_context(lv_path, S_IFLNK)) { + if (!dm_set_selinux_context(lv_path, S_IFLNK)) { stack; return 0; } diff --git a/lib/misc/selinux.c b/lib/misc/selinux.c deleted file mode 100644 index 7a7fc92cd..000000000 --- a/lib/misc/selinux.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2002-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, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU General Public License v.2. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "lib.h" -#include "selinux.h" - -#include - -int set_selinux_context(const char *path, mode_t mode) -{ - security_context_t scontext; - - if (is_selinux_enabled() <= 0) - return 1; - - if (matchpathcon(path, mode, &scontext) < 0) { - log_error("%s: matchpathcon %07o failed: %s", path, mode, - strerror(errno)); - return 0; - } - - log_very_verbose("Setting SELinux context for %s to %s.", - path, scontext); - - if ((lsetfilecon(path, scontext) < 0) && (errno != ENOTSUP)) { - log_sys_error("lsetfilecon", path); - freecon(scontext); - return 0; - } - - freecon(scontext); - return 1; -} diff --git a/lib/misc/selinux.h b/lib/misc/selinux.h deleted file mode 100644 index 18a6cec2e..000000000 --- a/lib/misc/selinux.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU General Public License v.2. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _LVM_SELINUX_H -#define _LVM_SELINUX_H - -#include - -int set_selinux_context(const char * path, mode_t mode); - -#endif