]> git.ipfire.org Git - pakfire.git/commitdiff
Drop unused capabilities stuff
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Sep 2022 12:19:56 +0000 (12:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Sep 2022 12:19:56 +0000 (12:19 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/libpakfire/capabilities.c [deleted file]
src/libpakfire/include/pakfire/capabilities.h [deleted file]

index 49e0df8066d616b3f1364fd7200f2e76a9ec1697..0f26c83fa230a58e6e71a732a3ef28190b1df694 100644 (file)
@@ -219,7 +219,6 @@ libpakfire_la_SOURCES = \
        src/libpakfire/arch.c \
        src/libpakfire/archive.c \
        src/libpakfire/build.c \
-       src/libpakfire/capabilities.c \
        src/libpakfire/cgroup.c \
        src/libpakfire/compress.c \
        src/libpakfire/config.c \
@@ -258,7 +257,6 @@ pkginclude_HEADERS += \
        src/libpakfire/include/pakfire/arch.h \
        src/libpakfire/include/pakfire/archive.h \
        src/libpakfire/include/pakfire/build.h \
-       src/libpakfire/include/pakfire/capabilities.h \
        src/libpakfire/include/pakfire/cgroup.h \
        src/libpakfire/include/pakfire/compress.h \
        src/libpakfire/include/pakfire/config.h \
diff --git a/src/libpakfire/capabilities.c b/src/libpakfire/capabilities.c
deleted file mode 100644 (file)
index d633814..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2022 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 <sys/capability.h>
-#include <sys/prctl.h>
-
-#include <pakfire/capabilities.h>
-#include <pakfire/logging.h>
-#include <pakfire/pakfire.h>
-
-int pakfire_has_cap(struct pakfire* pakfire, cap_value_t cap) {
-       cap_flag_value_t value = CAP_CLEAR;
-       int r;
-
-       // Fetch all capabilities
-       cap_t caps = cap_get_proc();
-       if (!caps) {
-               ERROR(pakfire, "Could not fetch capabilities: %m\n");
-               r = -1;
-               goto ERROR;
-       }
-
-       // Fetch the flag we are interested in
-       r = cap_get_flag(caps, cap, CAP_EFFECTIVE, &value);
-       if (r < 0) {
-               ERROR(pakfire, "cap_get_flag() failed: %m\n");
-               goto ERROR;
-       }
-
-       // Set r
-       switch (value) {
-               case CAP_CLEAR:
-                       r = 0;
-                       break;
-
-               case CAP_SET:
-                       r = 1;
-                       break;
-       }
-
-ERROR:
-       if (caps)
-               cap_free(caps);
-
-       return r;
-}
-
-int pakfire_keep_caps(struct pakfire* pakfire) {
-       int r;
-
-       r = prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
-       if (r < 0)
-               ERROR(pakfire, "prctl(PR_SET_KEEPCAPS, ...) failed: %m\n");
-
-       return r;
-}
diff --git a/src/libpakfire/include/pakfire/capabilities.h b/src/libpakfire/include/pakfire/capabilities.h
deleted file mode 100644 (file)
index 443031f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2022 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 PAKFIRE_CAPABILITIES_H
-#define PAKFIRE_CAPABILITIES_H
-
-#ifdef PAKFIRE_PRIVATE
-
-#include <sys/capability.h>
-
-#include <pakfire/pakfire.h>
-
-int pakfire_has_cap(struct pakfire* pakfire, cap_value_t cap);
-int pakfire_keep_caps(struct pakfire* pakfire);
-
-#endif
-
-#endif /* PAKFIRE_CAPABILITIES_H */