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 \
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 \
tests/libpakfire/db \
tests/libpakfire/dependencies \
tests/libpakfire/downloader \
- tests/libpakfire/execute \
tests/libpakfire/jail \
tests/libpakfire/key \
tests/libpakfire/makefile \
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
+++ /dev/null
-/*#############################################################################
-# #
-# 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;
-}
-
#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,
+++ /dev/null
-/*#############################################################################
-# #
-# 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 */
pakfire_copy_out;
pakfire_create;
pakfire_erase;
- pakfire_execute;
pakfire_get_arch;
pakfire_get_path;
pakfire_get_repo;
+++ /dev/null
-/*#############################################################################
-# #
-# 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();
-}