1
0
mirror of https://github.com/systemd/systemd synced 2026-04-12 10:04:50 +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
###########################################################
# Aarvark I2C/SPI Host Adapter
usb:v0403pE0D0*
usb:v0403pe0d0*
ID_SIGNAL_ANALYZER=1
# Beagle Protocol Analyzers
@ -29,16 +29,5 @@ usb:v1679p3001*
# Power Delivery Analyzers
usb:v1679p6003*
usb:v0483pDF11*
ID_SIGNAL_ANALYZER=1
###########################################################
# XGecu
###########################################################
# TL866A/CS
usb:v04D8pE11C*
ID_SIGNAL_ANALYZER=1
# TL866II+
usb:vA466p0A53*
usb:v0483pdf11*
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
# two are most commonly wrong.
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4) + Optional(':')) + '*',
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8) + Optional(':')) + '*',
grammars = { 'usb' : 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)),
'pci' : 'v' + upperhex_word(8) + Optional('d' + upperhex_word(8)),
}
for match in matches:
prefix, rest = match.split(':', maxsplit=1)
gr = grammars.get(prefix)
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:
gr.parseString(rest)
except ParseBaseException as e:
error('Pattern {!r} is invalid: {}', rest, e)
continue
if rest[-1] not in '*:':
error('pattern {} does not end with "*" or ":"', match)
matches.sort()
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"
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"

View File

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

View File

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

View File

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

View File

@ -2,6 +2,7 @@
#include "alloc-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "fuzz.h"
#include "hostname-setup.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = 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);
/* 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 */
#include "alloc-util.h"
#include "fileio.h"
#include "fd-util.h"
#include "fuzz.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_(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);
if (json_parse_file(f, NULL, 0, &v, NULL, NULL) < 0)

View File

@ -4,14 +4,5 @@
#include <stddef.h>
#include <stdint.h>
#include "fileio.h"
/* The entry point into the fuzzer */
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 "fd-util.h"
#include "fileio.h"
#include "fuzz.h"
#include "nspawn-oci.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = 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);
/* We don't want to fill the logs with messages about parse errors.

View File

@ -2,6 +2,7 @@
#include "alloc-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "fuzz.h"
#include "nspawn-settings.h"
@ -9,7 +10,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = 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);
/* 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'],
[],
[libdl],
[], 'ENABLE_NSS'],
[], 'ENABLE_NSS', 'manual'],
[['src/test/test-nss-users.c',
'src/test/nss-test-util.c',
'src/test/nss-test-util.h'],
[],
[libdl],
[], 'ENABLE_NSS'],
[], 'ENABLE_NSS', 'manual'],
[['src/test/test-bus-util.c']],

View File

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

View File

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

View File

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