Commit Graph

74 Commits

Author SHA1 Message Date
Boian Bonev
dce2732c37
Fix warnings 2022-04-06 06:55:28 +03:00
Boian Bonev
d27c310316
Fix spelling 2022-04-06 03:47:40 +03:00
Jesse Smith
d16f9d5ff5 Permit eudev to work with rules which include escaped double-quotes
- Adjust parsing function to understand escaped double-quotes in rules.
- Added new test to udev-test.pl to confirm escaped quotes work.
- Bring eudev up to date with systemd pull request $6890.

This commit resolves GitHub issue #187.

This is a slightly adjusted patch/commit from systemd's udev.
Original upstream commit: 8a247d50abb5315adcc64daea10bc836c9d4c6e0
Provided by Franck Bui (GitHub user fbuihuu)
2021-10-06 08:27:54 -03:00
Ethan Sommer
79f7650b59 switch make usage to be POSIX compatible
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2020-04-22 18:04:20 -04:00
Anthony G. Basile
f5e3aea95b Include <sys/sysmacros.h> to build under glibc-2.25
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2017-10-21 18:08:22 -04:00
Robby Workman
26b8f53163 Remove obsolete udev_root references
This was removed in 6ada823a9a
2015-11-15 15:11:13 -06:00
Anthony G. Basile
5ad9610b49 test: test only udev and libudev. 2015-04-14 19:31:08 -04:00
Anthony G. Basile
206d05759f test-libudev.c: remove deprecated functions. 2015-04-12 12:21:07 -04:00
David Cortarello
6a398265f3 Remove hardcoded path /run and configure using --with-rootrundir=
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-27 11:34:13 -04:00
Tom Gundersen
0199ac5afb libudev: private - introduce udev_device_new_from_synthetic_event()
This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18 21:34:18 -04:00
Anthony G. Basile
79bf63bcff src/udev/udev-builtin-kmod.c: remove the modprobe alt to kmod code 2015-02-11 18:06:47 -05:00
Tom Gundersen
54c92293a6 shared: utf8 - support decoding the full utf16
We originally only supported the BMP (i.e., we treated UTF-16 as UCS-2).

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-29 12:22:28 -05:00
Anthony G. Basile
d3ef837153 src/udev: update the definition of udev_event_execute_rule
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-16 08:44:52 -05:00
Kay Sievers
5fe138cdda udev: move global property handling from libudev to udevd
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14 20:53:59 -05:00
WaLyong Cho
596470312a mac: rename apis with mac_{selinux/smack}_ prefix
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25 13:53:41 -04:00
Tom Gundersen
d7447bb0ba test: udev - restrict nemuric uid's to existing ones
We now verify the existence of uid's before applying them to devicenodes, so change the
test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-24 18:55:46 -04:00
Tom Gundersen
39f24db770 libudev: util - drop util_delete_path()
Use rmdir_parents() from src/shared instead.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17 20:10:42 -04:00
Tom Gundersen
7ac0491cdb udev: timeout - warn after a third of the timeout before killing
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-13 08:52:01 -04:00
Anthony G. Basile
bdba4ea0e6 src/scsi_id/Makefile.am,test/Makefile.am: fix build on debian jessie, issue #97
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-18 16:05:43 -04:00
Lennart Poettering
c597413eb3 udev: never bypass our own logging framework and call vsyslog() directly from udev tools
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-12 14:14:22 -04:00
Anthony G. Basile
d97aec9c40 src/libudev/libudev.sym: mark most symbols as hidden
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-06 09:18:11 -04:00
Anthony G. Basile
b1ac60946d src/shared: refactor shared code
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 19:22:24 -04:00
Anthony G. Basile
e35ef44ebe test: use _cleanup_ attribute
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 10:46:11 -04:00
Zbigniew Jędrzejewski-Szmek
d8808bc082 Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.

When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.

Also, simplify things here and there.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05 08:38:32 -04:00
Kay Sievers
471a5f3411 udev: unify event timeout handling
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30 09:31:38 -04:00
Kay Sievers
db992ba3a7 udev: do not skip the execution of RUN when renaming a network device fails
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-15 17:25:25 -04:00
Kay Sievers
2500dbc810 udev: remove seqnum API and all assumptions about seqnums
The way the kernel namespaces have been implemented breaks assumptions
udev made regarding uevent sequence numbers. Creating devices in a
namespace "steals" uevents and its sequence numbers from the host. It
confuses the "udevadmin settle" logic, which might block until util a
timeout is reached, even when no uevent is pending.

Remove any assumptions about sequence numbers and deprecate libudev's
API exposing these numbers; none of that can reliably be used anymore
when namespaces are involved.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24 15:40:08 -04:00
Greg KH
8fe0351586 use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set).  So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-02 07:15:23 -05:00
Anthony G. Basile
819e122c90 test/test-udev.c: bring in line with upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 18:43:13 -05:00
Anthony G. Basile
0df9dcf039 test/test-libudev.c: bring into line with upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 17:53:17 -05:00
Anthony G. Basile
106c2979b6 test/test-device-nodes.c: bring in line with upstream
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 17:46:26 -05:00
Thomas Hindoe Paaboel Andersen
079a9c8229 Add more _printf_'s for format-nonliterals
Clang is a bit more strict wrt format-nonliterals:
http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking

Adding these extra printf attributes also makes gcc able to find more
problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c

Some parts looked intetional about breaking the format-nonliteral check.
I added some supression for warnings there.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 16:42:19 -05:00
Dave Reisner
855ce449eb device-nodes: move device node specific code to own file
In the process, rename udev_encode_string which is poorly named
for what it does. It deals specifically with encoding names that
udev creates and has its own rules: utf8 is valid but some ascii
is not  (e.g. path separators), and everything else is simply escaped.
Rename it to encode_devnode_name.

Adopted for eudev: Anthony G. Basile <blueness@gentoo.org>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 14:02:56 -05:00
Dave Reisner
7ed87c74df move utf8 functions from libudev-private.h to utf8.h
There's now some more obvious overlap amongst the two
utf8 validation functions, but no more than there already
was previously. This also adds some menial tests for anyone
who wants to do more merging of  these two in the future.

Adopted for eudev: Anthony G. Basile <blueness@gentoo.org>

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09 12:21:20 -05:00
Anthony G. Basile
15b5151867 test/test-libudev.c: minor change to match upstream 2013-09-10 05:36:39 -04:00
Anthony G. Basile
faa1ff8ef8 Import strxcpyx from upstream
This commit imports strxcpyx from upstream.  This is upstream commit

    d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d

Note: there were also some very minor code cleanups to

	accelerometer.c: line 187
	collect.c: lines 35, 140
	libudev-device.c: line 780
	libudev-hwdb.c: line 300

These are part of upstream commits:

	507f22bd0172bff5e5d98145b1419bd472a2c57f
	3cf7b686e6b29f78de0af5929602cae4482f6d49
	67410e9f73a6cdd8453c78b966451b5151def14a

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07 11:16:55 -04:00
Anthony G. Basile
44e6f1bc1a test: improve test-udev.c
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-06 23:13:39 -04:00
Anthony G. Basile
80000b8639 test/udev-test.pl: fix a spelling error 2013-06-03 09:42:36 -04:00
Sami Kerola
9c00864f98 licence: remove references to old FSF address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02 10:30:02 -04:00
Anthony G. Basile
0342e13a32 Fix test-udev.c to build and work on a uclibc system
Two issues are addressed: 1) Makefile.am has to provide config.h
information on HAVE_UNSHARE to test-udev.c.  2) MS_PRIVATE and
MS_REC are defined in <linux/fs.h> which must be directly included
on a uclibc system because of different header stackings.  Its
inclusion makes no difference on a glibc system.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-01-22 14:29:53 -05:00
Nick Vinson
3d2fa99001 Replace unused DISTCLEAN_LOCAL_HOOKS and correct path in test/Makefile.am
The DISTCLEAN_LOCAL_HOOKS variable is not used by automake when generating
Makefiles.  This has been replaced with the clean-local target which does get
used.  The clean-local target is defined to be dependent on the
test-sys-distclean target as recommended in the automake manual.

The paths in test-sys-distclean have been corrected to ensure that test/sys is
deleted during 'make distcheck'.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-26 23:52:18 -05:00
Anthony G. Basile
73e31d7ae7 Fix paths: test/udev-test.pl now works under sudo make distcheck
We move the test-udev.c and test-libudev.c from src/test to test.
This corrects the a problem with hard coded relative paths finding
the test/test/sys directory created by test/udev-test.pl.

This commit draws heavily from nvinson patch in

 https://github.com/gentoo/eudev/pull/20

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-24 23:47:06 -05:00
Anthony G. Basile
bcc69ef934 Reintroduce keymaps build and test
This commit reintroduces code to

 1) build src/keymap
 2) test keymap/Makefile.am that it has all the key maps listed
 3) test that all the key names in keymap/* are in <linux/input.h>
 4) do a syntax check on rules/*.rules which now includes
    95-keymap.rules and 95-keyboard-force-release.rules

For #4, the regex expressions in rule-syntax-check.py had to be
updated.  They do not allow trailing comments via # comment, and
I did not include that.  A rule in 95-keymap.rules had to have its
comment moved from the end to another line.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-20 14:44:47 -05:00
Anthony G. Basile
802d021d2e test/Makefile.am: fix tests for make distcheck
At several points in the forked code, top_srcdir and top_builddir
are mixed up.  It is not clear if this is an upstream bug or if this
is a result of the initial restructuring of the build system.  This
commit addresses this issue for tests triggered during make distcheck.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-19 19:09:48 -05:00
Anthony G. Basile
c47f33a498 Second step of revamping the build system
The original Makefile.am was drawn to the top level.  This commit
breaks it out into the various directories with SUBDIRS connecting
them.  This makes each directory easier to maintain.
2012-11-15 20:18:22 -05:00
Anthony G. Basile
7d4a62f8c1 Isolation of udev code from remaining systemd
This commit is a first attempt to isolate the udev code from the
remaining code base.  It intentionally does not modify any files
but purely delete files which, on a first examination, appear to
not be needed.  This is a sweeping commit which may easily have
missed needed code.  Files can be retrieved by doing a checkout
from the previous commit:

 git checkout 2944f347d0 -- <filename>
2012-11-15 10:33:16 -05:00
Kay Sievers
1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Kay Sievers
5488ac8c3a udev: fix rule-syntax-check.py 2012-10-09 00:49:15 +02:00
Kay Sievers
8a1733871f udev: remove SYMLINK "unique" option 2012-10-08 21:54:39 +02:00
Lennart Poettering
71dc3ed1d9 test: split of cryptsetup into its own test 2012-09-13 23:19:05 +02:00