]> git.ipfire.org Git - pakfire.git/commitdiff
execute: Drop old environment
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Aug 2022 15:32:53 +0000 (15:32 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Aug 2022 15:32:53 +0000 (15:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/libpakfire/execute.c [deleted file]
src/libpakfire/include/pakfire/build.h
src/libpakfire/include/pakfire/execute.h [deleted file]
src/libpakfire/libpakfire.sym
tests/libpakfire/execute.c [deleted file]

index 894794249927c8e37aecae46afc5bc05210c56af..c34700239cb7ba6dfbff6e58192442757355d11d 100644 (file)
@@ -225,7 +225,6 @@ libpakfire_la_SOURCES = \
        src/libpakfire/db.c \
        src/libpakfire/dist.c \
        src/libpakfire/downloader.c \
-       src/libpakfire/execute.c \
        src/libpakfire/file.c \
        src/libpakfire/filelist.c \
        src/libpakfire/jail.c \
@@ -262,7 +261,6 @@ pkginclude_HEADERS += \
        src/libpakfire/include/pakfire/db.h \
        src/libpakfire/include/pakfire/dist.h \
        src/libpakfire/include/pakfire/downloader.h \
-       src/libpakfire/include/pakfire/execute.h \
        src/libpakfire/include/pakfire/file.h \
        src/libpakfire/include/pakfire/filelist.h \
        src/libpakfire/include/pakfire/i18n.h \
@@ -376,7 +374,6 @@ check_PROGRAMS += \
        tests/libpakfire/db \
        tests/libpakfire/dependencies \
        tests/libpakfire/downloader \
-       tests/libpakfire/execute \
        tests/libpakfire/jail \
        tests/libpakfire/key \
        tests/libpakfire/makefile \
@@ -496,18 +493,6 @@ tests_libpakfire_downloader_CFLAGS = \
 tests_libpakfire_downloader_LDADD = \
        $(TESTSUITE_LDADD)
 
-tests_libpakfire_execute_SOURCES = \
-       tests/libpakfire/execute.c
-
-tests_libpakfire_execute_CPPFLAGS = \
-       $(TESTSUITE_CPPFLAGS)
-
-tests_libpakfire_execute_CFLAGS = \
-       $(TESTSUITE_CFLAGS)
-
-tests_libpakfire_execute_LDADD = \
-       $(TESTSUITE_LDADD)
-       
 dist_tests_libpakfire_jail_SOURCES = \
        tests/libpakfire/jail.c
 
diff --git a/src/libpakfire/execute.c b/src/libpakfire/execute.c
deleted file mode 100644 (file)
index b6304d4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2019 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 <errno.h>
-#include <stdlib.h>
-#include <sys/prctl.h>
-#include <unistd.h>
-
-#include <pakfire/execute.h>
-#include <pakfire/jail.h>
-#include <pakfire/logging.h>
-#include <pakfire/private.h>
-#include <pakfire/util.h>
-
-PAKFIRE_EXPORT int pakfire_execute(struct pakfire* pakfire, const char* argv[], char* envp[],
-               int flags, pakfire_execute_logging_callback logging_callback, void* data) {
-       struct pakfire_jail* jail = NULL;
-       int r;
-
-       // Create a new jail
-       r = pakfire_jail_create(&jail, pakfire, flags);
-       if (r)
-               goto ERROR;
-
-       // Setup logging
-       if (logging_callback) {
-               r = pakfire_jail_set_log_callback(jail, logging_callback, data);
-               if (r)
-                       goto ERROR;
-       }
-
-       // Import environment
-       r = pakfire_jail_import_env(jail, (const char**)envp);
-       if (r)
-               goto ERROR;
-
-       // Execute the command
-       r = pakfire_jail_exec(jail, argv, NULL);
-
-ERROR:
-       if (jail)
-               pakfire_jail_unref(jail);
-
-       return r;
-}
-
index 1cfc425c1b4eb90b491473bfe74a08351dc6cb3b..cdb28b85205f02d585ad26b448b10e6537c8db6e 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef PAKFIRE_BUILD_H
 #define PAKFIRE_BUILD_H
 
-#include <pakfire/execute.h>
 #include <pakfire/pakfire.h>
 
 int pakfire_build(struct pakfire* pakfire, const char* path, const char* target,
diff --git a/src/libpakfire/include/pakfire/execute.h b/src/libpakfire/include/pakfire/execute.h
deleted file mode 100644 (file)
index 69ba558..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2019 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_EXECUTE_H
-#define PAKFIRE_EXECUTE_H
-
-#include <pakfire/pakfire.h>
-
-typedef int (*pakfire_execute_logging_callback)(struct pakfire* pakfire, void* data,
-       int priority, const char* line, size_t length);
-
-int pakfire_execute(struct pakfire* pakfire, const char* argv[], char* envp[],
-       int flags, pakfire_execute_logging_callback logging_callback, void* data);
-
-enum {
-       PAKFIRE_EXECUTE_NONE                    = 0,
-       PAKFIRE_EXECUTE_ENABLE_NETWORK  = (1 << 0),
-       PAKFIRE_EXECUTE_INTERACTIVE     = (1 << 1),
-};
-
-#endif /* PAKFIRE_EXECUTE_H */
index 0ffe357879ea2f1b04dbc3411e4b7fc8bcf1bef7..ed0d4c14ff83275ebcc229e7dda1a299cae9a869 100644 (file)
@@ -28,7 +28,6 @@ global:
        pakfire_copy_out;
        pakfire_create;
        pakfire_erase;
-       pakfire_execute;
        pakfire_get_arch;
        pakfire_get_path;
        pakfire_get_repo;
diff --git a/tests/libpakfire/execute.c b/tests/libpakfire/execute.c
deleted file mode 100644 (file)
index 8236465..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*#############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2019 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 <string.h>
-
-#include <pakfire/execute.h>
-#include <pakfire/util.h>
-
-#include "../testsuite.h"
-
-static const char* cmd[2] = {
-       "/usr/bin/does-not-exist",
-};
-
-static int test_does_not_exist(const struct test* t) {
-       ASSERT_FAILURE(pakfire_execute(t->pakfire, cmd, NULL, 0, NULL, NULL));
-
-       return EXIT_SUCCESS;
-
-FAIL:
-       return EXIT_FAILURE;
-}
-
-int main(int argc, char** argv) {
-       testsuite_add_test(test_does_not_exist);
-
-       return testsuite_run();
-}