]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
_pakfire: Drop capabilities functionality
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Mar 2021 11:43:28 +0000 (11:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 10 Mar 2021 11:43:28 +0000 (11:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
configure.ac
src/_pakfire/_pakfiremodule.c
src/_pakfire/capabilities.c [deleted file]
src/_pakfire/capabilities.h [deleted file]
src/pakfire/packages/tar.py
src/pakfire/util.py

index 949bc2470b586b58820530091a94d5336fc4ee6e..af9ae172d20bd9d16d57632025d9a41c0e256dab 100644 (file)
@@ -171,8 +171,6 @@ _pakfire_la_SOURCES = \
        src/_pakfire/_pakfiremodule.c \
        src/_pakfire/archive.c \
        src/_pakfire/archive.h \
-       src/_pakfire/capabilities.c \
-       src/_pakfire/capabilities.h \
        src/_pakfire/constants.h \
        src/_pakfire/errors.h \
        src/_pakfire/key.c \
@@ -209,7 +207,6 @@ _pakfire_la_CPPFLAGS = \
 _pakfire_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(PYTHON_DEVEL_CFLAGS) \
-       $(CAP_CFLAGS) \
        -Wno-cast-function-type
 
 _pakfire_la_LDFLAGS = \
@@ -220,8 +217,7 @@ _pakfire_la_LDFLAGS = \
 
 _pakfire_la_LIBADD = \
        $(PYTHON_DEVEL_LIBS) \
-       $(PAKFIRE_LIBS) \
-       $(CAP_LIBS)
+       $(PAKFIRE_LIBS)
 
 # ------------------------------------------------------------------------------
 
index 391a78e01fc28afba9b4ce86e765a5356c4460b9..5e533dbf509e65fb02919c5634842ca129521d1d 100644 (file)
@@ -159,14 +159,6 @@ AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader libr
 DL_LIBS="$LIBS"
 AC_SUBST(DL_LIBS)
 
-# libcap
-AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
-
-LIBS=
-AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
-CAP_LIBS="$LIBS"
-AC_SUBST(CAP_LIBS)
-
 # libsolv
 AC_CHECK_HEADERS([solv/solvversion.h], [], [AC_MSG_ERROR([*** libsolv headers not found])])
 
index 482bea10c57994e536ccbe3f8813c47aed5fd84a..c179d6fc33c712a1fa11e371436749b8134b016d 100644 (file)
@@ -31,7 +31,6 @@
 #include <pakfire/util.h>
 
 #include "archive.h"
-#include "capabilities.h"
 #include "constants.h"
 #include "errors.h"
 #include "key.h"
@@ -114,7 +113,6 @@ static PyObject* _pakfire_umount(PyObject* self, PyObject* args) {
 
 static PyMethodDef pakfireModuleMethods[] = {
        {"performance_index", (PyCFunction)performance_index, METH_VARARGS, NULL},
-       {"get_capabilities", (PyCFunction)get_capabilities, METH_VARARGS, NULL},
        {"native_arch", (PyCFunction)_pakfire_native_arch, METH_NOARGS, NULL },
        {"arch_supported_by_host", (PyCFunction)_pakfire_arch_supported_by_host, METH_VARARGS, NULL },
        {"mount", (PyCFunction)_pakfire_mount, METH_VARARGS|METH_KEYWORDS, NULL },
diff --git a/src/_pakfire/capabilities.c b/src/_pakfire/capabilities.c
deleted file mode 100644 (file)
index de9b00d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-#############################################################################*/
-
-#include <Python.h>
-
-#include <errno.h>
-#include <sys/capability.h>
-
-#include "constants.h"
-
-PyObject *
-get_capabilities(PyObject *self, PyObject *args) {
-       const char *filename;
-       cap_t cap_d;
-       char exception[STRING_SIZE];
-
-        if (!PyArg_ParseTuple(args, "s", &filename)) {
-                /* XXX raise exception */
-                return NULL;
-        }
-
-       cap_d = cap_get_file(filename);
-       if (cap_d == NULL) {
-               if (errno == EOPNOTSUPP) {
-                       /* Return nothing, if the operation is not supported. */
-                       Py_RETURN_NONE;
-               } else if (errno != ENODATA) {
-                       snprintf(exception, STRING_SIZE - 1, "Failed to get capabilities of file %s (%s).",
-                               filename, strerror(errno));
-                       PyErr_SetString(PyExc_RuntimeError, exception);
-                       return NULL;
-               }
-               Py_RETURN_NONE;
-       }
-
-       char *result = cap_to_text(cap_d, NULL);
-       cap_free(cap_d);
-
-       if (!result) {
-               snprintf(exception, STRING_SIZE - 1, "Failed to get capabilities of human readable format at %s (%s).",
-                       filename, strerror(errno));
-               PyErr_SetString(PyExc_RuntimeError, exception);
-               return NULL;
-       }
-
-       // Remove leading two characters '= '.
-       int i;
-       for (i = 0; i < 2; i++) {
-               result++;
-       }
-
-       PyObject * ret = Py_BuildValue("s", result);
-       cap_free(result);
-
-       return ret;
-}
diff --git a/src/_pakfire/capabilities.h b/src/_pakfire/capabilities.h
deleted file mode 100644 (file)
index ffadaa5..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-#############################################################################*/
-
-#ifndef PYTHON_PAKFIRE_CAPS_H
-#define PYTHON_PAKFIRE_CAPS_H
-
-#include <Python.h>
-
-extern PyObject *get_capabilities(PyObject *self, PyObject *args);
-
-#endif /* PYTHON_PAKFIRE_CAPS_H */
index b2758d7d685a56d50f6698a36263736fe3bcdb80..e79dbaafdb16c43ef7699f4833b6f5c1bb7f3877 100644 (file)
@@ -46,12 +46,6 @@ class InnerTarFile(tarfile.TarFile):
                if tarinfo.isreg():
                        attrs = []
 
-                       # Save capabilities.
-                       caps = util.get_capabilities(name)
-                       if caps:
-                               log.debug("Saving capabilities for %s: %s" % (name, caps))
-                               tarinfo.pax_headers["PAKFIRE.capabilities"] = caps
-
                        # Append the tar header and data to the archive.
                        f = tarfile.bltn_open(name, "rb")
                        self.addfile(tarinfo, f)
index f6929fd9a0a75d204309b7557ba8319509925a09..96ce10f34690d12d4b175782c18162ae9412648c 100644 (file)
@@ -32,9 +32,6 @@ log = logging.getLogger("pakfire")
 from .constants import *
 from .i18n import _
 
-# Import binary version of capability functions
-from ._pakfire import get_capabilities
-
 def cli_is_interactive():
        """
                Say weather a shell is interactive or not.