| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code was setting errno, which we don't do, and which is hard to get right…
Rework the code to use the usual negative-errno convention and add some
debug logging.
disk_scsi_inquiry_command() was working partially by accident: the v3 fallback
would enter the v4 check path, and pass it because the v4 data would still be
initialized to 0.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Beef up syntax and error messages a bit.
|
| |
| |
| |
| |
| | |
Also split out parse_argv(), use "ARG" instead of "<arg>".
Make the syntax help a bit more precise.
|
| |
| |
| |
| |
| |
| |
| | |
Log an error when a rule line contains the following kind of conflicting
match expressions:
KEY=="foo", KEY=="bar"
|
| |
| |
| |
| |
| |
| |
| | |
Fix check for conflicting and duplicate expressions of types that
support alternative patterns.
Fixes: 3ec58d0cd8f6 ("udev-rules: check for conflicting and duplicate expressions")
|
| |
| |
| |
| |
| |
| | |
This reverts commit cd3c8a117ccf3505e49d34324473e2175ef0a9ce which was
papering over the bug instead of a proper fix made by the previous
commit.
|
|\ \
| | |
| | | |
udev: slightly extend comment and add more tests
|
| | |
| | |
| | |
| | | |
Resolves the confusion in https://github.com/systemd/systemd/pull/26693#discussion_r1131151335.
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Log an error when a rule line contains conflicting match expressions, e.g.
NAME=="value", NAME!="value"
Log a warning when a rule line contains duplicate expressions, e.g.
NAME=="value", NAME=="value"
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The tagging is used by `udevadm verify` and the command only parses
udev rules but not apply them.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the loggers take the most relevant object, i.e. when
applying udev rules to a device, the loggers take sd_device and
UdevRuleToken object, and when parsing udev rules, they take
UdevRuleLine or UdevRuleFile object.
To achieve that, this drops 'iterators' in UdevRules or friends named
`current_file` or so. Instead of that, each object now has its
parent object, e.g. UdevRuleToken.rule_line that references the
UdevRuleLine object the token belonging to. And each function previously
took UdevRules object now takes the most relevant object, e.g. UdevRuleToken.
Solves the discussion in https://github.com/systemd/systemd/pull/26698#discussion_r1129261193.
|
|\
| |
| | |
boot: Drop gnu-efi / Add elf2efi.py
|
| |
| |
| |
| | |
This will help in a later commit to separate userspace from EFI builds.
|
| |
| |
| |
| |
| |
| | |
When a rules contains several LABEL tokens, the parser used to silently
discard all of them besides the last one without any diagnostics at all.
It's time to break the vow of silence and let the parser issue a warning.
|
| |
| |
| |
| |
| |
| | |
When udevadm verify is invoked without positional arguments and loads
all rules files from the system like the udev daemon does, this option
can be used to operate on files underneath the specified root path.
|
|/
|
|
|
|
| |
When udevadm verify is invoked without positional arguments, that is,
when no udev rules files are specified, load all rules files from the system
like the udev daemon does, and verify them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for retrieving info about the inode backing a loopback
file to udev-builtin-blkid. It will pick up the inode number and device
of the backing inode, as well as the lo_file_name[] array that the
loopback device maintains.
A later patch uses this information to create block device symlinks in
/dev/ that allow refering block devices by their backing inodes. This is
useful when separate tools set up a loopback device from those which
ultimately shall mount them, and there shall be a stable reference be
passed along. For example, we can add a new kernel option setuploop= or
so which allows setting up a block device via a generator, and still
have a way to safely reference later.
And yes, this doesn't directly have anything to do with the probing
libblkid does, but it's close enough, and we have the device open anyway
here, so the additional ioctl() here should not hurt.
|
| |
|
|
|
|
|
|
|
| |
When udev rules file ends with a line continuation, the parser
used to silently ignore the line without any diagnostics at all.
It's time to break the vow of silence and let the parser issue some
error diagnostics.
|
|
|
|
|
|
| |
Check for unused labels in the specified udev rules files, report such
labels and exit with a non-zero exit code if any unused labels are
found.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We seem to have no tool to verify udev rule files. There is a simple
udev rules syntax checker in the tree, test/rule-syntax-check.py, but
it is too simple to detect less trivial issues not detected by udev,
e.g. redundant comparisons (#26593) or labels without references.
Such a tool would be beneficial not only for maintaining udev rules
distributed along with udev, but also and even more so for maintaining
third party udev rules that are more likely to have issues with syntax
and semantic correctness.
Implement a udev rules syntax and semantics checker in the form of
'udevadm verify [OPTIONS] FILE...' command that is based on
udev_rules_parse_file() interface and would apply further checks
on top of it in subsequent commits.
Resolves: #26606
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Traditionally, all issues found in udev rules by udev_rules_parse_file()
are logged and ignored, so there was no mechanism to propagate the
information about these issues back to the caller.
Introduce such a mechanism by adding a new member to UdevRuleFile.
This new member is a bitmask describing which log levels were used
in messages logged with regards to the rule file.
This mechanism is going to be used by udevadm verify in subsequent
commits.
|
|
|
|
|
|
|
|
|
|
|
| |
Tablets don't typically have relative coordinates (they are separated on
the kernel device layer). However, some Logitech mice report similar
supported events, so use the existence of EV_REL to determiner whether or
not the device is really a tablet.
Fixes bug introduced by 0855ce67726f87a5a67b4fb536d58e0e4428a248.
Fixes: #26600
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting with commit ed88bcfb7c15029f9fc95ee2380759a9eb782d46,
udev_rules_parse_file() silently skips files it fails to open with
ENOENT error, e.g. when they are broken symlinks. As this behavior is
undocumented and it seems to be unintended, let's treat ENOENT like any
other error. This change would also simplify the implementation of the
udev rules syntax checker mentioned in #26606.
udev_rules_load(), the only user of udev_rules_parse_file(), is not
affected by this change because it essentially ignores the value
returned by the latter, the only visible difference would be a log
message issued for every udev rules file that couldn't be open because
of ENOENT.
Fixes: ed88bcfb7c15 ("Be more careful when checking for empty files")
|
| |
|
|\
| |
| | |
meson: Use dicts for test/fuzzer definitions
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Although this slightly more verbose it makes it much easier to reason
about. The code that produces the tests heavily benefits from this.
Test lists are also now sorted by test name.
|
|/ |
|
|
|
|
|
| |
No functional change, as currently the function is always called with
non-NULL argument. Just a preparation for #26048 or #25839.
|
|
|
|
|
|
|
|
|
| |
The priority of device node symlink can be negative. So the
initialization is confusing.
Fortunately, this changes no functionality, as we only compare the
priorities of symlinks only when we parsed at least one device node and
its priority.
|
| |
|
|
|
|
| |
No functional changes, just refactoring.
|
|
|
|
|
|
|
|
|
| |
This effectively reverts commit ff86c92e3043f71fc801cf687600a480ee8f6778,
and re-apply 49f3ee7e74c714f55aab395c080b1099fc17f7fd.
The change was dropped due to the process name was not correctly logged,
but the issue was fixed by dd15e4cb57129b915e01495e113696bfe0b70214.
Let's set the child process name again.
|
|
|
|
|
|
|
|
|
|
| |
(The one case that is left unchanged is '< <(subcommand)'.)
This way, the style with no gap was already dominant. This way, the reader
immediately knows that ' < ' is a comparison operator and ' << ' is a shift.
In a few cases, replace custom EOF replacement by just EOF. There is no point
in using someting like "_EOL" unless "EOF" appears in the text.
|
|
|
|
|
|
| |
Fixes a bug introduced by 78463c6c4fdcb703bc0dc694c3ea77df3c5624e0.
Fixes #25545.
|
|\
| |
| | |
Various fixups to recent commits
|
| |
| |
| |
| | |
https://github.com/systemd/systemd/pull/25145#issuecomment-1397606521
|
|/
|
|
|
|
| |
Meson+ninja+compiler do this for us and are better at it.
https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
|