summaryrefslogtreecommitdiffstats
path: root/src/udev (follow)
Commit message (Collapse)AuthorAgeFilesLines
* include sys/sysmacros.h in more placesMike Frysinger2016-03-151-0/+1
| | | | | | Since glibc is moving away from implicitly including sys/sysmacros.h all the time via sys/types.h, include the header directly in more places. This seems to cover most makedev/major/minor usage.
* selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek2016-03-022-2/+2
| | | | | https://github.com/systemd/systemd/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
* tree-wide: minor formatting inconsistency cleanupsVito Caputo2016-02-234-4/+4
|
* Merge pull request #2701 from keszybz/udev-rulesLennart Poettering2016-02-221-3/+3
|\ | | | | udev-rules cleanup fix
| * udev-rules: fix querying of attributesZbigniew Jędrzejewski-Szmek2016-02-221-3/+3
| | | | | | | | | | | | faccessat returns 0 on success. A cosmetic fix is also included: the slash was doubled unnecessarily.
* | Merge pull request #2685 from poettering/lldp-fixes2Tom Gundersen2016-02-227-14/+14
|\ \ | |/ |/| lldp fixes, second iteration
| * tree-wide: place #pragma once at the same place everywhereLennart Poettering2016-02-207-14/+14
| | | | | | | | | | | | Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
* | udev-rules: use _cleanup_ for fcloseZbigniew Jędrzejewski-Szmek2016-02-211-21/+14
| |
* | udev-rules: make error messages about rules more uniformZbigniew Jędrzejewski-Szmek2016-02-211-203/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also downgrade non-fatal warnings to log_warning. Previously rule_add_key() would check the output array and log a cryptic error and return -1. Most of the time the return value was ignored. This does not seems right, because the buffer can overflow with enough rules. It would also check if we have enough space for the *next* rule, even if there might be not next rule, i.e. off-by-one. Replace this with a check that we have enough space for a next rule before we start parsing. Normally using macros to alter flow is not allowed, but in this case I think it is worth it, because it allows lots of boilerplate code to be removed and hides repeated boring parameters, making function logic much easier to follow.
* | udev-rules: rewrite function to avoid clobbering argumentsZbigniew Jędrzejewski-Szmek2016-02-211-29/+20
| | | | | | | | | | | | | | If the attribute wasn't found, the last filename looked at was returned in the input/output argument. This just seems bad style. The return value was ignored, so change function to return void.
* | udev-rules: modernize syntax a bitZbigniew Jędrzejewski-Szmek2016-02-211-119/+54
| |
* | udev-rules: log_oom() on memory error and abort processing of eventZbigniew Jędrzejewski-Szmek2016-02-212-15/+17
|/ | | | | | CID #1313566. Also, change the return value to void, because it is ignored anyway.
* udev/path_id: correct segmentation fault due to missing NULL checkHendrik Brueckner2016-02-191-1/+1
| | | | | | | | Running "udevadm test-builtin path_id /sys/devices/platform/" results in a segmentation fault. The problem is that udev_device_get_subsystem(dev) might return NULL in a streq() call. Solve this problem by using streq_ptr() instead.
* Remove/add (un)needed includesNathan McSween2016-02-191-1/+0
|
* udev: fix cg_unified() return code checkingLennart Poettering2016-02-161-1/+1
| | | | | | Fixes fall-out from 8b3aa503c171acdb9ec63484a8c50e2680d31e79. Fixes: #2635
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-1039-78/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* path_id: reintroduce by-path links for virtio block devicesMichal Sekletar2016-02-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | Enumeration of virtio buses is global and hence non-deterministic. However, we are guaranteed there is never going to be more than one virtio bus per parent PCI device. While populating ID_PATH we simply skip virtio part of the syspath and we extend the path using the sysname of the parent PCI device. With this patch udev creates following by-path links for virtio-blk device /dev/vda which contains two partitions. ls -l /dev/disk/by-path/ total 0 lrwxrwxrwx 1 root root 9 Feb 9 10:47 virtio-pci-0000:00:05.0 -> ../../vda lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part1 -> ../../vda1 lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part2 -> ../../vda2 See: http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030328.html Fixes #2501
* udev: net_id - for ccw bus, shorten the identifier and stip leading zerosDimitri John Ledkov2016-01-291-2/+9
| | | | | | | | | | | | | | The commmon case default qeth link is enccw0.0.0600 is rather long. Thus strip leading zeros (which doesn't make the bus_id unstable), similar to the PCI domain case. Also 'ccw' is redundant on S/390, as there aren't really other buses available which could have qeth driver interfaces. Not sure why this code is even compiled on non-s390[x] platforms. But to distinguish from e.g. MAC stable names shorten the suffix to just 'c'. Thus enccw0.0.0600 becomes enc600.
* udev: filter out non-sensically high onboard indexes reported by the kernelLennart Poettering2016-01-251-0/+9
| | | | | | Let's not accept onboard interface indexes, that are so high that they are obviously non-sensical. Fixes: #2407
* udevd: do not clean up fds in mainZbigniew Jędrzejewski-Szmek2016-01-231-1/+1
| | | | | | | | | fds will also be closed during manager cleanup in run, leading to an error when we try to close them again. It is now possible to "leak" the fds on error, but it's an unlikely event and we will exit immediately anyway. Fixes #2418.
* udevd: initialize fds to -1 and close them before exitingZbigniew Jędrzejewski-Szmek2016-01-181-1/+2
| | | | | | | Little change in practice, because the program will exit soon afterwards, but the standard style of closing all fds is now followed. Also gets rid of gcc warning about fd_ctrl and fd_uevent being unitialized.
* tree-wide: check if errno is greater then zeroZbigniew Jędrzejewski-Szmek2016-01-131-1/+1
| | | | | | | | | | | | | | gcc is confused by the common idiom of return errno ? -errno : -ESOMETHING and thinks a positive value may be returned. Replace this condition with errno > 0 to help gcc and avoid many spurious warnings. I filed a gcc rfe a long time ago, but it hard to say if it will ever be implemented [1]. Both conventions were used in the codebase, this change makes things more consistent. This is a follow up to bcb161b0230f. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61846
* tree-wide: use xsprintf() where applicableDaniel Mack2016-01-125-19/+27
| | | | Also add a coccinelle receipt to help with such transitions.
* udev: Fix touch screen detectionAndreas Pokorny2016-01-011-2/+2
| | | | | | Use BTN_TOUCH or INPUT_PROP_DIRECT to detect touch screens. Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
* Merge pull request #2110 from keszybz/udev-indentationDaniel Mack2015-12-0934-69/+135
|\ | | | | Udev indentation
| * udev/scsi_id: fix some strange indentationZbigniew Jędrzejewski-Szmek2015-12-072-69/+68
| |
| * udev: add emacs header lineZbigniew Jędrzejewski-Szmek2015-12-0734-0/+67
| | | | | | | | | | Otherwise emacs wants to use 2-space indentation and other attrocities.
* | udev: fix NULL deref when executing rulesZbigniew Jędrzejewski-Szmek2015-12-071-4/+4
|/ | | | | | | | We quite obviously check whether event->dev_db is nonnull, and right after that call a function which asserts the same. Move the call under the same if. https://bugzilla.redhat.com/show_bug.cgi?id=1283971
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-273-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
* Merge pull request #1926 from phomes/include-order-libudevDaniel Mack2015-11-174-4/+8
|\ | | | | tree-wide: group include of libudev.h with sd-*
| * tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen2015-11-174-4/+8
| |
* | tree-wide: use right cast macros for UIDs, GIDs and PIDsLennart Poettering2015-11-171-4/+4
|/
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-1613-44/+41
| | | | Sort the includes accoding to the new coding style.
* siphash24: change result argument to uint64_tMartin Pitt2015-11-161-3/+3
| | | | | | | | | | | | Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which enforce pointer alignment this fixes crashes when we previously cast an unaligned array to uint64_t*, and on others this should at least improve performance as the compiler now aligns these properly. This also simplifies the code in most cases by getting rid of typecasts. The only place which we can't change is struct duid's en.id, as that is _packed_ and public API, so we can't enforce alignment of the "id" field and have to use memcpy instead.
* udev/path_id: improve and enhance bus detection for Linux on z SystemsLiu Yuan Yuan2015-11-131-27/+30
| | | | | | | | | | | | | | | | | | | | | Improve and enhance the path_id udev builtin to correctly handle bus' available on Linux on z Systems (s390). Previously, the CCW bus and, in particular, any FCP devices on it, have been treated separately. This commit integrates the CCW bus into the device chain loop. FCP devices and their associated SCSI disks are now handled through the common SCSI handling functions in path_id. This implies also a change in the naming of the symbolic links created by udev. So any backports of this commit to existing Linux distribution must be done with care. If a backport is required, a udev rule must be created to also create the "old-style" symbolic links. Apart from the CCW bus, this commit adds bus support for the: - ccwgroup bus which manages network devices, and - ap bus which manages cryptographic adapters - iucv bus which manages IUCV devices on z/VM
* Merge pull request #1820 from michich/errno-v2Daniel Mack2015-11-094-7/+4
|\ | | | | [v2] treewide: treatment of errno and other cleanups
| * treewide: apply errno.cocciMichal Schmidt2015-11-092-5/+2
| | | | | | | | with small manual cleanups for style.
| * treewide: use the negative error codes returned by our functionsMichal Schmidt2015-11-052-2/+2
| | | | | | | | | | Our functions return negative error codes. Do not rely on errno being set after calling our own functions.
* | doc: correct orthography, word forms and missing/extraneous wordsJan Engelhardt2015-11-061-4/+4
|/
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-2712-1/+13
|
* util-lib: split out globbing related calls into glob-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out printf() helpers to stdio-util.hLennart Poettering2015-10-271-0/+1
|
* socket-util: move CMSG_FOREACH() from macro.h to socket-util.hLennart Poettering2015-10-271-0/+1
|
* user-util: move UID/GID related macros from macro.h to user-util.hLennart Poettering2015-10-271-0/+1
|
* util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]Lennart Poettering2015-10-272-0/+2
|
* util-lib: move string table stuff into its own string-table.[ch]Lennart Poettering2015-10-272-4/+5
|
* util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]Lennart Poettering2015-10-272-0/+2
|
* util-lib: move a number of fs operations into fs-util.[ch]Lennart Poettering2015-10-273-0/+3
|
* util-lib: move more file I/O related calls into fileio.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-274-0/+4
|