summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Add abstraction model for BPF programsDaniel Mack2017-11-20
| | | | | This object takes a number of bpf_insn members and wraps them together with the in-kernel reference id. Will be needed by the firewall code.
* in-addr-util: add new helper call in_addr_prefix_from_string_auto()Lennart Poettering2017-11-20
| | | | | | This is much like in_addr_prefix_from_string(), but automatically determines whether IPv4 or IPv6 addresses are specified. Also adds a test for it.
* manager: watching the cgroup2 inotify fd is safe in test runs tooLennart Poettering2017-11-20
| | | | | Less deviation between test runs and normal runs is always a good idea, hence enable more stuff that is safe in test runs
* cgroup: always invalidate "cpu" and "cpuacct" togetherLennart Poettering2017-09-05
| | | | | | | This doesn't really matter, as we never invalidate cpuacct explicitly, and there's no real reason to care for it explicitly, however it's prettier if we always treat cpu and cpuacct as belonging together, the same way we conisder "io" and "blkio" to belong together.
* cgroup-util: minor coding style adjustmentLennart Poettering2017-09-04
|
* v235: Added missing updatesSven Eden2017-11-19
|
* Prep v235: Added cap-list, which is needed now.Sven Eden2017-11-19
|
* fileio: return 0 from read_one_line_file on successZbigniew Jędrzejewski-Szmek2017-09-24
| | | | Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
* test-conf-parser: add tests for the new long lines, including overflow handlingZbigniew Jędrzejewski-Szmek2017-09-25
|
* test-conf-parser: use _cleanup_Zbigniew Jędrzejewski-Szmek2017-09-21
|
* fileio: use _cleanup_ for FILE unlockingZbigniew Jędrzejewski-Szmek2017-09-25
|
* conf-parse: remove 4K line length limitLennart Poettering2017-09-22
| | | | | | Let's use read_line() to solve our long line limitation. Fixes #3302.
* test-conf-parser: add some basic tests for config_parse()Zbigniew Jędrzejewski-Szmek2017-09-25
| | | | | | | This function is pretty important, but we weren't calling it directly even once in tests. v2: add a few tests for escaping and line continuations
* fileio: initialize errno to zero before we do fread()Lennart Poettering2017-09-22
| | | | | if there was something in the read buffer already errno might not be set on error, let's detect that case.
* fileio: try to read one byte too much in read_full_stream()Lennart Poettering2017-09-22
| | | | | | | | Let's read one byte more than the file size we read from stat() on the first fread() invocation. That way, the first read() will already be short and indicate eof to fread(). This is a minor optimization, and replaces #3908.
* fileio: move fsync() logic into write_string_stream_ts()Lennart Poettering2017-09-22
| | | | | | That way, write_string_stream_ts() becomes more powerful, and we can remove duplicate code from write_string_file_atomic() and write_string_file_ts().
* fileio: make write_string_stream() accept flags parameterLennart Poettering2017-09-22
| | | | | | Let's make write_string_stream() and write_string_file() more alike, and pass the same flag set so that we can remove a number of boolean parameters.
* fileio: support writing atomic files with timestampLennart Poettering2017-09-22
| | | | | Let's make sure "ts" is taken into account when writing atomic files, too.
* cgroup-util: replace one use of fgets() by read_line()Lennart Poettering2017-09-25
|
* fileio: rework read_one_line_file() on top of read_line()Lennart Poettering2017-09-25
|
* def: add new constant LONG_LINE_MAXLennart Poettering2017-09-22
| | | | | | | | LONG_LINE_MAX is much like LINE_MAX, but longer. As it turns out LINE_MAX at 4096 is too short for many usecases. Since the general concept of having a common maximum line length limit makes sense let's add our own, and make it larger (1MB for now).
* fileio: add new helper call read_line() as bounded getline() replacementLennart Poettering2017-09-25
| | | | | | | read_line() is much like getline(), and returns a line read from a FILE*, of arbitrary sizes. In contrast to gets() it will grow the buffer dynamically, and in contrast to getline() it will place a user-specified boundary on the line.
* cgroup: rework which files we chown() on delegationLennart Poettering2017-09-22
| | | | | | | | | | | | | | | | On cgroupsv2 we should also chown()/chmod() the subtree_control file, so that children can use controllers the way they like. On cgroupsv1 we should also chown()/chmod() cgroups.clone_children, as not setting this for new cgroups makes little sense, and hence delegated clients should be able to write to it. Note that error handling for both cases is different. subtree_control matters so we check for errors, but the clone_children/tasks stuff doesn't really, as it's legacy stuff. Hence we only log errors and proceed. Fixes: #6216
* cgroup-util: downgrade log messages from library code to LOG_DEBUGLennart Poettering2017-09-25
| | | | | | | These errors don't really matter, that's why we log and proceed in the current code. However, we currently log at LOG_WARNING, but we really shouldn't given that this is library code. Hence downgrade this to LOG_DEBUG.
* time-util: mktime_or_timegm are changing the struct tmMarcel Hollerbach2017-09-20
| | | | | after that wm_day etc. seems to be changed. Moving the check infront of the mktime_or_timegm fixes that.
* time-util: correctly handle the timezone when parsingMarcel Hollerbach2017-09-20
| | | | | | | | | | The timezone was cut off the string once the timezone was not UTC. If it is not UTC but a other timezone that matches tzname[0] or tzname[1], then we can leave it to the impl function to parse that correctly. If not we can just fallback to whatever is the current timezone is in the given t_timezone. This should fix the testuite and tests.
* Link to the right glibc commit in comment (#6884)Zbigniew Jędrzejewski-Szmek2017-09-21
| | | | | | Reported by Marcos Mello. Fixes #6882.
* time-util: fix shadowing of timezoneMarcel Hollerbach2017-09-19
| | | | | timezone was shadowing timezone from time.h which leads to a buildbreak since elogind is built with -Werror
* Make test_run into a flags field and disable generators againZbigniew Jędrzejewski-Szmek2017-09-25
| | | | | | | | | | Now generators are only run in elogind --test mode, where this makes most sense (how are you going to test what would happen otherwise?). Fixes #6842. v2: - rename test_run to test_run_flags
* tests: change dbus tests to use user bus (#6845)Michael Biebl2017-09-19
| | | | | | This makes it possible to run more dbus tests in a build environment/chroot where no system bus is available. To run the dbus test one then can use dbus-run-session.
* test-exec-util: add two test cases for scripts masked with empty fileZbigniew Jędrzejewski-Szmek2017-09-17
| | | | | | A test for #6831. Fails without the previous commit. Suggested by Evgeny Vereshchagin.
* conf-files: fix check for masking with empty filesZbigniew Jędrzejewski-Szmek2017-09-17
| | | | Fixes #6831.
* sd-bus: style nitpick node_vtable_get_userdata()Alan Jenkins2017-09-16
| | | | | | | | | It's confusing to use a single void* to store data with two different types, i.e. a userdata value which is safe to pass to ->find(), and a userdata value which identifies the found object. Name the latter `found_u`. This naming treats (!c->find) as a degenerate case. (I.e. at that point, we know the object has already been found :).
* sd-bus: fix response for GetAll on non-existent objectsAlan Jenkins2017-09-16
| | | | | | | | | | | | | | | | | | | | Before this commit, if you run `loginctl user-status` from debug-shell.service (and you have no login sessions for root), you always see this output: 0 Linger: no because Properties.GetAll is returning success but without any properties, when the only find() callback had returned 0 to mean "no object found". After: Could not get properties: Unknown object: '/org/freedesktop/login1/user/self' BTW I have a fix for more user-friendly messages from logind in this case. It is pending in my local branch for #6829 "fix `loginctl enable-linger`".
* Fix for dst/non-dst timezonesIvan Kurnosov2017-09-17
| | | | | | | | | The problem was with the tm.tm_isdst that is set to the current environment value: either DST or not. While the current state is not relevant to the state in the desired date. Hence — it should be reset so that the mktime_or_timegm could normalise it later.
* Simplify the if cases for timezone checkingZbigniew Jędrzejewski-Szmek2017-09-17
| | | | Just to reduce the indentation a bit.
* Added timezone to the CalendarSpec, parser/formatter and the timedatectlIvan Kurnosov2017-09-25
|
* core: add new per-unit setting KeyringMode= for controlling kernel keyring setupLennart Poettering2017-09-14
| | | | | | | | | | | | | | | Usually, it's a good thing that we isolate the kernel session keyring for the various services and disconnect them from the user keyring. However, in case of the cryptsetup key caching we actually want that multiple instances of the cryptsetup service can share the keys in the root user's user keyring, hence we need to be able to disable this logic for them. This adds KeyringMode=inherit|private|shared: inherit: don't do any keyring magic (this is the default in elogind --user) private: a private keyring as before (default in elogind --system) shared: the new setting
* networkd: add support to configure IP Rule (#5725)Susant Sahani2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Routing Policy rule manipulates rules in the routing policy database control the route selection algorithm. This work supports to configure Rule ``` [RoutingPolicyRule] TypeOfService=0x08 Table=7 From= 192.168.100.18 ``` ``` ip rule show 0: from all lookup local 0: from 192.168.100.18 tos 0x08 lookup 7 ``` V2 changes: 1. Added logic to handle duplicate rules. 2. If rules are changed or deleted and networkd restarted then those are deleted when networkd restarts next time V3: 1. Add parse_fwmark_fwmask
* conf-parser: when the empty string assigned to Personality= reset itLennart Poettering2017-09-14
| | | | | Let's support assigning the empty string to reset things in one more place.
* core: don't synthesize empty list when empty string is read in ↵Lennart Poettering2017-09-14
| | | | | | | | | config_parse_strv() This was added to make https://bugs.freedesktop.org/show_bug.cgi?id=62558 work, which has long been removed, hence let's revert to the original behaviour and fully flush out the list when an empty string is assigned.
* nss: use secure_getenv for behaviour-modifying booleans (#6817)Zbigniew Jędrzejewski-Szmek2017-09-14
| | | | Follow up for fe102d6ab15731a199a7ea9f38c4f68d8959f86c.
* basic: ensure O_TMPFILE is always defined (#6816)Davide Cavalca2017-09-14
|
* sd-bus: extend D-Bus authentication timeout considerably (#6813)Lennart Poettering2017-09-13
| | | | | | | | | | | | | | As it turns out the authentication phase times out too often than is good, mostly due to PRNG pools not being populated during boot. Hence, let's increase the authentication timeout from 25s to 90s, to cover for that. (Note that we leave the D-Bus method call timeout at 25s, matching the reference implementation's value. And if the auth phase managed to complete then the pools should be populated enough and mehtod calls shouldn't take needlessly long anymore). Fixes: #6418
* util: make get_block_device() availableFranck Bui2017-09-25
|
* conf-files: log when we skip a drop-in configuration fileLennart Poettering2017-09-13
|
* exec-util,conf-files: skip non-executable files in execute_directories()Lennart Poettering2017-09-25
| | | | Fixes: #6787
* pager: let's create pager fds with O_CLOEXEC firstLennart Poettering2017-09-13
| | | | | | | | We make copies (without O_CLOEXEC) of the fds anyway before using them, hence let's be safe and create them with O_CLOEXEC first, so that we don't run into issues should pager_open() be called in a threaded environment where another thread fork()s at the wrong time and ends up with fds not marked O_CLOEXEC.
* systemctl: don't do ANSI underlining on TERM=linux (#6778)Lennart Poettering2017-09-09
| | | | | | | The linux console apparently can't do underlining, hence let's not do it on the console. Also see: #6601
* util-lib: wrap personality() to fix up broken glibc error handling (#6766)Lennart Poettering2017-09-08
| | | | | | | | | glibc appears to propagate different errors in different ways, let's fix this up, so that our own code doesn't get confused by this. See #6752 + #6737 for details. Fixes: #6755