summaryrefslogtreecommitdiff
path: root/src/udev/udev-ctrl.c
AgeCommit message (Collapse)Author
2015-01-25Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
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>
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno(). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src: minor code cleanupAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: fix typosTom Gundersen
Spotted by Andreas Henriksson. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: ctrl - log if setting SO_PASSCRED failsTom Gundersen
No functional change. Found by Coverity. Fixes CID #1237533. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udev: place opening { at the same line as the function declarationKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-04-24udev: remove seqnum API and all assumptions about seqnumsKay Sievers
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-02-21make gcc shut upLennart Poettering
If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-21everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-02use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH
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-01-13src/udev: bring up to date with upstream.Anthony G. Basile
These commits were authored by Zbigniew Jędrzejewski-Szmek Tom Gundersen Kay Sievers Lennart Poettering Shawn Landden Daniel Buch Martin Pitt Karel Zak Yang Zhiyong Note: udev_builtin_net_setup_link has *not* been imported. Also still missing from udev-builtin is udev_builtin_uaccess. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09udev: use initialization instead of zeroing in one placeZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09udev: declare some symbols staticKay Sievers
2013-08-16fix usage of glibc-specific sys/poll.hrofl0r
sys/poll.h is a legacy alias used by glibc. according to POSIX #include <poll.h> is correct. on GLIBC, the POSIX header includes sys/poll.h, so everything continues working as it should. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-10src/udev/udev-ctrl.c: explicitly declare return valueAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-07-07Import strxcpyx from upstreamAnthony G. Basile
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-06-29src/udev/udev-ctrl.c: restore accept4_fallback codeAnthony G. Basile
This code was accidentally removed in commit 601c4e8ce69338652b3c9178386cbc05de8bae8d We restore it here. Since most modern systems have accept4() this code will seldom be triggered. You can test by configuring as follows: ac_cv_have_decl_accept4="no" ./configure Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-06-02udev/udev-ctrl.c:udev_ctrl_new_from_fd() enable SO_PASSCREDHarald Hoyer
Avoid "sender uid=65534, message ignored" case, where no credentials can be read on the sender side. Seems, the server socket does not enable credential receiving fast enough, and the message from the client (without credential) sometimes is queued before the credential passing was active. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-02udev: updateAnthony G. Basile
This updates the daemon codebase to upstream. Authors: Zbigniew Jędrzejewski-Szmek Lennart Poettering Václav Pavlín Kay Sievers Harald Hoyer Rob Clark Zeeshan Ali (Khattak) See http://cgit.freedesktop.org/systemd/systemd/log/src/udev Ian is signing off but has some concerns on a few of the changes that he may fix in future commits. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2012-12-08Add fallback path when accept4() is not available.Richard Yao
Commit ff2c503df091e6e4e9ab48cdb6df6ec8b7b525d0 introduced accept4() into udev, which broke compatibility with kernels older than Linux 2.6.32 (or Linux 2.6.36 on ARM). The purpose of accept4() is to permit O_NONBLOCK and O_CLOEXEC to be specified at the accept() call site while previously, they had to be set using fcntl() because Linux does not inherit them. Since accept4() increases the minimum kernel version, we add a fallback path for situations in which it is unavailable. Reported-by: Stephen Klimaszewski <steev@gentoo.org> Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-11-12use the same email address everywhereKay Sievers
2012-04-16udev: remove configuration options for /dev, /sys, /run directoriesKay Sievers
2012-04-10udev: fix gcc warnings showing up after adding $(AM_CFLAGS)Kay Sievers
2012-04-08udev: switch to systemd logging functionsKay Sievers
2012-04-04move imported udev into placeKay Sievers