test-capability.c revision 430f0182b72373145c839dbfe99d2382855cb8f8
/***
This file is part of systemd
Copyright 2014 Ronny Chevalier
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <pwd.h>
#include <sys/capability.h>
#include <unistd.h>
#include "capability-util.h"
#include "fd-util.h"
#include "macro.h"
#include "util.h"
/* We keep CAP_DAC_OVERRIDE to avoid errors with gcov when doing test coverage */
if (pid == 0) {
test_func();
exit(0);
} else if (pid > 0) {
int status;
}
}
static void show_capabilities(void) {
char *text;
caps = cap_get_proc();
}
static int setup_tests(void) {
if (!nobody) {
return -EXIT_TEST_SKIP;
}
return 0;
}
static void test_drop_privileges_keep_net_raw(void) {
int sock;
}
static void test_drop_privileges_dontkeep_net_raw(void) {
int sock;
}
static void test_drop_privileges_fail(void) {
}
static void test_drop_privileges(void) {
}
static void test_have_effective_cap(void) {
}
int r;
log_open();
if (getuid() != 0)
return EXIT_TEST_SKIP;
r = setup_tests();
if (r < 0)
return -r;
return 0;
}