Compare commits
18 Commits
a8b46548e6
...
397288e3eb
Author | SHA1 | Date |
---|---|---|
Yu Watanabe | 397288e3eb | |
Norbert Lange | 63e2d1714e | |
Yu Watanabe | 0e77fc66bc | |
Zbigniew Jędrzejewski-Szmek | b9d19abd38 | |
Zbigniew Jędrzejewski-Szmek | 6597cb324a | |
Yu Watanabe | da3509f0f5 | |
Yu Watanabe | 50254f5500 | |
Yu Watanabe | dc851c00c3 | |
Yu Watanabe | f3e4b1e07c | |
Zbigniew Jędrzejewski-Szmek | 156a5fd297 | |
Zbigniew Jędrzejewski-Szmek | f7091f458e | |
Hans de Goede | a7a8dcffc2 | |
Hans de Goede | b5f829a2da | |
Zbigniew Jędrzejewski-Szmek | d1109e12c0 | |
Zbigniew Jędrzejewski-Szmek | 8f0a346a29 | |
Susant Sahani | 1c3ec1cd45 | |
Susant Sahani | b4ccc5de7d | |
Susant Sahani | 99ccb8ff89 |
|
@ -643,6 +643,14 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnX98PlusII:*
|
|||
sensor:modalias:acpi:BMA250E*:dmi:bvnAmericanMegatrendsInc.:bvr5.6.5:bd04/15/2014:svnTobefilledbyO.E.M.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnAMICorporation:rnAptioCRB:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
|
||||
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
|
||||
|
||||
#########################################
|
||||
# Toshiba
|
||||
#########################################
|
||||
|
||||
# Toshiba Encore WT10A tablet
|
||||
sensor:modalias:acpi:INVN6500*:dmi:*:svnTOSHIBA:pnTOSHIBAWT10-A-103:*
|
||||
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
|
||||
|
||||
#########################################
|
||||
# Trekstor
|
||||
#########################################
|
||||
|
@ -650,6 +658,9 @@ sensor:modalias:acpi:BMA250*:dmi:*:bvrTREK.G.WI71C.JGBMRBA*:*:svnInsyde:pnST7041
|
|||
sensor:modalias:acpi:BMA250*:dmi:*:bvrTREK.G.WI71C.JGBMRBA*:*:svnTrekStor:pnSurfTabwintron7.0ST70416-6:*
|
||||
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
|
||||
|
||||
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTrekStor:pnSurfTabtwin10.1:*
|
||||
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
|
||||
|
||||
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTREKSTOR*:pnPrimetabS11B:*
|
||||
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTREKSTOR:pnPrimetabT13B:*
|
||||
sensor:modalias:acpi:BOSC0200*:dmi:*:svnTrekStor*:pnSurfTabtwin11.6:*
|
||||
|
|
|
@ -1765,6 +1765,22 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>SendVendorOption=</varname></term>
|
||||
<listitem>
|
||||
<para>Send an arbitrary vendor option in the DHCPv6 request. Takes an enterprise identifier, DHCP option number,
|
||||
data type, and data separated with a colon
|
||||
(<literal><replaceable>enterprise identifier</replaceable>:<replaceable>option</replaceable>:<replaceable>type</replaceable>:
|
||||
<replaceable>value</replaceable></literal>). Enterprise identifier is an unsigned integer ranges 1..4294967294.
|
||||
The option number must be an integer in the range 1..254. Data type takes one of <literal>uint8</literal>,
|
||||
<literal>uint16</literal>, <literal>uint32</literal>, <literal>ipv4address</literal>, <literal>ipv6address</literal>, or
|
||||
<literal>string</literal>. Special characters in the data string may be escaped using
|
||||
<ulink url="https://en.wikipedia.org/wiki/Escape_sequences_in_C#Table_of_escape_sequences">C-style
|
||||
escapes</ulink>. This setting can be specified multiple times. If an empty string is specified,
|
||||
then all options specified earlier are cleared. Defaults to unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>ForceDHCPv6PDOtherInformation=</varname></term>
|
||||
<listitem>
|
||||
|
|
22
meson.build
22
meson.build
|
@ -2198,6 +2198,10 @@ foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
|
|||
join_paths(rootsbindir, alias))
|
||||
endforeach
|
||||
|
||||
meson.add_install_script(meson_make_symlink,
|
||||
join_paths(rootbindir, 'udevadm'),
|
||||
join_paths(rootlibexecdir, 'systemd-udevd'))
|
||||
|
||||
if conf.get('ENABLE_BACKLIGHT') == 1
|
||||
executable(
|
||||
'systemd-backlight',
|
||||
|
@ -2983,24 +2987,6 @@ public_programs += executable(
|
|||
install : true,
|
||||
install_dir : rootlibexecdir)
|
||||
|
||||
public_programs += executable(
|
||||
'systemd-udevd',
|
||||
systemd_udevd_sources,
|
||||
include_directories : includes,
|
||||
c_args : '-DLOG_REALM=LOG_REALM_UDEV',
|
||||
link_with : [libudev_core,
|
||||
libsystemd_network,
|
||||
libudev_static],
|
||||
dependencies : [versiondep,
|
||||
threads,
|
||||
libkmod,
|
||||
libidn,
|
||||
libacl,
|
||||
libblkid],
|
||||
install_rpath : udev_rpath,
|
||||
install : true,
|
||||
install_dir : rootlibexecdir)
|
||||
|
||||
public_programs += executable(
|
||||
'udevadm',
|
||||
udevadm_sources,
|
||||
|
|
|
@ -31,7 +31,7 @@ _bootctl() {
|
|||
local i verb comps
|
||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local -A OPTS=(
|
||||
[STANDALONE]='-h --help --no-variables -p --print-esp-path -x --print-boot-path --version --no-pager'
|
||||
[STANDALONE]='-h --help -p --print-esp-path -x --print-boot-path --version --no-variables --no-pager --graceful'
|
||||
[ARG]='--esp-path --boot-path'
|
||||
)
|
||||
|
||||
|
@ -56,8 +56,10 @@ _bootctl() {
|
|||
fi
|
||||
|
||||
local -A VERBS=(
|
||||
[STANDALONE]='help install list remove status update'
|
||||
# systemd-efi-options takes an argument, but it is free-form, so we cannot complete it
|
||||
[STANDALONE]='help status install update remove is-installed random-seed systemd-efi-options list'
|
||||
[BOOTENTRY]='set-default set-oneshot'
|
||||
[BOOLEAN]='reboot-to-firmware'
|
||||
)
|
||||
|
||||
for ((i=0; i < COMP_CWORD; i++)); do
|
||||
|
@ -86,6 +88,8 @@ _bootctl() {
|
|||
else
|
||||
comps=''
|
||||
fi
|
||||
elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then
|
||||
comps="yes no"
|
||||
fi
|
||||
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
|
|
|
@ -24,6 +24,13 @@ _bootctl_set-oneshot() {
|
|||
_bootctl_comp_ids
|
||||
}
|
||||
|
||||
_bootctl_reboot-to-firmware() {
|
||||
local -a _completions
|
||||
_completions=( yes no )
|
||||
typeset -U _completions
|
||||
_describe 'possible values' _completions
|
||||
}
|
||||
|
||||
(( $+functions[_bootctl_commands] )) || _bootctl_commands()
|
||||
{
|
||||
local -a _bootctl_cmds
|
||||
|
@ -32,8 +39,11 @@ _bootctl_set-oneshot() {
|
|||
"install:Install systemd-boot to the ESP and EFI variables"
|
||||
"update:Update systemd-boot in the ESP and EFI variables"
|
||||
"remove:Remove systemd-boot from the ESP and EFI variables"
|
||||
"random-seed:Initialize random seed in ESP and EFI variables"
|
||||
"is-installed:Test whether systemd-boot is installed in the ESP"
|
||||
"random-seed:Initialize random seed in ESP and EFI variables"
|
||||
"systemd-efi-options:Query or set system options string in EFI variable"
|
||||
"reboot-to-firmware:Query or set reboot-to-firmware EFI flag"
|
||||
"list:List boot loader entries"
|
||||
"set-default:Set the default boot loader entry"
|
||||
"set-oneshot:Set the default boot loader entry only for the next boot"
|
||||
)
|
||||
|
@ -59,4 +69,5 @@ _arguments \
|
|||
{-x,--print-boot-path}'[Print path to the $BOOT partition]' \
|
||||
'--no-variables[Do not touch EFI variables]' \
|
||||
'--no-pager[Do not pipe output into a pager]' \
|
||||
'--graceful[Do not fail when locating ESP or writing fails]' \
|
||||
'*::bootctl command:_bootctl_commands'
|
||||
|
|
|
@ -49,7 +49,7 @@ int parse_uid(const char *s, uid_t *ret) {
|
|||
assert(s);
|
||||
|
||||
assert_cc(sizeof(uid_t) == sizeof(uint32_t));
|
||||
r = safe_atou32(s, &uid);
|
||||
r = safe_atou32_full(s, 10, &uid);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -11,12 +11,14 @@
|
|||
#include "sd-event.h"
|
||||
|
||||
#include "list.h"
|
||||
#include "hashmap.h"
|
||||
#include "macro.h"
|
||||
#include "sparse-endian.h"
|
||||
|
||||
typedef struct sd_dhcp6_option {
|
||||
unsigned n_ref;
|
||||
|
||||
uint32_t enterprise_identifier;
|
||||
uint16_t option;
|
||||
void *data;
|
||||
size_t length;
|
||||
|
@ -99,6 +101,7 @@ int dhcp6_option_append_pd(uint8_t *buf, size_t len, const DHCP6IA *pd, DHCP6Add
|
|||
int dhcp6_option_append_fqdn(uint8_t **buf, size_t *buflen, const char *fqdn);
|
||||
int dhcp6_option_append_user_class(uint8_t **buf, size_t *buflen, char **user_class);
|
||||
int dhcp6_option_append_vendor_class(uint8_t **buf, size_t *buflen, char **user_class);
|
||||
int dhcp6_option_append_vendor_option(uint8_t **buf, size_t *buflen, OrderedHashmap *vendor_options);
|
||||
int dhcp6_option_parse(uint8_t **buf, size_t *buflen, uint16_t *optcode,
|
||||
size_t *optlen, uint8_t **optvalue);
|
||||
int dhcp6_option_parse_status(DHCP6Option *option, size_t len);
|
||||
|
|
|
@ -79,6 +79,39 @@ int dhcp6_option_append(uint8_t **buf, size_t *buflen, uint16_t code,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int dhcp6_option_append_vendor_option(uint8_t **buf, size_t *buflen, OrderedHashmap *vendor_options) {
|
||||
sd_dhcp6_option *options;
|
||||
Iterator i;
|
||||
int r;
|
||||
|
||||
assert(buf);
|
||||
assert(*buf);
|
||||
assert(buflen);
|
||||
assert(vendor_options);
|
||||
|
||||
ORDERED_HASHMAP_FOREACH(options, vendor_options, i) {
|
||||
_cleanup_free_ uint8_t *p = NULL;
|
||||
size_t total;
|
||||
|
||||
total = 4 + 2 + 2 + options->length;
|
||||
|
||||
p = malloc(total);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
unaligned_write_be32(p, options->enterprise_identifier);
|
||||
unaligned_write_be16(p + 4, options->option);
|
||||
unaligned_write_be16(p + 6, options->length);
|
||||
memcpy(p + 8, options->data, options->length);
|
||||
|
||||
r = dhcp6_option_append(buf, buflen, SD_DHCP6_OPTION_VENDOR_OPTS, total, p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, const DHCP6IA *ia) {
|
||||
uint16_t len;
|
||||
uint8_t *ia_hdr;
|
||||
|
@ -683,7 +716,7 @@ static sd_dhcp6_option* dhcp6_option_free(sd_dhcp6_option *i) {
|
|||
return mfree(i);
|
||||
}
|
||||
|
||||
int sd_dhcp6_option_new(uint16_t option, const void *data, size_t length, sd_dhcp6_option **ret) {
|
||||
int sd_dhcp6_option_new(uint16_t option, const void *data, size_t length, uint32_t enterprise_identifier, sd_dhcp6_option **ret) {
|
||||
assert_return(ret, -EINVAL);
|
||||
assert_return(length == 0 || data, -EINVAL);
|
||||
|
||||
|
@ -698,6 +731,7 @@ int sd_dhcp6_option_new(uint16_t option, const void *data, size_t length, sd_dhc
|
|||
*p = (sd_dhcp6_option) {
|
||||
.n_ref = 1,
|
||||
.option = option,
|
||||
.enterprise_identifier = enterprise_identifier,
|
||||
.length = length,
|
||||
.data = TAKE_PTR(q),
|
||||
};
|
||||
|
|
|
@ -81,6 +81,7 @@ struct sd_dhcp6_client {
|
|||
usec_t information_request_time_usec;
|
||||
usec_t information_refresh_time_usec;
|
||||
OrderedHashmap *extra_options;
|
||||
OrderedHashmap *vendor_options;
|
||||
};
|
||||
|
||||
static const uint16_t default_req_opts[] = {
|
||||
|
@ -225,6 +226,25 @@ int sd_dhcp6_client_set_prefix_delegation_hint(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sd_dhcp6_client_add_vendor_option(sd_dhcp6_client *client, sd_dhcp6_option *v) {
|
||||
int r;
|
||||
|
||||
assert_return(client, -EINVAL);
|
||||
assert_return(v, -EINVAL);
|
||||
|
||||
r = ordered_hashmap_ensure_allocated(&client->vendor_options, &dhcp6_option_hash_ops);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = ordered_hashmap_put(client->vendor_options, v, v);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
sd_dhcp6_option_ref(v);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int client_ensure_duid(sd_dhcp6_client *client) {
|
||||
if (client->duid_len != 0)
|
||||
return 0;
|
||||
|
@ -622,6 +642,13 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
|
|||
return r;
|
||||
}
|
||||
|
||||
if (!ordered_hashmap_isempty(client->vendor_options)) {
|
||||
r = dhcp6_option_append_vendor_option(&opt, &optlen,
|
||||
client->vendor_options);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
|
||||
r = dhcp6_option_append_pd(opt, optlen, &client->ia_pd, &client->hint_pd_prefix);
|
||||
if (r < 0)
|
||||
|
@ -680,6 +707,12 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
|
|||
return r;
|
||||
}
|
||||
|
||||
if (!ordered_hashmap_isempty(client->vendor_options)) {
|
||||
r = dhcp6_option_append_vendor_option(&opt, &optlen, client->vendor_options);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
|
||||
r = dhcp6_option_append_pd(opt, optlen, &client->lease->pd, NULL);
|
||||
if (r < 0)
|
||||
|
@ -726,6 +759,12 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
|
|||
return r;
|
||||
}
|
||||
|
||||
if (!ordered_hashmap_isempty(client->vendor_options)) {
|
||||
r = dhcp6_option_append_vendor_option(&opt, &optlen, client->vendor_options);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (FLAGS_SET(client->request, DHCP6_REQUEST_IA_PD)) {
|
||||
r = dhcp6_option_append_pd(opt, optlen, &client->lease->pd, NULL);
|
||||
if (r < 0)
|
||||
|
|
|
@ -815,7 +815,7 @@ static int show_properties(sd_bus *bus, const char *path, bool *new_line) {
|
|||
static int show_session(int argc, char *argv[], void *userdata) {
|
||||
bool properties, new_line = false;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
_cleanup_free_ char *path = NULL;
|
||||
|
||||
|
@ -834,7 +834,7 @@ static int show_session(int argc, char *argv[], void *userdata) {
|
|||
return print_session_status_info(bus, "/org/freedesktop/login1/session/auto", &new_line);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
r = get_session_path(bus, argv[i], &error, &path);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get session path: %s", bus_error_message(&error, r));
|
||||
|
@ -854,7 +854,7 @@ static int show_session(int argc, char *argv[], void *userdata) {
|
|||
static int show_user(int argc, char *argv[], void *userdata) {
|
||||
bool properties, new_line = false;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -871,7 +871,7 @@ static int show_user(int argc, char *argv[], void *userdata) {
|
|||
return print_user_status_info(bus, "/org/freedesktop/login1/user/self", &new_line);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message * reply = NULL;
|
||||
const char *path = NULL;
|
||||
|
@ -911,7 +911,7 @@ static int show_user(int argc, char *argv[], void *userdata) {
|
|||
static int show_seat(int argc, char *argv[], void *userdata) {
|
||||
bool properties, new_line = false;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -928,7 +928,7 @@ static int show_seat(int argc, char *argv[], void *userdata) {
|
|||
return print_seat_status_info(bus, "/org/freedesktop/login1/seat/auto", &new_line);
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message * reply = NULL;
|
||||
const char *path = NULL;
|
||||
|
@ -956,7 +956,7 @@ static int show_seat(int argc, char *argv[], void *userdata) {
|
|||
static int activate(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -980,7 +980,7 @@ static int activate(int argc, char *argv[], void *userdata) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
|
@ -1001,7 +1001,7 @@ static int activate(int argc, char *argv[], void *userdata) {
|
|||
static int kill_session(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -1011,7 +1011,7 @@ static int kill_session(int argc, char *argv[], void *userdata) {
|
|||
if (!arg_kill_who)
|
||||
arg_kill_who = "all";
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
|
@ -1031,7 +1031,7 @@ static int enable_linger(int argc, char *argv[], void *userdata) {
|
|||
sd_bus *bus = userdata;
|
||||
char* short_argv[3];
|
||||
bool b;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -1051,7 +1051,7 @@ static int enable_linger(int argc, char *argv[], void *userdata) {
|
|||
argc = 2;
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
uid_t uid;
|
||||
|
||||
if (isempty(argv[i]))
|
||||
|
@ -1078,14 +1078,14 @@ static int enable_linger(int argc, char *argv[], void *userdata) {
|
|||
static int terminate_user(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
uid_t uid;
|
||||
|
||||
r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL, 0);
|
||||
|
@ -1103,7 +1103,7 @@ static int terminate_user(int argc, char *argv[], void *userdata) {
|
|||
static int kill_user(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
@ -1113,7 +1113,7 @@ static int kill_user(int argc, char *argv[], void *userdata) {
|
|||
if (!arg_kill_who)
|
||||
arg_kill_who = "all";
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
uid_t uid;
|
||||
|
||||
r = get_user_creds((const char**) (argv+i), &uid, NULL, NULL, NULL, 0);
|
||||
|
@ -1136,14 +1136,14 @@ static int kill_user(int argc, char *argv[], void *userdata) {
|
|||
static int attach(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (i = 2; i < argc; i++) {
|
||||
for (int i = 2; i < argc; i++) {
|
||||
|
||||
r = bus_call_method(
|
||||
bus,
|
||||
|
@ -1200,14 +1200,14 @@ static int lock_sessions(int argc, char *argv[], void *userdata) {
|
|||
static int terminate_seat(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus *bus = userdata;
|
||||
int r, i;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(argv);
|
||||
|
||||
polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
||||
r = bus_call_method(bus, bus_login_mgr, "TerminateSeat", &error, NULL, "s", argv[i]);
|
||||
if (r < 0)
|
||||
|
|
|
@ -102,7 +102,7 @@ static void macsec_receive_channel_free(ReceiveChannel *c) {
|
|||
|
||||
if (c->macsec) {
|
||||
if (c->sci.as_uint64 > 0)
|
||||
ordered_hashmap_remove(c->macsec->receive_channels, &c->sci.as_uint64);
|
||||
ordered_hashmap_remove_value(c->macsec->receive_channels, &c->sci.as_uint64, c);
|
||||
|
||||
if (c->section)
|
||||
ordered_hashmap_remove(c->macsec->receive_channels_by_section, c->section);
|
||||
|
|
|
@ -219,6 +219,7 @@ static int wireguard_set_interface(NetDev *netdev) {
|
|||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL;
|
||||
WireguardIPmask *mask_start = NULL;
|
||||
WireguardPeer *peer, *peer_start;
|
||||
bool sent_once = false;
|
||||
uint32_t serial;
|
||||
Wireguard *w;
|
||||
int r;
|
||||
|
@ -227,7 +228,7 @@ static int wireguard_set_interface(NetDev *netdev) {
|
|||
w = WIREGUARD(netdev);
|
||||
assert(w);
|
||||
|
||||
for (peer_start = w->peers; peer_start; ) {
|
||||
for (peer_start = w->peers; peer_start || !sent_once; ) {
|
||||
uint16_t i = 0;
|
||||
|
||||
message = sd_netlink_message_unref(message);
|
||||
|
@ -278,6 +279,8 @@ static int wireguard_set_interface(NetDev *netdev) {
|
|||
r = sd_netlink_send(netdev->manager->genl, message, &serial);
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not set wireguard device: %m");
|
||||
|
||||
sent_once = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -437,13 +437,13 @@ int config_parse_dhcp_send_option(
|
|||
|
||||
_cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *opt4 = NULL, *old4 = NULL;
|
||||
_cleanup_(sd_dhcp6_option_unrefp) sd_dhcp6_option *opt6 = NULL, *old6 = NULL;
|
||||
uint32_t uint32_data, enterprise_identifier = 0;
|
||||
_cleanup_free_ char *word = NULL, *q = NULL;
|
||||
OrderedHashmap **options = data;
|
||||
uint16_t u16, uint16_data;
|
||||
union in_addr_union addr;
|
||||
DHCPOptionDataType type;
|
||||
uint8_t u8, uint8_data;
|
||||
uint16_t u16, uint16_data;
|
||||
uint32_t uint32_data;
|
||||
const void *udata;
|
||||
const char *p;
|
||||
ssize_t sz;
|
||||
|
@ -460,10 +460,29 @@ int config_parse_dhcp_send_option(
|
|||
}
|
||||
|
||||
p = rvalue;
|
||||
if (ltype == AF_INET6 && streq(lvalue, "SendVendorOption")) {
|
||||
r = extract_first_word(&p, &word, ":", 0);
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
if (r <= 0) {
|
||||
if (r <= 0 || isempty(p)) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Invalid DHCP option, ignoring assignment: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = safe_atou32(word, &enterprise_identifier);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse DHCPv6 enterprise identifier data, ignoring assignment: %s", p);
|
||||
return 0;
|
||||
}
|
||||
word = mfree(word);
|
||||
}
|
||||
|
||||
r = extract_first_word(&p, &word, ":", 0);
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
if (r <= 0 || isempty(p)) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Invalid DHCP option, ignoring assignment: %s", rvalue);
|
||||
return 0;
|
||||
|
@ -588,7 +607,7 @@ int config_parse_dhcp_send_option(
|
|||
}
|
||||
|
||||
if (ltype == AF_INET6) {
|
||||
r = sd_dhcp6_option_new(u16, udata, sz, &opt6);
|
||||
r = sd_dhcp6_option_new(u16, udata, sz, enterprise_identifier, &opt6);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to store DHCP option '%s', ignoring assignment: %m", rvalue);
|
||||
|
|
|
@ -756,6 +756,7 @@ static int dhcp6_set_hostname(sd_dhcp6_client *client, Link *link) {
|
|||
|
||||
int dhcp6_configure(Link *link) {
|
||||
_cleanup_(sd_dhcp6_client_unrefp) sd_dhcp6_client *client = NULL;
|
||||
sd_dhcp6_option *vendor_option;
|
||||
sd_dhcp6_option *send_option;
|
||||
void *request_options;
|
||||
const DUID *duid;
|
||||
|
@ -854,6 +855,14 @@ int dhcp6_configure(Link *link) {
|
|||
return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set vendor class: %m");
|
||||
}
|
||||
|
||||
ORDERED_HASHMAP_FOREACH(vendor_option, link->network->dhcp6_client_send_vendor_options, i) {
|
||||
r = sd_dhcp6_client_add_vendor_option(client, vendor_option);
|
||||
if (r == -EEXIST)
|
||||
continue;
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set vendor option: %m");
|
||||
}
|
||||
|
||||
r = sd_dhcp6_client_set_callback(client, dhcp6_handler, link);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "DHCP6 CLIENT: Failed to set callback: %m");
|
||||
|
|
|
@ -198,6 +198,7 @@ DHCPv6.MUDURL, config_parse_dhcp6_mud_url,
|
|||
DHCPv6.RequestOptions, config_parse_dhcp_request_options, AF_INET6, 0
|
||||
DHCPv6.UserClass, config_parse_dhcp_user_class, AF_INET6, offsetof(Network, dhcp6_user_class)
|
||||
DHCPv6.VendorClass, config_parse_dhcp_vendor_class, 0, offsetof(Network, dhcp6_vendor_class)
|
||||
DHCPv6.SendVendorOption, config_parse_dhcp_send_option, AF_INET6, offsetof(Network, dhcp6_client_send_vendor_options)
|
||||
DHCPv6.ForceDHCPv6PDOtherInformation, config_parse_bool, 0, offsetof(Network, dhcp6_force_pd_other_information)
|
||||
DHCPv6.AssignAcquiredDelegatedPrefixAddress, config_parse_bool, 0, offsetof(Network, dhcp6_pd_assign_prefix)
|
||||
DHCPv6.PrefixDelegationHint, config_parse_dhcp6_pd_hint, 0, 0
|
||||
|
|
|
@ -752,6 +752,8 @@ static Network *network_free(Network *network) {
|
|||
ordered_hashmap_free(network->dhcp_server_send_options);
|
||||
ordered_hashmap_free(network->dhcp_server_send_vendor_options);
|
||||
ordered_hashmap_free(network->ipv6_tokens);
|
||||
ordered_hashmap_free(network->dhcp6_client_send_options);
|
||||
ordered_hashmap_free(network->dhcp6_client_send_vendor_options);
|
||||
|
||||
return mfree(network);
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ struct Network {
|
|||
char **dhcp6_vendor_class;
|
||||
struct in6_addr dhcp6_pd_address;
|
||||
OrderedHashmap *dhcp6_client_send_options;
|
||||
OrderedHashmap *dhcp6_client_send_vendor_options;
|
||||
Set *dhcp6_request_options;
|
||||
|
||||
/* DHCP Server Support */
|
||||
|
|
|
@ -24,6 +24,7 @@ _not_installed_headers = '''
|
|||
sd-dhcp-client.h
|
||||
sd-dhcp-lease.h
|
||||
sd-dhcp-option.h
|
||||
sd-dhcp6-option.h
|
||||
sd-dhcp-server.h
|
||||
sd-ipv4acd.h
|
||||
sd-ipv4ll.h
|
||||
|
|
|
@ -143,7 +143,10 @@ int sd_dhcp6_client_get_address_request(sd_dhcp6_client *client,
|
|||
int *request);
|
||||
int sd_dhcp6_client_set_address_request(sd_dhcp6_client *client,
|
||||
int request);
|
||||
int sd_dhcp6_client_set_transaction_id(sd_dhcp6_client *client, uint32_t transaction_id);
|
||||
int sd_dhcp6_client_set_transaction_id(sd_dhcp6_client *client,
|
||||
uint32_t transaction_id);
|
||||
int sd_dhcp6_client_add_vendor_option(sd_dhcp6_client *client,
|
||||
sd_dhcp6_option *v);
|
||||
|
||||
int sd_dhcp6_client_get_lease(
|
||||
sd_dhcp6_client *client,
|
||||
|
|
|
@ -26,7 +26,7 @@ _SD_BEGIN_DECLARATIONS;
|
|||
|
||||
typedef struct sd_dhcp6_option sd_dhcp6_option;
|
||||
|
||||
int sd_dhcp6_option_new(uint16_t option, const void *data, size_t length, sd_dhcp6_option **ret);
|
||||
int sd_dhcp6_option_new(uint16_t option, const void *data, size_t length, uint32_t enterprise_identifier, sd_dhcp6_option **ret);
|
||||
sd_dhcp6_option *sd_dhcp6_option_ref(sd_dhcp6_option *ra);
|
||||
sd_dhcp6_option *sd_dhcp6_option_unref(sd_dhcp6_option *ra);
|
||||
|
||||
|
|
|
@ -48,9 +48,19 @@ static void test_parse_uid(void) {
|
|||
|
||||
r = parse_uid("65535", &uid);
|
||||
assert_se(r == -ENXIO);
|
||||
assert_se(uid == 100);
|
||||
|
||||
r = parse_uid("0x1234", &uid);
|
||||
assert_se(r == -EINVAL);
|
||||
assert_se(uid == 100);
|
||||
|
||||
r = parse_uid("01234", &uid);
|
||||
assert_se(r == 0);
|
||||
assert_se(uid == 1234);
|
||||
|
||||
r = parse_uid("asdsdas", &uid);
|
||||
assert_se(r == -EINVAL);
|
||||
assert_se(uid == 1234);
|
||||
}
|
||||
|
||||
static void test_uid_ptr(void) {
|
||||
|
|
|
@ -13,10 +13,9 @@ udevadm_sources = files('''
|
|||
udevadm-trigger.c
|
||||
udevadm-util.c
|
||||
udevadm-util.h
|
||||
udevd.c
|
||||
'''.split())
|
||||
|
||||
systemd_udevd_sources = files('udevd.c')
|
||||
|
||||
libudev_core_sources = '''
|
||||
udev-ctrl.c
|
||||
udev-ctrl.h
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "selinux-util.h"
|
||||
#include "string-util.h"
|
||||
#include "udevadm.h"
|
||||
#include "udevd.h"
|
||||
#include "udev-util.h"
|
||||
#include "verbs.h"
|
||||
#include "util.h"
|
||||
|
@ -110,6 +111,9 @@ static int udevadm_main(int argc, char *argv[]) {
|
|||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
if (strstr(program_invocation_short_name, "udevd"))
|
||||
return run_udevd(argc, argv);
|
||||
|
||||
udev_parse_config();
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "strv.h"
|
||||
#include "strxcpyx.h"
|
||||
#include "syslog-util.h"
|
||||
#include "udevd.h"
|
||||
#include "udev-builtin.h"
|
||||
#include "udev-ctrl.h"
|
||||
#include "udev-event.h"
|
||||
|
@ -1472,7 +1473,7 @@ static int help(void) {
|
|||
return log_oom();
|
||||
|
||||
printf("%s [OPTIONS...]\n\n"
|
||||
"Manages devices.\n\n"
|
||||
"Rule-based manager for device events and files.\n\n"
|
||||
" -h --help Print this message\n"
|
||||
" -V --version Print version of the program\n"
|
||||
" -d --daemon Detach and run in the background\n"
|
||||
|
@ -1713,7 +1714,7 @@ static int main_loop(Manager *manager) {
|
|||
return r;
|
||||
}
|
||||
|
||||
static int run(int argc, char *argv[]) {
|
||||
int run_udevd(int argc, char *argv[]) {
|
||||
_cleanup_free_ char *cgroup = NULL;
|
||||
_cleanup_(manager_freep) Manager *manager = NULL;
|
||||
int fd_ctrl = -1, fd_uevent = -1;
|
||||
|
@ -1828,5 +1829,3 @@ static int run(int argc, char *argv[]) {
|
|||
|
||||
return main_loop(manager);
|
||||
}
|
||||
|
||||
DEFINE_MAIN_FUNCTION(run);
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
#pragma once
|
||||
|
||||
int run_udevd(int argc, char *argv[]);
|
|
@ -0,0 +1,10 @@
|
|||
[NetDev]
|
||||
Name=o
|
||||
Kind=macsec
|
||||
|
||||
[MACsecReceiveChannel]
|
||||
MACAddress=12.0.4
|
||||
Port=913
|
||||
[MACsecReceiveChannel]
|
||||
MACAddress=12.0.4
|
||||
Port=913
|
|
@ -120,6 +120,7 @@ RequestOptions=
|
|||
UserClass=
|
||||
VendorClass=
|
||||
AssignAcquiredDelegatedPrefixAddress=
|
||||
SendVendorOption=
|
||||
[Route]
|
||||
Destination=
|
||||
Protocol=
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[NetDev]
|
||||
Name=wg97
|
||||
Kind=wireguard
|
||||
|
||||
[WireGuard]
|
||||
PrivateKey=EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong=
|
||||
ListenPort=51821
|
||||
FwMark=1235
|
|
@ -0,0 +1,2 @@
|
|||
[Match]
|
||||
Name=wg97
|
|
@ -746,6 +746,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
'vtitun99',
|
||||
'vxcan99',
|
||||
'vxlan99',
|
||||
'wg97',
|
||||
'wg98',
|
||||
'wg99',
|
||||
]
|
||||
|
@ -832,6 +833,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
'25-vxlan.netdev',
|
||||
'25-wireguard-23-peers.netdev',
|
||||
'25-wireguard-23-peers.network',
|
||||
'25-wireguard-no-peer.netdev',
|
||||
'25-wireguard-no-peer.network',
|
||||
'25-wireguard-preshared-key.txt',
|
||||
'25-wireguard-private-key.txt',
|
||||
'25-wireguard.netdev',
|
||||
|
@ -1115,9 +1118,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
def test_wireguard(self):
|
||||
copy_unit_to_networkd_unit_path('25-wireguard.netdev', '25-wireguard.network',
|
||||
'25-wireguard-23-peers.netdev', '25-wireguard-23-peers.network',
|
||||
'25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt')
|
||||
'25-wireguard-preshared-key.txt', '25-wireguard-private-key.txt',
|
||||
'25-wireguard-no-peer.netdev', '25-wireguard-no-peer.network')
|
||||
start_networkd()
|
||||
self.wait_online(['wg99:carrier', 'wg98:routable'])
|
||||
self.wait_online(['wg99:carrier', 'wg98:routable', 'wg97:carrier'])
|
||||
|
||||
if shutil.which('wg'):
|
||||
call('wg')
|
||||
|
@ -1142,6 +1146,11 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
output = check_output('wg show wg98 private-key')
|
||||
self.assertRegex(output, r'CJQUtcS9emY2fLYqDlpSZiE/QJyHkPWr\+WHtZLZ90FU=')
|
||||
|
||||
output = check_output('wg show wg97 listen-port')
|
||||
self.assertRegex(output, '51821')
|
||||
output = check_output('wg show wg97 fwmark')
|
||||
self.assertRegex(output, '0x4d3')
|
||||
|
||||
def test_geneve(self):
|
||||
copy_unit_to_networkd_unit_path('25-geneve.netdev', 'netdev-link-local-addressing-yes.network')
|
||||
start_networkd()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# (at your option) any later version.
|
||||
|
||||
[Unit]
|
||||
Description=udev Kernel Device Manager
|
||||
Description=Rule-based manager for device events and files
|
||||
Documentation=man:systemd-udevd.service(8) man:udev(7)
|
||||
DefaultDependencies=no
|
||||
After=systemd-sysusers.service systemd-hwdb-update.service
|
||||
|
|
Loading…
Reference in New Issue