mirror of
https://github.com/systemd/systemd
synced 2026-03-28 17:54:51 +01:00
Compare commits
No commits in common. "cf7c7512f588a5e93908cc9114cf25d9dabb2445" and "3a18c0e5f2e4d8d46f3fd11cd0e421f52e727b0d" have entirely different histories.
cf7c7512f5
...
3a18c0e5f2
@ -501,8 +501,6 @@ foreach ident : [
|
|||||||
#include <unistd.h>'''],
|
#include <unistd.h>'''],
|
||||||
['pivot_root', '''#include <stdlib.h>
|
['pivot_root', '''#include <stdlib.h>
|
||||||
#include <unistd.h>'''], # no known header declares pivot_root
|
#include <unistd.h>'''], # no known header declares pivot_root
|
||||||
['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get
|
|
||||||
['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set
|
|
||||||
['name_to_handle_at', '''#include <sys/types.h>
|
['name_to_handle_at', '''#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>'''],
|
#include <fcntl.h>'''],
|
||||||
|
|||||||
56
src/basic/ioprio.h
Normal file
56
src/basic/ioprio.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#ifndef IOPRIO_H
|
||||||
|
#define IOPRIO_H
|
||||||
|
|
||||||
|
/* This is minimal version of Linux' linux/ioprio.h header file, which
|
||||||
|
* is licensed GPL2 */
|
||||||
|
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gives us 8 prio classes with 13-bits of data for each class
|
||||||
|
*/
|
||||||
|
#define IOPRIO_BITS 16
|
||||||
|
#define IOPRIO_N_CLASSES 8
|
||||||
|
#define IOPRIO_CLASS_SHIFT 13
|
||||||
|
#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
|
||||||
|
|
||||||
|
#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
|
||||||
|
#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
|
||||||
|
#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
|
||||||
|
|
||||||
|
#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are the io priority groups as implemented by CFQ. RT is the realtime
|
||||||
|
* class, it always gets premium service. BE is the best-effort scheduling
|
||||||
|
* class, the default for any process. IDLE is the idle scheduling class, it
|
||||||
|
* is only served when no one else is using the disk.
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
IOPRIO_CLASS_NONE,
|
||||||
|
IOPRIO_CLASS_RT,
|
||||||
|
IOPRIO_CLASS_BE,
|
||||||
|
IOPRIO_CLASS_IDLE,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 8 best effort priority levels are supported
|
||||||
|
*/
|
||||||
|
#define IOPRIO_BE_NR (8)
|
||||||
|
|
||||||
|
enum {
|
||||||
|
IOPRIO_WHO_PROCESS = 1,
|
||||||
|
IOPRIO_WHO_PGRP,
|
||||||
|
IOPRIO_WHO_USER,
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline int ioprio_set(int which, int who, int ioprio) {
|
||||||
|
return syscall(__NR_ioprio_set, which, who, ioprio);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int ioprio_get(int which, int who) {
|
||||||
|
return syscall(__NR_ioprio_get, which, who);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "cgroup-util.h"
|
#include "cgroup-util.h"
|
||||||
#include "limits-util.h"
|
#include "limits-util.h"
|
||||||
|
|||||||
@ -72,6 +72,7 @@ basic_sources = files('''
|
|||||||
in-addr-util.h
|
in-addr-util.h
|
||||||
io-util.c
|
io-util.c
|
||||||
io-util.h
|
io-util.h
|
||||||
|
ioprio.h
|
||||||
khash.c
|
khash.c
|
||||||
khash.h
|
khash.h
|
||||||
limits-util.c
|
limits-util.c
|
||||||
@ -130,7 +131,6 @@ basic_sources = files('''
|
|||||||
missing_fcntl.h
|
missing_fcntl.h
|
||||||
missing_fs.h
|
missing_fs.h
|
||||||
missing_input.h
|
missing_input.h
|
||||||
missing_ioprio.h
|
|
||||||
missing_keyctl.h
|
missing_keyctl.h
|
||||||
missing_magic.h
|
missing_magic.h
|
||||||
missing_mman.h
|
missing_mman.h
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <sched.h>
|
|
||||||
|
|
||||||
/* Match values uses by the kernel internally, as no public header seems to exist. */
|
|
||||||
|
|
||||||
#ifndef IOPRIO_N_CLASSES
|
|
||||||
# define IOPRIO_N_CLASSES 8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef IOPRIO_BE_NR
|
|
||||||
# define IOPRIO_BE_NR 8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef IOPRIO_CLASS_NONE
|
|
||||||
# define IOPRIO_CLASS_NONE 0
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_CLASS_RT
|
|
||||||
# define IOPRIO_CLASS_RT 1
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_CLASS_BE
|
|
||||||
# define IOPRIO_CLASS_BE 2
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_CLASS_IDLE
|
|
||||||
# define IOPRIO_CLASS_IDLE 3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef IOPRIO_WHO_PROCESS
|
|
||||||
# define IOPRIO_WHO_PROCESS 1
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_WHO_PGRP
|
|
||||||
# define IOPRIO_WHO_PGRP 2
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_WHO_USER
|
|
||||||
# define IOPRIO_WHO_USER 3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef IOPRIO_BITS
|
|
||||||
# define IOPRIO_BITS 16
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_N_CLASSES
|
|
||||||
# define IOPRIO_N_CLASSES 8
|
|
||||||
#endif
|
|
||||||
#ifndef IOPRIO_CLASS_SHIFT
|
|
||||||
# define IOPRIO_CLASS_SHIFT 13
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int ioprio_prio_class(int value) {
|
|
||||||
return value >> IOPRIO_CLASS_SHIFT;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int ioprio_prio_data(int value) {
|
|
||||||
return value & ((1 << IOPRIO_CLASS_SHIFT) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int ioprio_prio_value(int class, int data) {
|
|
||||||
return (class << IOPRIO_CLASS_SHIFT) | data;
|
|
||||||
}
|
|
||||||
@ -41,26 +41,6 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old)
|
|||||||
|
|
||||||
/* ======================================================================= */
|
/* ======================================================================= */
|
||||||
|
|
||||||
#if !HAVE_IOPRIO_GET
|
|
||||||
static inline int missing_ioprio_get(int which, int who) {
|
|
||||||
return syscall(__NR_ioprio_get, which, who);
|
|
||||||
}
|
|
||||||
|
|
||||||
# define ioprio_get missing_ioprio_get
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ======================================================================= */
|
|
||||||
|
|
||||||
#if !HAVE_IOPRIO_SET
|
|
||||||
static inline int missing_ioprio_set(int which, int who, int ioprio) {
|
|
||||||
return syscall(__NR_ioprio_set, which, who, ioprio);
|
|
||||||
}
|
|
||||||
|
|
||||||
# define ioprio_set missing_ioprio_set
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ======================================================================= */
|
|
||||||
|
|
||||||
#if !HAVE_MEMFD_CREATE
|
#if !HAVE_MEMFD_CREATE
|
||||||
static inline int missing_memfd_create(const char *name, unsigned int flags) {
|
static inline int missing_memfd_create(const char *name, unsigned int flags) {
|
||||||
# ifdef __NR_memfd_create
|
# ifdef __NR_memfd_create
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "fs-util.h"
|
#include "fs-util.h"
|
||||||
|
#include "ioprio.h"
|
||||||
#include "locale-util.h"
|
#include "locale-util.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
|
|||||||
@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "format-util.h"
|
#include "format-util.h"
|
||||||
|
#include "ioprio.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
#include "missing_ioprio.h"
|
|
||||||
#include "time-util.h"
|
#include "time-util.h"
|
||||||
|
|
||||||
#define procfs_file_alloca(pid, field) \
|
#define procfs_file_alloca(pid, field) \
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "hexdecoct.h"
|
#include "hexdecoct.h"
|
||||||
#include "io-util.h"
|
#include "io-util.h"
|
||||||
|
#include "ioprio.h"
|
||||||
#include "journal-file.h"
|
#include "journal-file.h"
|
||||||
#include "missing_ioprio.h"
|
|
||||||
#include "mountpoint-util.h"
|
#include "mountpoint-util.h"
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
@ -55,8 +55,8 @@ static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_protect_system, protect_system,
|
|||||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_personality, personality, unsigned long);
|
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_personality, personality, unsigned long);
|
||||||
static BUS_DEFINE_PROPERTY_GET(property_get_ioprio, "i", ExecContext, exec_context_get_effective_ioprio);
|
static BUS_DEFINE_PROPERTY_GET(property_get_ioprio, "i", ExecContext, exec_context_get_effective_ioprio);
|
||||||
static BUS_DEFINE_PROPERTY_GET(property_get_mount_apivfs, "b", ExecContext, exec_context_get_effective_mount_apivfs);
|
static BUS_DEFINE_PROPERTY_GET(property_get_mount_apivfs, "b", ExecContext, exec_context_get_effective_mount_apivfs);
|
||||||
static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_class, "i", ExecContext, exec_context_get_effective_ioprio, ioprio_prio_class);
|
static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_class, "i", ExecContext, exec_context_get_effective_ioprio, IOPRIO_PRIO_CLASS);
|
||||||
static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_priority, "i", ExecContext, exec_context_get_effective_ioprio, ioprio_prio_data);
|
static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_priority, "i", ExecContext, exec_context_get_effective_ioprio, IOPRIO_PRIO_DATA);
|
||||||
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_empty_string, "s", NULL);
|
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_empty_string, "s", NULL);
|
||||||
static BUS_DEFINE_PROPERTY_GET_REF(property_get_syslog_level, "i", int, LOG_PRI);
|
static BUS_DEFINE_PROPERTY_GET_REF(property_get_syslog_level, "i", int, LOG_PRI);
|
||||||
static BUS_DEFINE_PROPERTY_GET_REF(property_get_syslog_facility, "i", int, LOG_FAC);
|
static BUS_DEFINE_PROPERTY_GET_REF(property_get_syslog_facility, "i", int, LOG_FAC);
|
||||||
@ -2637,7 +2637,7 @@ int bus_exec_context_set_transient_property(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
c->ioprio = ioprio_prio_value(q, ioprio_prio_data(c->ioprio));
|
c->ioprio = IOPRIO_PRIO_VALUE(q, IOPRIO_PRIO_DATA(c->ioprio));
|
||||||
c->ioprio_set = true;
|
c->ioprio_set = true;
|
||||||
|
|
||||||
unit_write_settingf(u, flags, name, "IOSchedulingClass=%s", s);
|
unit_write_settingf(u, flags, name, "IOSchedulingClass=%s", s);
|
||||||
@ -2656,7 +2656,7 @@ int bus_exec_context_set_transient_property(
|
|||||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid IO scheduling priority: %i", p);
|
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid IO scheduling priority: %i", p);
|
||||||
|
|
||||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||||
c->ioprio = ioprio_prio_value(ioprio_prio_class(c->ioprio), p);
|
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_PRIO_CLASS(c->ioprio), p);
|
||||||
c->ioprio_set = true;
|
c->ioprio_set = true;
|
||||||
|
|
||||||
unit_write_settingf(u, flags, name, "IOSchedulingPriority=%i", p);
|
unit_write_settingf(u, flags, name, "IOSchedulingPriority=%i", p);
|
||||||
|
|||||||
@ -62,6 +62,7 @@
|
|||||||
#include "glob-util.h"
|
#include "glob-util.h"
|
||||||
#include "hexdecoct.h"
|
#include "hexdecoct.h"
|
||||||
#include "io-util.h"
|
#include "io-util.h"
|
||||||
|
#include "ioprio.h"
|
||||||
#include "label.h"
|
#include "label.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
@ -69,7 +70,6 @@
|
|||||||
#include "manager-dump.h"
|
#include "manager-dump.h"
|
||||||
#include "memory-util.h"
|
#include "memory-util.h"
|
||||||
#include "missing_fs.h"
|
#include "missing_fs.h"
|
||||||
#include "missing_ioprio.h"
|
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
#include "mount-util.h"
|
#include "mount-util.h"
|
||||||
#include "mountpoint-util.h"
|
#include "mountpoint-util.h"
|
||||||
@ -4865,7 +4865,7 @@ void exec_context_init(ExecContext *c) {
|
|||||||
assert(c);
|
assert(c);
|
||||||
|
|
||||||
c->umask = 0022;
|
c->umask = 0022;
|
||||||
c->ioprio = ioprio_prio_value(IOPRIO_CLASS_BE, 0);
|
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0);
|
||||||
c->cpu_sched_policy = SCHED_OTHER;
|
c->cpu_sched_policy = SCHED_OTHER;
|
||||||
c->syslog_priority = LOG_DAEMON|LOG_INFO;
|
c->syslog_priority = LOG_DAEMON|LOG_INFO;
|
||||||
c->syslog_level_prefix = true;
|
c->syslog_level_prefix = true;
|
||||||
@ -5427,11 +5427,11 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
|
|||||||
if (c->ioprio_set) {
|
if (c->ioprio_set) {
|
||||||
_cleanup_free_ char *class_str = NULL;
|
_cleanup_free_ char *class_str = NULL;
|
||||||
|
|
||||||
r = ioprio_class_to_string_alloc(ioprio_prio_class(c->ioprio), &class_str);
|
r = ioprio_class_to_string_alloc(IOPRIO_PRIO_CLASS(c->ioprio), &class_str);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
fprintf(f, "%sIOSchedulingClass: %s\n", prefix, class_str);
|
fprintf(f, "%sIOSchedulingClass: %s\n", prefix, class_str);
|
||||||
|
|
||||||
fprintf(f, "%sIOPriority: %d\n", prefix, ioprio_prio_data(c->ioprio));
|
fprintf(f, "%sIOPriority: %lu\n", prefix, IOPRIO_PRIO_DATA(c->ioprio));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->cpu_sched_set) {
|
if (c->cpu_sched_set) {
|
||||||
@ -5784,7 +5784,7 @@ int exec_context_get_effective_ioprio(const ExecContext *c) {
|
|||||||
|
|
||||||
p = ioprio_get(IOPRIO_WHO_PROCESS, 0);
|
p = ioprio_get(IOPRIO_WHO_PROCESS, 0);
|
||||||
if (p < 0)
|
if (p < 0)
|
||||||
return ioprio_prio_value(IOPRIO_CLASS_BE, 4);
|
return IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 4);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,12 +39,12 @@
|
|||||||
#include "fs-util.h"
|
#include "fs-util.h"
|
||||||
#include "hexdecoct.h"
|
#include "hexdecoct.h"
|
||||||
#include "io-util.h"
|
#include "io-util.h"
|
||||||
|
#include "ioprio.h"
|
||||||
#include "ip-protocol-list.h"
|
#include "ip-protocol-list.h"
|
||||||
#include "journal-file.h"
|
#include "journal-file.h"
|
||||||
#include "limits-util.h"
|
#include "limits-util.h"
|
||||||
#include "load-fragment.h"
|
#include "load-fragment.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "missing_ioprio.h"
|
|
||||||
#include "mountpoint-util.h"
|
#include "mountpoint-util.h"
|
||||||
#include "nulstr-util.h"
|
#include "nulstr-util.h"
|
||||||
#include "parse-socket-bind-item.h"
|
#include "parse-socket-bind-item.h"
|
||||||
@ -1266,7 +1266,7 @@ int config_parse_exec_io_class(const char *unit,
|
|||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
c->ioprio_set = false;
|
c->ioprio_set = false;
|
||||||
c->ioprio = ioprio_prio_value(IOPRIO_CLASS_BE, 0);
|
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1276,7 +1276,7 @@ int config_parse_exec_io_class(const char *unit,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
c->ioprio = ioprio_prio_value(x, ioprio_prio_data(c->ioprio));
|
c->ioprio = IOPRIO_PRIO_VALUE(x, IOPRIO_PRIO_DATA(c->ioprio));
|
||||||
c->ioprio_set = true;
|
c->ioprio_set = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1303,7 +1303,7 @@ int config_parse_exec_io_priority(const char *unit,
|
|||||||
|
|
||||||
if (isempty(rvalue)) {
|
if (isempty(rvalue)) {
|
||||||
c->ioprio_set = false;
|
c->ioprio_set = false;
|
||||||
c->ioprio = ioprio_prio_value(IOPRIO_CLASS_BE, 0);
|
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1313,7 +1313,7 @@ int config_parse_exec_io_priority(const char *unit,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
c->ioprio = ioprio_prio_value(ioprio_prio_class(c->ioprio), i);
|
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_PRIO_CLASS(c->ioprio), i);
|
||||||
c->ioprio_set = true;
|
c->ioprio_set = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "creds-util.h"
|
#include "creds-util.h"
|
||||||
#include "dirent-util.h"
|
#include "dirent-util.h"
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "sd-daemon.h"
|
#include "sd-daemon.h"
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ int dhcp6_option_append_vendor_option(uint8_t **buf, size_t *buflen, OrderedHash
|
|||||||
int dhcp6_option_parse(uint8_t **buf, size_t *buflen, uint16_t *optcode,
|
int dhcp6_option_parse(uint8_t **buf, size_t *buflen, uint16_t *optcode,
|
||||||
size_t *optlen, uint8_t **optvalue);
|
size_t *optlen, uint8_t **optvalue);
|
||||||
int dhcp6_option_parse_status(DHCP6Option *option, size_t len);
|
int dhcp6_option_parse_status(DHCP6Option *option, size_t len);
|
||||||
int dhcp6_option_parse_ia(sd_dhcp6_client *client, DHCP6Option *iaoption, be32_t iaid, DHCP6IA *ia, uint16_t *ret_status_code);
|
int dhcp6_option_parse_ia(sd_dhcp6_client *client, DHCP6Option *iaoption, DHCP6IA *ia, uint16_t *ret_status_code);
|
||||||
int dhcp6_option_parse_ip6addrs(uint8_t *optval, uint16_t optlen,
|
int dhcp6_option_parse_ip6addrs(uint8_t *optval, uint16_t optlen,
|
||||||
struct in6_addr **addrs, size_t count);
|
struct in6_addr **addrs, size_t count);
|
||||||
int dhcp6_option_parse_domainname_list(const uint8_t *optval, uint16_t optlen,
|
int dhcp6_option_parse_domainname_list(const uint8_t *optval, uint16_t optlen,
|
||||||
|
|||||||
@ -509,13 +509,7 @@ static int dhcp6_option_parse_pdprefix(sd_dhcp6_client *client, DHCP6Option *opt
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dhcp6_option_parse_ia(
|
int dhcp6_option_parse_ia(sd_dhcp6_client *client, DHCP6Option *iaoption, DHCP6IA *ia, uint16_t *ret_status_code) {
|
||||||
sd_dhcp6_client *client,
|
|
||||||
DHCP6Option *iaoption,
|
|
||||||
be32_t iaid,
|
|
||||||
DHCP6IA *ia,
|
|
||||||
uint16_t *ret_status_code) {
|
|
||||||
|
|
||||||
uint32_t lt_t1, lt_t2, lt_valid = 0, lt_min = UINT32_MAX;
|
uint32_t lt_t1, lt_t2, lt_valid = 0, lt_min = UINT32_MAX;
|
||||||
uint16_t iatype, optlen;
|
uint16_t iatype, optlen;
|
||||||
size_t iaaddr_offset;
|
size_t iaaddr_offset;
|
||||||
@ -535,14 +529,6 @@ int dhcp6_option_parse_ia(
|
|||||||
if (len < DHCP6_OPTION_IA_NA_LEN)
|
if (len < DHCP6_OPTION_IA_NA_LEN)
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
|
||||||
/* According to RFC8415, IAs which do not match the client's IAID should be ignored,
|
|
||||||
* but not necessary to ignore or refuse the whole message. */
|
|
||||||
if (((const struct ia_na*) iaoption->data)->id != iaid)
|
|
||||||
/* ENOANO indicates the option should be ignored. */
|
|
||||||
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(ENOANO),
|
|
||||||
"Received an IA_NA option with a different IAID "
|
|
||||||
"from the one chosen by the client, ignoring.");
|
|
||||||
|
|
||||||
iaaddr_offset = DHCP6_OPTION_IA_NA_LEN;
|
iaaddr_offset = DHCP6_OPTION_IA_NA_LEN;
|
||||||
memcpy(&ia->ia_na, iaoption->data, sizeof(ia->ia_na));
|
memcpy(&ia->ia_na, iaoption->data, sizeof(ia->ia_na));
|
||||||
|
|
||||||
@ -561,14 +547,6 @@ int dhcp6_option_parse_ia(
|
|||||||
if (len < sizeof(ia->ia_pd))
|
if (len < sizeof(ia->ia_pd))
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
|
||||||
/* According to RFC8415, IAs which do not match the client's IAID should be ignored,
|
|
||||||
* but not necessary to ignore or refuse the whole message. */
|
|
||||||
if (((const struct ia_pd*) iaoption->data)->id != iaid)
|
|
||||||
/* ENOANO indicates the option should be ignored. */
|
|
||||||
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(ENOANO),
|
|
||||||
"Received an IA_PD option with a different IAID "
|
|
||||||
"from the one chosen by the client, ignoring.");
|
|
||||||
|
|
||||||
iaaddr_offset = sizeof(ia->ia_pd);
|
iaaddr_offset = sizeof(ia->ia_pd);
|
||||||
memcpy(&ia->ia_pd, iaoption->data, sizeof(ia->ia_pd));
|
memcpy(&ia->ia_pd, iaoption->data, sizeof(ia->ia_pd));
|
||||||
|
|
||||||
@ -586,21 +564,13 @@ int dhcp6_option_parse_ia(
|
|||||||
if (len < DHCP6_OPTION_IA_TA_LEN)
|
if (len < DHCP6_OPTION_IA_TA_LEN)
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
|
||||||
/* According to RFC8415, IAs which do not match the client's IAID should be ignored,
|
|
||||||
* but not necessary to ignore or refuse the whole message. */
|
|
||||||
if (((const struct ia_ta*) iaoption->data)->id != iaid)
|
|
||||||
/* ENOANO indicates the option should be ignored. */
|
|
||||||
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(ENOANO),
|
|
||||||
"Received an IA_TA option with a different IAID "
|
|
||||||
"from the one chosen by the client, ignoring.");
|
|
||||||
|
|
||||||
iaaddr_offset = DHCP6_OPTION_IA_TA_LEN;
|
iaaddr_offset = DHCP6_OPTION_IA_TA_LEN;
|
||||||
memcpy(&ia->ia_ta, iaoption->data, sizeof(ia->ia_ta));
|
memcpy(&ia->ia_ta.id, iaoption->data, sizeof(ia->ia_ta));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -ENOMSG;
|
||||||
}
|
}
|
||||||
|
|
||||||
ia->type = iatype;
|
ia->type = iatype;
|
||||||
|
|||||||
@ -1118,6 +1118,7 @@ static int client_parse_message(
|
|||||||
while (pos < len) {
|
while (pos < len) {
|
||||||
DHCP6Option *option = (DHCP6Option *) &message->options[pos];
|
DHCP6Option *option = (DHCP6Option *) &message->options[pos];
|
||||||
uint16_t optcode, optlen;
|
uint16_t optcode, optlen;
|
||||||
|
be32_t iaid_lease;
|
||||||
int status;
|
int status;
|
||||||
uint8_t *optval;
|
uint8_t *optval;
|
||||||
|
|
||||||
@ -1186,8 +1187,8 @@ static int client_parse_message(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(client, option, client->ia_pd.ia_na.id, &lease->ia, &ia_na_status);
|
r = dhcp6_option_parse_ia(client, option, &lease->ia, &ia_na_status);
|
||||||
if (r < 0 && r != -ENOANO)
|
if (r < 0 && r != -ENOMSG)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (ia_na_status == DHCP6_STATUS_NO_ADDRS_AVAIL) {
|
if (ia_na_status == DHCP6_STATUS_NO_ADDRS_AVAIL) {
|
||||||
@ -1195,6 +1196,14 @@ static int client_parse_message(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = dhcp6_lease_get_iaid(lease, &iaid_lease);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
if (client->ia_na.ia_na.id != iaid_lease)
|
||||||
|
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "%s has wrong IAID for IA NA",
|
||||||
|
dhcp6_message_type_to_string(message->type));
|
||||||
|
|
||||||
if (lease->ia.addresses) {
|
if (lease->ia.addresses) {
|
||||||
lt_t1 = MIN(lt_t1, be32toh(lease->ia.ia_na.lifetime_t1));
|
lt_t1 = MIN(lt_t1, be32toh(lease->ia.ia_na.lifetime_t1));
|
||||||
lt_t2 = MIN(lt_t2, be32toh(lease->ia.ia_na.lifetime_t2));
|
lt_t2 = MIN(lt_t2, be32toh(lease->ia.ia_na.lifetime_t2));
|
||||||
@ -1208,8 +1217,8 @@ static int client_parse_message(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(client, option, client->ia_pd.ia_pd.id, &lease->pd, &ia_pd_status);
|
r = dhcp6_option_parse_ia(client, option, &lease->pd, &ia_pd_status);
|
||||||
if (r < 0 && r != -ENOANO)
|
if (r < 0 && r != -ENOMSG)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (ia_pd_status == DHCP6_STATUS_NO_PREFIX_AVAIL) {
|
if (ia_pd_status == DHCP6_STATUS_NO_PREFIX_AVAIL) {
|
||||||
@ -1217,6 +1226,14 @@ static int client_parse_message(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = dhcp6_lease_get_pd_iaid(lease, &iaid_lease);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
if (client->ia_pd.ia_pd.id != iaid_lease)
|
||||||
|
return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "%s has wrong IAID for IA PD",
|
||||||
|
dhcp6_message_type_to_string(message->type));
|
||||||
|
|
||||||
if (lease->pd.addresses) {
|
if (lease->pd.addresses) {
|
||||||
lt_t1 = MIN(lt_t1, be32toh(lease->pd.ia_pd.lifetime_t1));
|
lt_t1 = MIN(lt_t1, be32toh(lease->pd.ia_pd.lifetime_t1));
|
||||||
lt_t2 = MIN(lt_t2, be32toh(lease->pd.ia_pd.lifetime_t2));
|
lt_t2 = MIN(lt_t2, be32toh(lease->pd.ia_pd.lifetime_t2));
|
||||||
|
|||||||
@ -287,31 +287,25 @@ static int test_option_status(sd_event *e) {
|
|||||||
};
|
};
|
||||||
DHCP6Option *option;
|
DHCP6Option *option;
|
||||||
DHCP6IA ia, pd;
|
DHCP6IA ia, pd;
|
||||||
be32_t iaid;
|
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
log_debug("/* %s */", __func__);
|
log_debug("/* %s */", __func__);
|
||||||
|
|
||||||
memcpy(&iaid, option1 + 4, sizeof(iaid));
|
|
||||||
|
|
||||||
zero(ia);
|
zero(ia);
|
||||||
option = (DHCP6Option *)option1;
|
option = (DHCP6Option *)option1;
|
||||||
assert_se(sizeof(option1) == sizeof(DHCP6Option) + be16toh(option->len));
|
assert_se(sizeof(option1) == sizeof(DHCP6Option) + be16toh(option->len));
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, 0, &ia, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &ia, NULL);
|
||||||
assert_se(r == -ENOANO);
|
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &ia, NULL);
|
|
||||||
assert_se(r == 0);
|
assert_se(r == 0);
|
||||||
assert_se(ia.addresses == NULL);
|
assert_se(ia.addresses == NULL);
|
||||||
|
|
||||||
option->len = htobe16(17);
|
option->len = htobe16(17);
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &ia, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &ia, NULL);
|
||||||
assert_se(r == -ENOBUFS);
|
assert_se(r == -ENOBUFS);
|
||||||
assert_se(ia.addresses == NULL);
|
assert_se(ia.addresses == NULL);
|
||||||
|
|
||||||
option->len = htobe16(sizeof(DHCP6Option));
|
option->len = htobe16(sizeof(DHCP6Option));
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &ia, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &ia, NULL);
|
||||||
assert_se(r == -ENOBUFS);
|
assert_se(r == -ENOBUFS);
|
||||||
assert_se(ia.addresses == NULL);
|
assert_se(ia.addresses == NULL);
|
||||||
|
|
||||||
@ -319,7 +313,7 @@ static int test_option_status(sd_event *e) {
|
|||||||
option = (DHCP6Option *)option2;
|
option = (DHCP6Option *)option2;
|
||||||
assert_se(sizeof(option2) == sizeof(DHCP6Option) + be16toh(option->len));
|
assert_se(sizeof(option2) == sizeof(DHCP6Option) + be16toh(option->len));
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &ia, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &ia, NULL);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
assert_se(ia.addresses == NULL);
|
assert_se(ia.addresses == NULL);
|
||||||
|
|
||||||
@ -327,7 +321,7 @@ static int test_option_status(sd_event *e) {
|
|||||||
option = (DHCP6Option *)option3;
|
option = (DHCP6Option *)option3;
|
||||||
assert_se(sizeof(option3) == sizeof(DHCP6Option) + be16toh(option->len));
|
assert_se(sizeof(option3) == sizeof(DHCP6Option) + be16toh(option->len));
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &ia, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &ia, NULL);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
assert_se(ia.addresses != NULL);
|
assert_se(ia.addresses != NULL);
|
||||||
dhcp6_lease_free_ia(&ia);
|
dhcp6_lease_free_ia(&ia);
|
||||||
@ -336,7 +330,7 @@ static int test_option_status(sd_event *e) {
|
|||||||
option = (DHCP6Option *)option4;
|
option = (DHCP6Option *)option4;
|
||||||
assert_se(sizeof(option4) == sizeof(DHCP6Option) + be16toh(option->len));
|
assert_se(sizeof(option4) == sizeof(DHCP6Option) + be16toh(option->len));
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &pd, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &pd, NULL);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
assert_se(pd.addresses != NULL);
|
assert_se(pd.addresses != NULL);
|
||||||
assert_se(memcmp(&pd.ia_pd.id, &option4[4], 4) == 0);
|
assert_se(memcmp(&pd.ia_pd.id, &option4[4], 4) == 0);
|
||||||
@ -348,7 +342,7 @@ static int test_option_status(sd_event *e) {
|
|||||||
option = (DHCP6Option *)option5;
|
option = (DHCP6Option *)option5;
|
||||||
assert_se(sizeof(option5) == sizeof(DHCP6Option) + be16toh(option->len));
|
assert_se(sizeof(option5) == sizeof(DHCP6Option) + be16toh(option->len));
|
||||||
|
|
||||||
r = dhcp6_option_parse_ia(NULL, option, iaid, &pd, NULL);
|
r = dhcp6_option_parse_ia(NULL, option, &pd, NULL);
|
||||||
assert_se(r >= 0);
|
assert_se(r >= 0);
|
||||||
assert_se(pd.addresses != NULL);
|
assert_se(pd.addresses != NULL);
|
||||||
dhcp6_lease_free_ia(&pd);
|
dhcp6_lease_free_ia(&pd);
|
||||||
@ -453,14 +447,13 @@ static int test_advertise_option(sd_event *e) {
|
|||||||
opt_clientid = true;
|
opt_clientid = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SD_DHCP6_OPTION_IA_NA: {
|
case SD_DHCP6_OPTION_IA_NA:
|
||||||
be32_t iaid = htobe32(0x0ecfa37d);
|
|
||||||
|
|
||||||
assert_se(optlen == 94);
|
assert_se(optlen == 94);
|
||||||
assert_se(optval == &msg_advertise[26]);
|
assert_se(optval == &msg_advertise[26]);
|
||||||
assert_se(!memcmp(optval, &msg_advertise[26], optlen));
|
assert_se(!memcmp(optval, &msg_advertise[26], optlen));
|
||||||
|
|
||||||
assert_se(!memcmp(optval, &iaid, sizeof(val)));
|
val = htobe32(0x0ecfa37d);
|
||||||
|
assert_se(!memcmp(optval, &val, sizeof(val)));
|
||||||
|
|
||||||
val = htobe32(80);
|
val = htobe32(80);
|
||||||
assert_se(!memcmp(optval + 4, &val, sizeof(val)));
|
assert_se(!memcmp(optval + 4, &val, sizeof(val)));
|
||||||
@ -468,10 +461,10 @@ static int test_advertise_option(sd_event *e) {
|
|||||||
val = htobe32(120);
|
val = htobe32(120);
|
||||||
assert_se(!memcmp(optval + 8, &val, sizeof(val)));
|
assert_se(!memcmp(optval + 8, &val, sizeof(val)));
|
||||||
|
|
||||||
assert_se(dhcp6_option_parse_ia(NULL, option, iaid, &lease->ia, NULL) >= 0);
|
assert_se(dhcp6_option_parse_ia(NULL, option, &lease->ia, NULL) >= 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case SD_DHCP6_OPTION_SERVERID:
|
case SD_DHCP6_OPTION_SERVERID:
|
||||||
assert_se(optlen == 14);
|
assert_se(optlen == 14);
|
||||||
assert_se(optval == &msg_advertise[179]);
|
assert_se(optval == &msg_advertise[179]);
|
||||||
@ -603,8 +596,6 @@ static void test_client_solicit_cb(sd_dhcp6_client *client, int event,
|
|||||||
static int test_client_send_reply(DHCP6Message *request) {
|
static int test_client_send_reply(DHCP6Message *request) {
|
||||||
DHCP6Message reply;
|
DHCP6Message reply;
|
||||||
|
|
||||||
log_debug("/* %s */", __func__);
|
|
||||||
|
|
||||||
reply.transaction_id = request->transaction_id;
|
reply.transaction_id = request->transaction_id;
|
||||||
reply.type = DHCP6_REPLY;
|
reply.type = DHCP6_REPLY;
|
||||||
|
|
||||||
@ -665,7 +656,7 @@ static int test_client_verify_request(DHCP6Message *request, size_t len) {
|
|||||||
assert_se(!memcmp(optval + 8, &val, sizeof(val)));
|
assert_se(!memcmp(optval + 8, &val, sizeof(val)));
|
||||||
|
|
||||||
/* Then, this should refuse all addresses. */
|
/* Then, this should refuse all addresses. */
|
||||||
assert_se(dhcp6_option_parse_ia(NULL, option, test_iaid, &lease->ia, NULL) >= 0);
|
assert_se(dhcp6_option_parse_ia(NULL, option, &lease->ia, NULL) >= 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -711,8 +702,6 @@ static int test_client_verify_request(DHCP6Message *request, size_t len) {
|
|||||||
static int test_client_send_advertise(DHCP6Message *solicit) {
|
static int test_client_send_advertise(DHCP6Message *solicit) {
|
||||||
DHCP6Message advertise;
|
DHCP6Message advertise;
|
||||||
|
|
||||||
log_debug("/* %s */", __func__);
|
|
||||||
|
|
||||||
advertise.transaction_id = solicit->transaction_id;
|
advertise.transaction_id = solicit->transaction_id;
|
||||||
advertise.type = DHCP6_ADVERTISE;
|
advertise.type = DHCP6_ADVERTISE;
|
||||||
|
|
||||||
@ -902,8 +891,6 @@ int dhcp6_network_send_udp_socket(int s, struct in6_addr *server_address,
|
|||||||
IN6ADDR_ALL_DHCP6_RELAY_AGENTS_AND_SERVERS_INIT;
|
IN6ADDR_ALL_DHCP6_RELAY_AGENTS_AND_SERVERS_INIT;
|
||||||
DHCP6Message *message;
|
DHCP6Message *message;
|
||||||
|
|
||||||
log_debug("/* %s */", __func__);
|
|
||||||
|
|
||||||
assert_se(s == test_dhcp_fd[0]);
|
assert_se(s == test_dhcp_fd[0]);
|
||||||
assert_se(server_address);
|
assert_se(server_address);
|
||||||
assert_se(packet);
|
assert_se(packet);
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "portabled-operation.h"
|
#include "portabled-operation.h"
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "calendarspec.h"
|
#include "calendarspec.h"
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "id128-util.h"
|
#include "id128-util.h"
|
||||||
#include "mkfs-util.h"
|
#include "mkfs-util.h"
|
||||||
#include "path-util.h"
|
#include "path-util.h"
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "bootspec.h"
|
#include "bootspec.h"
|
||||||
#include "bus-error.h"
|
#include "bus-error.h"
|
||||||
#include "bus-locator.h"
|
#include "bus-locator.h"
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "data-fd-util.h"
|
#include "data-fd-util.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
|
|||||||
@ -119,7 +119,7 @@ static int userdb_flags_from_service(Varlink *link, const char *service, UserDBF
|
|||||||
|
|
||||||
if (streq_ptr(service, "io.systemd.NameServiceSwitch"))
|
if (streq_ptr(service, "io.systemd.NameServiceSwitch"))
|
||||||
*ret = USERDB_NSS_ONLY|USERDB_AVOID_MULTIPLEXER;
|
*ret = USERDB_NSS_ONLY|USERDB_AVOID_MULTIPLEXER;
|
||||||
else if (streq_ptr(service, "io.systemd.DropIn"))
|
if (streq_ptr(service, "io.systemd.DropIn"))
|
||||||
*ret = USERDB_DROPIN_ONLY|USERDB_AVOID_MULTIPLEXER;
|
*ret = USERDB_DROPIN_ONLY|USERDB_AVOID_MULTIPLEXER;
|
||||||
else if (streq_ptr(service, "io.systemd.Multiplexer"))
|
else if (streq_ptr(service, "io.systemd.Multiplexer"))
|
||||||
*ret = USERDB_AVOID_MULTIPLEXER;
|
*ret = USERDB_AVOID_MULTIPLEXER;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user