1
0
mirror of https://github.com/systemd/systemd synced 2026-04-12 01:55:10 +02:00

Compare commits

..

No commits in common. "ff97eb4aac31477ea7cb4b37b9f41779a6cc27ee" and "bb18c742c8131c41d1152eb387e82d788874306b" have entirely different histories.

15 changed files with 41 additions and 45 deletions

View File

@ -12,7 +12,7 @@
# Total Phase # Total Phase
########################################################### ###########################################################
# Aarvark I2C/SPI Host Adapter # Aarvark I2C/SPI Host Adapter
usb:v0403pE0D0* usb:v0403pe0d0*
ID_SIGNAL_ANALYZER=1 ID_SIGNAL_ANALYZER=1
# Beagle Protocol Analyzers # Beagle Protocol Analyzers
@ -29,16 +29,5 @@ usb:v1679p3001*
# Power Delivery Analyzers # Power Delivery Analyzers
usb:v1679p6003* usb:v1679p6003*
usb:v0483pDF11* usb:v0483pdf11*
ID_SIGNAL_ANALYZER=1
###########################################################
# XGecu
###########################################################
# TL866A/CS
usb:v04D8pE11C*
ID_SIGNAL_ANALYZER=1
# TL866II+
usb:vA466p0A53*
ID_SIGNAL_ANALYZER=1 ID_SIGNAL_ANALYZER=1

View File

@ -212,23 +212,21 @@ def check_matches(groups):
# This is a partial check. The other cases could be also done, but those # This is a partial check. The other cases could be also done, but those
# two are most commonly wrong. # two are most commonly wrong.
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4) + Optional(':')) + '*', grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)),
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8) + Optional(':')) + '*', 'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8)),
} }
for match in matches: for match in matches:
prefix, rest = match.split(':', maxsplit=1) prefix, rest = match.split(':', maxsplit=1)
gr = grammars.get(prefix) gr = grammars.get(prefix)
if gr: if gr:
# we check this first to provide an easy error message
if rest[-1] not in '*:':
error('pattern {} does not end with "*" or ":"', match)
try: try:
gr.parseString(rest) gr.parseString(rest)
except ParseBaseException as e: except ParseBaseException as e:
error('Pattern {!r} is invalid: {}', rest, e) error('Pattern {!r} is invalid: {}', rest, e)
continue continue
if rest[-1] not in '*:':
error('pattern {} does not end with "*" or ":"', match)
matches.sort() matches.sort()
prev = None prev = None

View File

@ -12,6 +12,7 @@ SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}" ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="hwdb 'usb:v$attr{idVendor}p$attr{idProduct}'"
ACTION!="add", GOTO="default_end" ACTION!="add", GOTO="default_end"

View File

@ -21,7 +21,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
assert_se(p); assert_se(p);
char16_t *title = get_bcd_title(p, size); char16_t *title = get_bcd_title(p, size);
if (title) assert_se(!title || char16_strlen(title) >= 0);
(void) char16_strlen(title);
return 0; return 0;
} }

View File

@ -2,6 +2,7 @@
#include "conf-parser.h" #include "conf-parser.h"
#include "fd-util.h" #include "fd-util.h"
#include "fileio.h"
#include "fuzz.h" #include "fuzz.h"
#include "install.h" #include "install.h"
#include "load-fragment.h" #include "load-fragment.h"
@ -21,7 +22,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
const char *name; const char *name;
long offset; long offset;
f = data_to_file(data, size); if (size == 0)
return 0;
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
if (read_line(f, LINE_MAX, &p) < 0) if (read_line(f, LINE_MAX, &p) < 0)

View File

@ -4,6 +4,7 @@
#include "alloc-util.h" #include "alloc-util.h"
#include "env-file.h" #include "env-file.h"
#include "fileio.h"
#include "fd-util.h" #include "fd-util.h"
#include "fuzz.h" #include "fuzz.h"
#include "strv.h" #include "strv.h"
@ -12,10 +13,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL; _cleanup_fclose_ FILE *f = NULL;
_cleanup_strv_free_ char **rl = NULL, **rlp = NULL; _cleanup_strv_free_ char **rl = NULL, **rlp = NULL;
if (size > 65535) if (size == 0 || size > 65535)
return 0; return 0;
f = data_to_file(data, size); f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
/* We don't want to fill the logs with messages about parse errors. /* We don't want to fill the logs with messages about parse errors.

View File

@ -2,6 +2,7 @@
#include "alloc-util.h" #include "alloc-util.h"
#include "fd-util.h" #include "fd-util.h"
#include "fileio.h"
#include "fuzz.h" #include "fuzz.h"
#include "hostname-setup.h" #include "hostname-setup.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL; _cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ char *ret = NULL; _cleanup_free_ char *ret = NULL;
f = data_to_file(data, size); if (size == 0)
return 0;
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
/* We don't want to fill the logs with messages about parse errors. /* We don't want to fill the logs with messages about parse errors.

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h" #include "alloc-util.h"
#include "fileio.h"
#include "fd-util.h" #include "fd-util.h"
#include "fuzz.h" #include "fuzz.h"
#include "json.h" #include "json.h"
@ -11,7 +12,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL, *g = NULL; _cleanup_fclose_ FILE *f = NULL, *g = NULL;
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL; _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
f = data_to_file(data, size); if (size == 0)
return 0;
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0) if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0)

View File

@ -4,14 +4,5 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "fileio.h"
/* The entry point into the fuzzer */ /* The entry point into the fuzzer */
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
static inline FILE* data_to_file(const uint8_t *data, size_t size) {
if (size == 0)
return fopen("/dev/null", "re");
else
return fmemopen_unlocked((char*) data, size, "re");
}

View File

@ -2,6 +2,7 @@
#include "alloc-util.h" #include "alloc-util.h"
#include "fd-util.h" #include "fd-util.h"
#include "fileio.h"
#include "fuzz.h" #include "fuzz.h"
#include "nspawn-oci.h" #include "nspawn-oci.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL; _cleanup_fclose_ FILE *f = NULL;
_cleanup_(settings_freep) Settings *s = NULL; _cleanup_(settings_freep) Settings *s = NULL;
f = data_to_file(data, size); if (size == 0)
return 0;
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
/* We don't want to fill the logs with messages about parse errors. /* We don't want to fill the logs with messages about parse errors.

View File

@ -2,6 +2,7 @@
#include "alloc-util.h" #include "alloc-util.h"
#include "fd-util.h" #include "fd-util.h"
#include "fileio.h"
#include "fuzz.h" #include "fuzz.h"
#include "nspawn-settings.h" #include "nspawn-settings.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL; _cleanup_fclose_ FILE *f = NULL;
_cleanup_(settings_freep) Settings *s = NULL; _cleanup_(settings_freep) Settings *s = NULL;
f = data_to_file(data, size); if (size == 0)
return 0;
f = fmemopen_unlocked((char*) data, size, "re");
assert_se(f); assert_se(f);
/* We don't want to fill the logs with messages about parse errors. /* We don't want to fill the logs with messages about parse errors.

View File

@ -608,14 +608,14 @@ tests += [
'src/test/nss-test-util.h'], 'src/test/nss-test-util.h'],
[], [],
[libdl], [libdl],
[], 'ENABLE_NSS'], [], 'ENABLE_NSS', 'manual'],
[['src/test/test-nss-users.c', [['src/test/test-nss-users.c',
'src/test/nss-test-util.c', 'src/test/nss-test-util.c',
'src/test/nss-test-util.h'], 'src/test/nss-test-util.h'],
[], [],
[libdl], [libdl],
[], 'ENABLE_NSS'], [], 'ENABLE_NSS', 'manual'],
[['src/test/test-bus-util.c']], [['src/test/test-bus-util.c']],

View File

@ -420,7 +420,7 @@ static int parse_argv(int argc, char **argv,
#if ENABLE_NSS_MYMACHINES #if ENABLE_NSS_MYMACHINES
"mymachines", "mymachines",
#endif #endif
NULL); "dns");
assert_se(modules); assert_se(modules);
if (argc > 2) { if (argc > 2) {

View File

@ -214,7 +214,7 @@ static int parse_argv(int argc, char **argv,
#if ENABLE_NSS_MYMACHINES #if ENABLE_NSS_MYMACHINES
"mymachines", "mymachines",
#endif #endif
NULL); "files");
assert_se(modules); assert_se(modules);
if (argc > 2) if (argc > 2)

View File

@ -7,10 +7,7 @@ sanitize_address_undefined = custom_target(
project_source_root, project_source_root,
'@OUTPUT@', '@OUTPUT@',
'fuzzers', 'fuzzers',
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@'.format( '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@'.format(get_option('optimization')),
get_option('optimization'),
get_option('werror') ? '--werror' : ''
),
' '.join(cc.cmd_array()), ' '.join(cc.cmd_array()),
cxx_cmd]) cxx_cmd])