summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAge
* cgroup, unit, fragment parser: make use of new firewall functionsDaniel Mack2017-11-21
|
* 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.
* conf-parse: remove 4K line length limitLennart Poettering2017-09-22
| | | | | | Let's use read_line() to solve our long line limitation. Fixes #3302.
* 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.
* 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.
* shared: allow to input empty string to config_parse_path()Yu Watanabe2017-09-05
| | | | Fixes #6633.
* bus-util: remove unnecessary initializationsYu Watanabe2017-08-31
|
* systemctl: show capabilities in human readable formatYu Watanabe2017-08-31
| | | | Follow-up for 21771f338d268e06dc9a10b9b08b14ff8217d4be.
* Prep 235: add missing libshared.sym and remove obsolete kdbus.hSven Eden2017-08-30
|
* shared: Add a linker script so that all functions are tagget @SD_SHARED ↵Felipe Sateler2017-08-29
| | | | | | | | | | | | instead of @Base (#6669) This helps prevent symbol collisions with other programs and libraries. In particular, because PAM modules are loaded into the process that is creating the session, and elogind creates PAM sessions, the potential for collisions is high. Disambiguate all elogind calls by tagging a 'version' SD_SHARED. Fixes #6624
* Prep v235: Update build system to fit elogindSven Eden2017-08-16
| | | | | | - Update man/rules/meson.build with elogind set of xml files. - Update documentation generating tools to fit elogind. - Follow upstream and link against libelogind-shared-<version>.so
* Prep v235: Add missing includes and dependencies.Sven Eden2017-08-14
|
* Prep v235: Apply upstream fixes (7/10) [src/shared]Sven Eden2017-08-14
|
* treewide: fix typos (#6566)Torstein Husebø2017-08-10
|
* bus-util: do not print (uint64_t) -1 as is (#6522)Yu Watanabe2017-08-10
| | | | Closes #4295 and #6511.
* General: Update build system to upstream support of meson+ninja.Sven Eden2017-08-04
| | | | | | | | Upstream thinks, that the auto tools are too 'legacy', or that they are at least no longer fitting. We follow, as the classic auto tools files have been removed, so no other choice here...
* Prep v234: Apply missing upstream fixes in src/shared (4/6)Sven Eden2017-07-25
|
* core/load-fragment: refuse units with errors in ↵Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | RootDirectory/RootImage/DynamicUser Behaviour of the service is completely different with the option off, so the service would probably mess up state on disk and do unexpected things.
* bus-util: replace non-printable values with [unprintable]Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | | | | Like I said in the previous commit, such values do not seem to appear in normal use, but it's pretty hard to prove that all paths to assign values properly check that they contain no spaces. So just in case some slip through, replace values with spaces (in case of single-valued properties) or spaces and newlines (in case of array proprties) with "[unprintable]". We were already doing it in case of properties which we didn't know how to print, so this fits in well. The advantage is the previous code which used escaping that a) this is easier to spot, b) does not mess up printing of properties which were properly escaped already. v2: - add comments
* Revert "bus: when dumping string property values escape the chars we use as ↵Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | end-of-line and end-of-item marks" This reverts commit 27e9c5af817147ea1c678769e45e83f2e4b4ae96. Property values already use escaping, so escaping them a second time is confusing. It also should be mostly unnecessary: we take care to make property values only contains strings which (after the initial escaping) are printable and parseable without any futher escaping. Before revert: $ systemctl list-dependencies 'dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device' dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device ● ├─dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.swap ● └─elogind-cryptsetup@luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.service $ systemctl show -p Wants,Requires 'dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device' Requires=elogind-cryptsetup@luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.service Wants=dev-mapper-luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.swap Difference between systemctl show before revert and now: -Slice=system-elogind\x5cx2dcryptsetup.slice +Slice=system-elogind\x2dcryptsetup.slice -Id=elogind-cryptsetup@luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.service +Id=elogind-cryptsetup@luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.service -Names=elogind-cryptsetup@luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.service +Names=elogind-cryptsetup@luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.service -Requires=system-elogind\x5cx2dcryptsetup.slice +Requires=system-elogind\x2dcryptsetup.slice -BindsTo=dev-mapper-luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.device dev-disk-by\x5cx2duuid-8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.device +BindsTo=dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device dev-disk-by\x2duuid-8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device -RequiredBy=dev-mapper-luks\x5cx2d8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.device cryptsetup.target +RequiredBy=dev-mapper-luks\x2d8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device cryptsetup.target -WantedBy=dev-disk-by\x5cx2duuid-8db85dcf\x5cx2d6230\x5cx2d4e88\x5cx2d940d\x5cx2dba176d062b31.device +WantedBy=dev-disk-by\x2duuid-8db85dcf\x2d6230\x2d4e88\x2d940d\x2dba176d062b31.device
* conf-parser: fix wrong argument given to log_syntax_invalid_utf8Ronny Chevalier2017-07-25
| | | | | | | | | | The condition is on "word", hence we give word instead of rvalue. An assert would be triggered if !utf8_is_valid(word) is true and rvalue == NULL, since log_syntax_invalid_utf8 calls utf8_escape_invalid which calls assert(str). A test case has been added to test with valid and invalid utf8.
* config parser: Introduce config_parse_ip_portSusant Sahani2017-07-25
|
* improve readability (#5814)Matija Skala2017-07-25
|
* config parser: Introduce config_parse_uint8Susant Sahani2017-07-25
|
* fix parenthesis in pager.c (#5798)Matija Skala2017-07-25
| | | | | - result of dup2 should be compared against 0 - making parenthesis around comparisons just to be sure
* redirect stdout/stderr back when closing the pager (#5661)Matija Skala2017-07-25
|
* tree-wide: fix wrong indent (#5757)Yu Watanabe2017-07-25
| | | | Fixes wrong indent introduced by the commit 43688c49d1fdb585196d94e2e30bb29755fa591b.
* assigning stdout and stderr is not allowedMatija Skala2017-07-25
|
* Rip out setting of the log level from udev_new and put it in a new functionZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | This function is internal to elogind code, so external users of libudev will not see those log messages. I think this is better. If we want to allow that, the function could be put in libudev and exported. v2: check that the string is more than one char before stripping quotes
* Prep v233.3: Unmask various functions for future coverage tests.Sven Eden2017-07-19
| | | | | These functions, although not used by elogind itself, are mostly tiny and crucial for important tests to work.
* Prep v233.2: Mask unneeded functions and definitions in src/sharedSven Eden2017-07-18
|
* Prep v233: Add missing includes in src/sharedSven Eden2017-07-17
|
* Prep v233: Add missing files from upstream and rename formats-util.[hc]Sven Eden2017-07-17
| | | | | | | | | | | | | | | | Some functionality has been exported to the following files: - src/basic/env-util.[hc] - src/basic/exec-util.[hc] - src/shared/nsflags.[hc] The content of these files is now needed in elogind, and the files have been added as-is. Cleanup is done later. Further the header src/basic/formats-util.h has been renamed to src/basic/format-util.h
* shared/pager: abort if we cannot set environment variablesZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | | This most likely means oom, it's better to exit than to run less with incomplete settings. CID #714383.
* copy: change the various copy_xyz() calls to take a unified flags parameterLennart Poettering2017-07-17
| | | | | | | | This adds a unified "copy_flags" parameter to all copy_xyz() function calls, replacing the various boolean flags so far used. This should make many invocations more readable as it is clear what behaviour is precisely requested. This also prepares ground for adding support for more modes later on.
* tree-wide: make bus_map_all_properties return a proper sd_bus_errorLennart Poettering2017-07-17
| | | | | | | | And then show it, to make things a bit friendlier to the user if we fail acquiring some props. In fact, this fixes a number of actual bugs, where we used an error structure for output that we actually never got an error in.
* fs-util: unify code we use to check if dirent's d_name is "." or ".."Lennart Poettering2017-07-17
| | | | | We use different idioms at different places. Let's replace this is the one true new idiom, that is even a bit faster...
* shared: split out code for adding multiple names to sd_bus_track objectLennart Poettering2017-07-17
| | | | | Let's introduce a new call bus_track_add_name_many() that adds a string list to a tracking object.
* bus-util: print RestrictNamespaces= as a stringDjalal Harouni2017-07-17
| | | | | Allow all callers that want to print RestrictNamespaces= returned from D-Bus as a string instead of a u64 value.
* Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
* acl-util: fix memleakEvgeny Vereshchagin2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: $ ./libtool --mode execute valgrind --leak-check=full ./journalctl >/dev/null ==22309== Memcheck, a memory error detector ==22309== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==22309== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==22309== Command: /home/vagrant/elogind/.libs/lt-journalctl ==22309== Hint: You are currently not seeing messages from other users and the system. Users in groups 'adm', 'elogind-journal', 'wheel' can see all messages. Pass -q to turn off this notice. ==22309== ==22309== HEAP SUMMARY: ==22309== in use at exit: 8,680 bytes in 4 blocks ==22309== total heap usage: 5,543 allocs, 5,539 frees, 9,045,618 bytes allocated ==22309== ==22309== 488 (56 direct, 432 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 4 ==22309== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==22309== by 0x6F37A0A: __new_var_obj_p (__libobj.c:36) ==22309== by 0x6F362F7: __acl_init_obj (acl_init.c:28) ==22309== by 0x6F37731: __acl_from_xattr (__acl_from_xattr.c:54) ==22309== by 0x6F36087: acl_get_file (acl_get_file.c:69) ==22309== by 0x4F15752: acl_search_groups (acl-util.c:172) ==22309== by 0x113A1E: access_check_var_log_journal (journalctl.c:1836) ==22309== by 0x113D8D: access_check (journalctl.c:1889) ==22309== by 0x115681: main (journalctl.c:2236) ==22309== ==22309== LEAK SUMMARY: ==22309== definitely lost: 56 bytes in 1 blocks ==22309== indirectly lost: 432 bytes in 1 blocks ==22309== possibly lost: 0 bytes in 0 blocks ==22309== still reachable: 8,192 bytes in 2 blocks ==22309== suppressed: 0 bytes in 0 blocks
* tree-wide: drop unneded WHITESPACE param to extract_first_wordZbigniew Jędrzejewski-Szmek2017-07-17
| | | | It's the default, and NULL is shorter.
* tree-wide: drop NULL sentinel from strjoinZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | | | | | | | | This makes strjoin and strjoina more similar and avoids the useless final argument. spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/elogind -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libelogind/sd-bus -I ./src/libelogind/sd-event -I ./src/libelogind/sd-login -I ./src/libelogind/sd-netlink -I ./src/libelogind/sd-network -I ./src/libelogind/sd-hwdb -I ./src/libelogind/sd-device -I ./src/libelogind/sd-id128 -I ./src/libelogind-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c) git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/' This might have missed a few cases (spatch has a really hard time dealing with _cleanup_ macros), but that's no big issue, they can always be fixed later.
* Prep v232.2: Mask more unneeded functionsSven Eden2017-07-07
|
* Prep v232: Mask new functions that are unneeded by elogindSven Eden2017-07-05
|
* Prep v232: Apply missing updates from upstreamSven Eden2017-07-05
|
* pager: tiny beautificationLennart Poettering2017-07-05
|
* shared/conf-parser: add config_parse_many which takes strv with dirsZbigniew Jędrzejewski-Szmek2017-07-05
| | | | This way we don't have to create a nulstr just to unpack it in a moment.