mirror of
https://git.proxmox.com/git/systemd
synced 2026-01-19 17:46:53 +00:00
build-sys: support builds without EAs again
This commit is contained in:
parent
1210bc667d
commit
b00ad20fa0
@ -28,7 +28,7 @@
|
||||
#include <signal.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <mqueue.h>
|
||||
#ifdef HAVE_ATTR_XATTR_H
|
||||
#ifdef HAVE_XATTR
|
||||
#include <attr/xattr.h>
|
||||
#endif
|
||||
|
||||
@ -788,7 +788,7 @@ static void socket_apply_socket_options(Socket *s, int fd) {
|
||||
if (setsockopt(fd, SOL_TCP, TCP_CONGESTION, s->tcp_congestion, strlen(s->tcp_congestion)+1) < 0)
|
||||
log_warning_unit(UNIT(s)->id, "TCP_CONGESTION failed: %m");
|
||||
|
||||
#ifdef HAVE_ATTR_XATTR_H
|
||||
#ifdef HAVE_XATTR
|
||||
if (s->smack_ip_in)
|
||||
if (fsetxattr(fd, "security.SMACK64IPIN", s->smack_ip_in, strlen(s->smack_ip_in), 0) < 0)
|
||||
log_error_unit(UNIT(s)->id,
|
||||
@ -810,7 +810,7 @@ static void socket_apply_fifo_options(Socket *s, int fd) {
|
||||
log_warning_unit(UNIT(s)->id,
|
||||
"F_SETPIPE_SZ: %m");
|
||||
|
||||
#ifdef HAVE_ATTR_XATTR_H
|
||||
#ifdef HAVE_XATTR
|
||||
if (s->smack)
|
||||
if (fsetxattr(fd, "security.SMACK64", s->smack, strlen(s->smack), 0) < 0)
|
||||
log_error_unit(UNIT(s)->id,
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
#include <attr/xattr.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/mount.h>
|
||||
@ -43,6 +42,10 @@
|
||||
#include <sys/un.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef HAVE_XATTR
|
||||
#include <attr/xattr.h>
|
||||
#endif
|
||||
|
||||
#include <systemd/sd-daemon.h>
|
||||
|
||||
#include "log.h"
|
||||
@ -928,6 +931,7 @@ static int setup_cgroup(const char *path) {
|
||||
}
|
||||
|
||||
static int save_attributes(const char *cgroup, pid_t pid, const char *uuid, const char *directory) {
|
||||
#ifdef HAVE_XATTR
|
||||
_cleanup_free_ char *path = NULL;
|
||||
char buf[DECIMAL_STR_MAX(pid_t)];
|
||||
int r = 0, k;
|
||||
@ -936,7 +940,6 @@ static int save_attributes(const char *cgroup, pid_t pid, const char *uuid, cons
|
||||
assert(pid >= 0);
|
||||
assert(arg_directory);
|
||||
|
||||
#ifdef HAVE_XATTR
|
||||
assert_se(snprintf(buf, sizeof(buf), "%lu", (unsigned long) pid) < (int) sizeof(buf));
|
||||
|
||||
r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, cgroup, NULL, &path);
|
||||
@ -964,8 +967,10 @@ static int save_attributes(const char *cgroup, pid_t pid, const char *uuid, cons
|
||||
if (r == 0)
|
||||
r = k;
|
||||
}
|
||||
#endif
|
||||
return r;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int drop_capabilities(void) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user