Age | Commit message (Collapse) | Author |
|
We were explicitly eagerly loading the db, then deletenig the backing file and then processing the
rules/symlinks. Instead we delete the backnig db file as the last step and let the db loading be
lazy as everywhere else.
This may save us a bit of work in casese where the db is not needed, but more importantly it hides
some implementation details of libudev-device form udevd.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
To copy properties from one device to another. Drop the equivalent functionality from udevd.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Note: We also ported touch() and touch_file() from upstream. -AGB.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This is not exposed in the public API. We want to simplify the internal libudev-device API as much as possible
so that it will be simpler to rip the whole thing out in the future.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Hide the details a bit.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Don't use recvmsg(2) return value to check for too long packets
(it doesn't work) but MSG_TRUNC flag.
(David: add parantheses around condition)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Types used for pids and uids in various interfaces are unpredictable.
Too bad.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
udev_device_new_from_syspath()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications".
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
FILE * wants cleanup_fclose().
Spotted by udev hwdb segfaulting in gnome-continuous' buildroot
construction.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The term "priority" is misleading because higher levels have lower
priority. "Level" is clearer and shorter.
This commit touches only the textual descriptions, not function and variable
names themselves. "Priority" is used in various command-line switches and
protocol constants, so completly getting rid of "priority" is hard.
I also left "priority" in various places where the clarity suffered
when it was removed.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Invalid log levels lead to a assert failure later on.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This brings udev logging style a bit closer to normal systemd convention.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
If a device does not have a major/minor number attached, we use different
database names than if it does. On "change" events, we didn't copy the
devnum over, therefore, we used different paths than on 'add' or 'remove'
events (where devnum was properly copied).
Fix this by always copying the devnum into the udev-device.
(David: added commit-log from email)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The function still succeeds, so there is no functional change. This fixes CID #996288.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Use rmdir_parents() from src/shared instead.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Use shared versions instead. Difference is with overwriting of repeated user/group
name, and lack of logging.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
This extends the udev parser to support OP_REMOVE (-=) and adds support
for TAG-= to remove previously set tags. We don't fail if the tag didn't
exist.
This is pretty handy if we ship default rules for seat-assignments and
users want to exclude specific devices from that. They can easily add
rules that drop any automatically added "seat" tags again.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
The only remaining user was 'starting version XXX', which is now logged using log_info().
Basile: There were also print_kmsg in udev-event.c which I switched to log_info().
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Those symbols were introduced in commit
14cb733684d3c3f50d088a3a370ddf8e8894dfa4 and released in v215.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
from udev tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
to missing.h
This is a combination of upstream commits
dced15575f7bf172e3c9d798c43477539525558c
7bed7f0e3b1f9596aedb64657e432e5b267adebb
by
Simon McVittie <simon.mcvittie@collabora.co.uk>
7bed7f0e3b1f9596aedb64657e432e5b267adebb
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.
Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.
_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.
Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.
mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint
mbiebl_> which is pretty weird
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
They have different size on 32 bit, so they are really not interchangable.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
If we want to avoid reading a totally empty file, it seems better
to check after we have opened the file, not before.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|