1
0
mirror of https://github.com/systemd/systemd synced 2025-10-08 13:14:45 +02:00

Compare commits

..

No commits in common. "4e6c50a5d4d471425eb393e828da90b1e558f893" and "5c7466b492ed0987f891bc0387f2467114de3384" have entirely different histories.

8 changed files with 35 additions and 56 deletions

View File

@ -55,14 +55,6 @@ usb:v0627p0001:*QEMU USB Mouse*
usb:v0627p0001:*QEMU USB Tablet* usb:v0627p0001:*QEMU USB Tablet*
ID_AUTOSUSPEND=1 ID_AUTOSUSPEND=1
#########################################
# Sierra Wireless
#########################################
# Sierra Wireless EM7345 4G LTE modem
usb:v1199pA001*
ID_AUTOSUSPEND=1
######################################### #########################################
# Wacom # Wacom
######################################### #########################################

View File

@ -735,10 +735,6 @@ sensor:modalias:acpi:KIOX020A*:dmi:*:svnTECLAST:pnF6Pro:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
ACCEL_LOCATION=base ACCEL_LOCATION=base
# Teclast Tbook 11 (E5A6)
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnTbooK11:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
# Teclast X80 Plus (H5C5) # Teclast X80 Plus (H5C5)
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnDefaultstring:* sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnDefaultstring:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1

View File

@ -1777,13 +1777,11 @@ BindReadOnlyPaths=/var/lib/systemd</programlisting>
<term><varname>RestrictAddressFamilies=</varname></term> <term><varname>RestrictAddressFamilies=</varname></term>
<listitem><para>Restricts the set of socket address families accessible to the processes of this <listitem><para>Restricts the set of socket address families accessible to the processes of this
unit. Takes <literal>none</literal>, or a space-separated list of address family names to unit. Takes a space-separated list of address family names to allow-list, such as
allow-list, such as <constant>AF_UNIX</constant>, <constant>AF_INET</constant> or <constant>AF_UNIX</constant>, <constant>AF_INET</constant> or <constant>AF_INET6</constant>. When
<constant>AF_INET6</constant>. When <literal>none</literal> is specified, then all address prefixed with <constant>~</constant> the listed address families will be applied as deny list,
families will be denied. When prefixed with <literal>~</literal> the listed address otherwise as allow list. Note that this restricts access to the <citerefentry
families will be applied as deny list, otherwise as allow list. Note that this restricts access project='man-pages'><refentrytitle>socket</refentrytitle><manvolnum>2</manvolnum></citerefentry>
to the
<citerefentry project='man-pages'><refentrytitle>socket</refentrytitle><manvolnum>2</manvolnum></citerefentry>
system call only. Sockets passed into the process by other means (for example, by using socket system call only. Sockets passed into the process by other means (for example, by using socket
activation with socket units, see activation with socket units, see
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>) <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>)

View File

@ -195,7 +195,7 @@ void log_assert_failed_return(
_e = (log_get_max_level() >= LOG_PRI(_level)) \ _e = (log_get_max_level() >= LOG_PRI(_level)) \
? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \ ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
: -ERRNO_VALUE(_e); \ : -ERRNO_VALUE(_e); \
_e < 0 ? _e : -ESTRPIPE; \ _e < 0 ? _e : -EIO; \
}) })
#if BUILD_MODE_DEVELOPER && !defined(TEST_CODE) #if BUILD_MODE_DEVELOPER && !defined(TEST_CODE)

View File

@ -2379,8 +2379,8 @@ int bus_exec_context_set_transient_property(
return 1; return 1;
} else if (streq(name, "RestrictAddressFamilies")) { } else if (streq(name, "RestrictAddressFamilies")) {
_cleanup_strv_free_ char **l = NULL;
int allow_list; int allow_list;
_cleanup_strv_free_ char **l = NULL;
r = sd_bus_message_enter_container(message, 'r', "bas"); r = sd_bus_message_enter_container(message, 'r', "bas");
if (r < 0) if (r < 0)
@ -2403,11 +2403,10 @@ int bus_exec_context_set_transient_property(
char **s; char **s;
if (strv_isempty(l)) { if (strv_isempty(l)) {
c->address_families_allow_list = allow_list; c->address_families_allow_list = false;
c->address_families = set_free(c->address_families); c->address_families = set_free(c->address_families);
unit_write_settingf(u, flags, name, "RestrictAddressFamilies=%s", unit_write_settingf(u, flags, name, "RestrictAddressFamilies=");
allow_list ? "none" : "");
return 1; return 1;
} }
@ -2431,7 +2430,7 @@ int bus_exec_context_set_transient_property(
if (r < 0) if (r < 0)
return r; return r;
} else } else
set_remove(c->address_families, INT_TO_PTR(af)); (void) set_remove(c->address_families, INT_TO_PTR(af));
} }
joined = strv_join(l, " "); joined = strv_join(l, " ");

View File

@ -3437,13 +3437,6 @@ int config_parse_address_families(
return 0; return 0;
} }
if (streq(rvalue, "none")) {
/* Forbid all address families. */
c->address_families = set_free(c->address_families);
c->address_families_allow_list = true;
return 0;
}
if (rvalue[0] == '~') { if (rvalue[0] == '~') {
invert = true; invert = true;
rvalue++; rvalue++;

View File

@ -268,7 +268,7 @@ static int manager_enumerate_seats(Manager *m) {
s = hashmap_get(m->seats, de->d_name); s = hashmap_get(m->seats, de->d_name);
if (!s) { if (!s) {
if (unlinkat(dirfd(d), de->d_name, 0) < 0) if (unlinkat(dirfd(d), de->d_name, 0) < 0)
log_warning_errno(errno, "Failed to remove /run/systemd/seats/%s, ignoring: %m", log_warning_errno(errno, "Failed to remove /run/systemd/seats/%s: %m",
de->d_name); de->d_name);
continue; continue;
} }

View File

@ -308,16 +308,17 @@ static int cd_media_compat(Context *c) {
r = ioctl(c->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT); r = ioctl(c->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
if (r < 0) if (r < 0)
return log_debug_errno(errno, "ioctl(CDROM_DRIVE_STATUS) failed: %m"); return log_debug_errno(errno, "ioctl(CDROM_DRIVE_STATUS) failed: m");
if (r != CDS_DISC_OK) if (r != CDS_DISC_OK) {
log_debug_errno(SYNTHETIC_ERRNO(ENOMEDIUM), log_debug("ioctl(CDROM_DRIVE_STATUS) → %d (%s), ignoring",
"ioctl(CDROM_DRIVE_STATUS) → %d (%s), ignoring.", r,
r, r == CDS_NO_INFO ? "no info" :
r == CDS_NO_INFO ? "no info" : r == CDS_NO_DISC ? "no disc" :
r == CDS_NO_DISC ? "no disc" : r == CDS_TRAY_OPEN ? "tray open" :
r == CDS_TRAY_OPEN ? "tray open" : r == CDS_DRIVE_NOT_READY ? "drive not ready" :
r == CDS_DRIVE_NOT_READY ? "drive not ready" : "unkown status");
"unkown status"); return -ENOMEDIUM;
}
c->has_media = true; c->has_media = true;
return 0; return 0;
@ -339,7 +340,7 @@ static int cd_inquiry(Context *c) {
return r; return r;
if ((inq[0] & 0x1F) != 5) if ((inq[0] & 0x1F) != 5)
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Not an MMC unit."); return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Not an MMC unit");
log_debug("INQUIRY: [%.8s][%.16s][%.4s]", inq + 8, inq + 16, inq + 32); log_debug("INQUIRY: [%.8s][%.16s][%.4s]", inq + 8, inq + 16, inq + 32);
return 0; return 0;
@ -449,7 +450,7 @@ static int cd_profiles(Context *c) {
log_debug("GET CONFIGURATION: size of features buffer %zu", len); log_debug("GET CONFIGURATION: size of features buffer %zu", len);
if (len > sizeof(features)) { if (len > sizeof(features)) {
log_debug("Cannot get features in a single query, truncating."); log_debug("cannot get features in a single query, truncating");
len = sizeof(features); len = sizeof(features);
} else if (len <= 8) } else if (len <= 8)
len = sizeof(features); len = sizeof(features);
@ -469,7 +470,7 @@ static int cd_profiles(Context *c) {
log_debug("GET CONFIGURATION: size of features buffer %zu", len); log_debug("GET CONFIGURATION: size of features buffer %zu", len);
if (len > sizeof(features)) { if (len > sizeof(features)) {
log_debug("Cannot get features in a single query, truncating."); log_debug("cannot get features in a single query, truncating");
len = sizeof(features); len = sizeof(features);
} }
@ -528,7 +529,7 @@ static int dvd_ram_media_update_state(Context *c) {
if (dvdstruct[4] & 0x02) { if (dvdstruct[4] & 0x02) {
c->media_state = MEDIA_STATE_COMPLETE; c->media_state = MEDIA_STATE_COMPLETE;
log_debug("Write-protected DVD-RAM media inserted"); log_debug("write-protected DVD-RAM media inserted");
return 1; return 1;
} }
@ -544,24 +545,24 @@ static int dvd_ram_media_update_state(Context *c) {
len = format[3]; len = format[3];
if (len & 7 || len < 16) if (len & 7 || len < 16)
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
"Invalid format capacities length."); "invalid format capacities length");
switch(format[8] & 3) { switch(format[8] & 3) {
case 1: case 1:
/* This means that last format was interrupted or failed, blank dvd-ram discs are /* This means that last format was interrupted or failed, blank dvd-ram discs are
* factory formatted. Take no action here as it takes quite a while to reformat a * factory formatted. Take no action here as it takes quite a while to reformat a
* dvd-ram and it's not automatically started. */ * dvd-ram and it's not automatically started. */
log_debug("Unformatted DVD-RAM media inserted."); log_debug("unformatted DVD-RAM media inserted");
return 1; return 1;
case 2: case 2:
log_debug("Formatted DVD-RAM media inserted."); log_debug("formatted DVD-RAM media inserted");
return 0; return 0;
case 3: case 3:
c->has_media = false; c->has_media = false;
return log_debug_errno(SYNTHETIC_ERRNO(ENOMEDIUM), return log_debug_errno(SYNTHETIC_ERRNO(ENOMEDIUM),
"Format capacities returned no media."); "format capacities returned no media");
} }
return 0; return 0;
@ -598,17 +599,17 @@ static int dvd_media_update_state(Context *c) {
for (size_t offset = 32768; offset < 32768 + 2048; offset++) for (size_t offset = 32768; offset < 32768 + 2048; offset++)
if (buffer[offset] != 0) { if (buffer[offset] != 0) {
log_debug("Data in block 16, assuming complete."); log_debug("data in block 16, assuming complete");
return 0; return 0;
} }
for (size_t offset = 0; offset < 2048; offset++) for (size_t offset = 0; offset < 2048; offset++)
if (buffer[offset] != 0) { if (buffer[offset] != 0) {
log_debug("Data in block 0, assuming complete."); log_debug("data in block 0, assuming complete");
return 0; return 0;
} }
log_debug("No data in blocks 0 or 16, assuming blank."); log_debug("no data in blocks 0 or 16, assuming blank");
c->media_state = MEDIA_STATE_BLANK; c->media_state = MEDIA_STATE_BLANK;
return 0; return 0;
} }
@ -754,7 +755,7 @@ static int open_drive(Context *c) {
if (++cnt >= 20 || errno != EBUSY) if (++cnt >= 20 || errno != EBUSY)
return log_debug_errno(errno, "Unable to open '%s': %m", arg_node); return log_debug_errno(errno, "Unable to open '%s': %m", arg_node);
(void) usleep(100 * USEC_PER_MSEC + random_u64_range(100 * USEC_PER_MSEC)); (void) usleep(100 * USEC_PER_MSEC + random_u64() % (100 * USEC_PER_MSEC));
} }
log_debug("probing: '%s'", arg_node); log_debug("probing: '%s'", arg_node);
@ -830,7 +831,7 @@ static void print_feature(Feature feature, const char *prefix) {
found = typesafe_bsearch(&in, feature_to_string, ELEMENTSOF(feature_to_string), feature_to_string_compare_func); found = typesafe_bsearch(&in, feature_to_string, ELEMENTSOF(feature_to_string), feature_to_string_compare_func);
if (!found) if (!found)
return (void) log_debug("Unknown feature 0x%02x, ignoring.", (unsigned) feature); return (void) log_debug("Unknown feature 0x%02x, ignoring", (unsigned) feature);
printf("%s_%s=1\n", prefix, found->str); printf("%s_%s=1\n", prefix, found->str);
} }