summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
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().
2014-11-28shared: fix log_emergency_errno macroMichal Schmidt
It was not passing the error argument.
2014-11-28update TODOLennart Poettering
2014-11-28kdbus: when running in a container, don't complain that we cannot write to /sysLennart Poettering
2014-11-28log: change log_xyz_errno() calls to always return the negative errorLennart Poettering
This enables us to write things like this: int open_some_file(void) { fd = open("/dev/foobar", O_RDWR|O_CLOEXEC); if (fd < 0) return log_error_errno(errno, "Failed to reboot: %m"); return fd; } Which is function that returns -errno on failure, as well as printing an error message, all in one line.
2014-11-28log: make socket address structs static constLennart Poettering
2014-11-28log: also set errno to the passed error code before processing format string ↵Lennart Poettering
in log_struct() That way the caller may use %m to print the specified error.
2014-11-28core: only override kdbus attach mask when running as PID 1Lennart Poettering
2014-11-28sd-bus: the attach_mask kernel module parameter is 64bit now, hence ↵Lennart Poettering
initialize it as such
2014-11-28log: allow negative errno valuesLennart Poettering
sd_bus_error_set_errno() allows negative errors too, hence, be equally nice.
2014-11-28log: fix order of log_unit_struct() to match other logging callsLennart Poettering
Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
2014-11-28networkd: update logging macros for parameter order, and errno, to match ↵Lennart Poettering
rest of the code
2014-11-28update TODOLennart Poettering
2014-11-28networkd: remove duplicate macro definitionsLennart Poettering
2014-11-28Update TODODavid Herrmann
kdbus eavesdropping was fixed!
2014-11-27sysv-generator: advertise the man pageZbigniew Jędrzejewski-Szmek
2014-11-27man: add systemd-sysv-generator(8)Zbigniew Jędrzejewski-Szmek
In principle SysV stuff is only for compatibility, but we are stuck with it for the forseeable future, so documentation might as well be provided. https://bugs.debian.org/771172
2014-11-27fix build with --enable-terminalThomas Hindoe Paaboel Andersen
Broke with 086891e5c119abb9854237fc32e736fe2d67234c
2014-11-27kmod-setup: simplify kernel command line parsingLennart Poettering
2014-11-27kdbus: set kernel attach mask before creating the first busLennart Poettering
2014-11-27selinux: log selinux log messages with LOG_AUTH facilityLennart Poettering
2014-11-27log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-11-27log: be a bit less wasteful when allocating buffersLennart Poettering
2014-11-27log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m");
2014-11-27sd-bus: set creds info for "org.freedesktop.DBus.Local" generated messages, tooLennart Poettering
2014-11-27sd-bus: when we get the list of well-known names back from kdbus we ↵Lennart Poettering
shouldn't confuse the empty list with unknown information
2014-11-27sd-bus: deal with whitespace in matchesLennart Poettering
2014-11-27sd-bus: unify logic how we patch the message source of driver messagesLennart Poettering
2014-11-27sd-bus: fake valid well-known-names metadata for faked bus messagesLennart Poettering
2014-11-27sd-bus: optimize how we generate the well-known-names lists in messages from ↵Lennart Poettering
kdbus
2014-11-27sd-bus: be stricter with mismatches between dbus1 and kdbus message headersLennart Poettering
2014-11-27bus-proxy: beef up policy enforcementLennart Poettering
- actually return permission errors to clients - use the right ucreds field - fix error paths when we cannot keep track of locally acquired names due to OOM - avoid unnecessary global variables - log when the policy denies access - enforce correct policy rule order - always request all the metadata its we need to make decisions
2014-11-27update TODOLennart Poettering
2014-11-27bus-proxy: check passed parameter signature of all driver method callsLennart Poettering
2014-11-27networkd: fix kernel rtnl receive buffer overrun errorAlin Rauta
We got the following error when running systemd on a device with many ports: "rtnl: kernel receive buffer overrun Event source 'rtnl-receive-message' returned error, disabling: No buffer space available" I think the kernel socket receive buffer queue should be increased. The default value is taken from: "/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF socket option. This is already done in networkd for other sockets. For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB. In our case, the default is 208KB. Increasing the buffer receive queue for manager socket to 512KB should be enough to get rid of the above error. [tomegun: bump the limit even higher to 8M]
2014-11-27resolve: reject empty TXT recordsStanisław Pitucha
TXT records should have at least one character, so enforce this. Before 0f84a72 parser SIGSEGV'd on ->txt.strings being NULL, but even if this is fixed we should reject invalid TXT records.
2014-11-27resolve: set error code on failureStanisław Pitucha
Set the error code in case of incorrect name. This prevents continuing and failing an assert(name) later on.
2014-11-27resolve: fix redirection loops in compressed RRStanisław Pitucha
Loops in RR compression were only detected for the first entry. Multiple redirections should be allowed, each one checking for an infinite loop on its own starting point. Also update the pointer on each redirection to avoid longer loops of labels and redirections, in names like: (start) [len=1] "A", [ptr to start] (David: rename variable to "jump_barrier" and add reference to RFC)
2014-11-27core: fix transaction destructiveness check once moreMichal Schmidt
The previous fix e0312f4db "core: fix check for transaction destructiveness" broke test-engine (noticed by Zbyszek). Apparently I had a wrong idea of the intended semantics of --fail. The manpage says the operation should fail if it "conflicts with a pending job (more specifically: causes an already pending start job to be reversed into a stop job or vice versa)". So let's check job_type_is_conflicting, instead of !is_superset. This makes both test-engine and TEST-03-JOBS pass again.
2014-11-27resolve: fix NULL deref on strv comparisonDavid Herrmann
A strv might be NULL if it is empty. The txt.strings comparison doesn't take that into account. Introduce strv_equal() to provide a proper helper for this and fix resolve to use it. Thanks to Stanisław Pitucha <viraptor@gmail.com> for reporting this!
2014-11-27bus: prefix custom endpoints with "$UID-"David Herrmann
The kdbus module will later get a policy that endpoint-names are restricted to "<uid>-<name>" just like bus-names. Make sure that systemd is already compatible to that.
2014-11-27hwdb: add a new db for the DPI/frequency settings of micePeter Hutterer
Pointer acceleration for relative input devices (mice, trackballs, etc.) applies to the deltas of the device. Alas, those deltas have no physical reference point - a delta of 10 may be caused by a large movement of a low-dpi mouse or by a minute movement of a high-dpi mouse. Which makes pointer acceleration a bit useless and high-dpi devices essentially unusable. In an ideal world, we could read the DPI from the device directly and work with that. In the world we actually live in, we need to compile this list manually. This patch introduces the database, with the usual match formats and a single property to be set on a device: MOUSE_DPI That is either a single value for most mice, or a list of values for mice that can change resolution at runtime. The exact format is detailed in the hwdb file. Note that we're explicitly overshooting the requirements we have for libinput atm. Frequency could be detected in software and we don't actually use the list of multiple resolutions (because we can't detect when they change anyway). However, we might as well collect those values from the get-go, adding/modifying what will eventually amount to hundreds of entries is a bit cumbersome. Note: we rely on the input_id builtin to tag us as mouse first, ordering of the rules is important. (David: fixed up typos and moved hwdb file into ./hwdb/)
2014-11-27unit-name: fix escaping logic in unit_name_mangle_with_suffix()Ivan Shapovalov
Make screened character set consistent with unit_name_mangle() by splitting off the escaping loop into a separate function. Before this fix, unit names such as `foo@bar.target` would get transformed into `foo\x40bar.target` when unit_name_mangle_with_suffix() is used. https://bugs.freedesktop.org/show_bug.cgi?id=86711
2014-11-27coredump: use openatZbigniew Jędrzejewski-Szmek
2014-11-27journalctl: print all possible lines immediately with --follow + --sinceAndrej Manduch
When I tryed to run journalctl with --follow and --since arguments it behaved very strangely. First It prints logs from what I specified in --since argument, then printed 10 lines (as is default in --follow) and when app put something new in to log journalctl printed everithing from the last printed line. How to reproduce: 1. run: journalctl -m --since 14:00 --follow Then you'll see 10 lines of logs since 14:00. After that wait until some app add something in the journal or just run `systemd-cat echo test` 2. After that journalctl will print every single line since 14:00 and will follow as expected. As long as --since and --follow will eventually print all relevant lines, I seen no reason why not to print them right away and not after first new message in journal. Relevant bugzillas: https://bugs.freedesktop.org/show_bug.cgi?id=71546 https://bugs.freedesktop.org/show_bug.cgi?id=64291
2014-11-27coredump: collect all /proc data useful for bug reportingJakub Filak
/proc/[pid]: - status - maps - limits - cgroup - cwd - root - environ - fd/ & fdinfo/ joined in open_fds
2014-11-27util: add function getting proc environJakub Filak
On the contrary of env, the added function returns all characters cescaped, because it improves reproducibility.
2014-11-27networkd: route - allow routes without a gatewayGavin Li
For IPv6, the kernel returns EINVAL if a route is added with the RTA_GATEWAY attribute set to in6addr_any (::). A route without a gateway is useful in some situations, such as layer 3 tunneling (sit, gre, etc.). This patch prevents the RTA_GATEWAY attribute from being added when route.in_addr is ip6addr_any (::).
2014-11-27build-sys: do not install tmpfiles and sysusers files by defaultŁukasz Stelmach