]> sourceware.org Git - lvm2.git/commitdiff
Move set_selinux_context into libdevmapper
authorAlasdair Kergon <agk@redhat.com>
Tue, 25 Oct 2005 17:28:46 +0000 (17:28 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 25 Oct 2005 17:28:46 +0000 (17:28 +0000)
WHATS_NEW
include/.symlinks
lib/Makefile.in
lib/activate/fs.c
lib/misc/selinux.c [deleted file]
lib/misc/selinux.h [deleted file]

index 099ae04508e7ed4f77a5298976420a6ad3635087..892fce12638451ad6eda2832e5d57a11ac281b5f 100644 (file)
--- 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.
index c11c0acb8580dd7a46c15ff445466dff0e3a51ca..6fa487af54f3e7ea89c97edfdc294eb78156909b 100644 (file)
@@ -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
index 5065c1cce4398961b56585fff67a3aa5070cda22..5323cd93a902ebfeeb856901b5e9a7c303724d50 100644 (file)
@@ -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)
index dfe2d142e0d3815793da1fce2906cbd3c16ca792..d653d26fa075d3471fee8b2a91884bd8875f2555 100644 (file)
 #include "lvm-file.h"
 #include "memlock.h"
 
-#ifdef HAVE_SELINUX
-#  include "selinux.h"
-#endif
-
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -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 (file)
index 7a7fc92..0000000
+++ /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 <selinux/selinux.h>
-
-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 (file)
index 18a6cec..0000000
+++ /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 <sys/types.h>
-
-int set_selinux_context(const char * path, mode_t mode);
-
-#endif
This page took 0.041436 seconds and 5 git commands to generate.