journald: get rid of get_process_capeff(), use pidref_get_capability() instead

This does pretty much the same, but is nicer, since it parses things
properly.
This commit is contained in:
Lennart Poettering
2024-12-17 19:06:54 +01:00
parent a5370d35d6
commit 25b1a73f71
7 changed files with 9 additions and 42 deletions
-18
View File
@@ -363,24 +363,6 @@ TEST(status_field) {
}
}
TEST(capeff) {
for (int pid = 0; pid < 2; pid++) {
_cleanup_free_ char *capeff = NULL;
int r, p;
r = get_process_capeff(0, &capeff);
log_info("capeff: '%s' (r=%d)", capeff, r);
if (IN_SET(r, -ENOENT, -EPERM))
return;
assert_se(r == 0);
assert_se(*capeff);
p = capeff[strspn(capeff, HEXDIGITS)];
assert_se(!p || isspace(p));
}
}
TEST(read_one_line_file) {
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-fileio-1lf-XXXXXX";
int fd;