summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)AuthorFilesLines
2020-03-26(backport) core: remove JoinControllers= configuration settingsandbox/adrians/upgrade-to-239Lennart Poettering1-40/+0
This removes the ability to configure which cgroup controllers to mount together. Instead, we'll now hardcode that "cpu" and "cpuacct" are mounted together as well as "net_cls" and "net_prio". The concept of mounting controllers together has no future as it does not exist to cgroupsv2. Moreover, the current logic is systematically broken, as revealed by the discussions in #10507. Also, we surveyed Red Hat customers and couldn't find a single user of the concept (which isn't particularly surprising, as it is broken...) This reduced the (already way too complex) cgroup handling for us, since we now know whenever we make a change to a cgroup for one controller to which other controllers it applies. Change-Id: I0eadd5f685980bd006134991310c0688ba7a86c5
2020-03-26Merge v239 into tizenAdrian Szyndela124-2626/+2164
systemd 239
2020-03-26Merge v238 into tizenAdrian Szyndela26-185/+774
systemd 238
2020-02-26Merge v237 into tizenAdrian Szyndela25-80/+613
systemd 237
2020-02-26Merge v236 into tizensandbox/adrians/upgrade-to-236Adrian Szyndela117-480/+2007
Change-Id: Id62f08b8ecf2a909a49e5f93b2f7594b3880ef44
2020-02-26Revert "Drop busname unit type"Adrian Szyndela1-0/+4
This reverts commit 4bc5d27b942afa83cc3d95debd2ad48d42ac07a8. There are people somewhere that need kdbus. Change-Id: Ib2d05f88171718c07e7de06409a1c224230e7a8d
2020-02-26Revert "Drop kdbus bits"Adrian Szyndela1-2/+13
This reverts commit a132bef0239e6c3f04096eee3a00c7ecf24a4f5c. There are people somewhere that need kdbus. Change-Id: I5a1f09485c524d47ef8ae53712d5fb77949bc7fa
2020-02-26Merge v235 into tizenAdrian Szyndela47-191/+1148
Change-Id: Iafcca23df73f2694eda50a97771acac4b7996f30
2020-02-26(backport) Fix format-truncation compile failure by typecasting USB IDs (#8250)Patrick Uiterwijk1-0/+39
This patch adds safe_atoux16 for parsing an unsigned hexadecimal 16bit int, and uses that for parsing USB device and vendor IDs. This fixes a compile error with gcc-8 because while we know that USB IDs are 2 bytes, the compiler does not know that. ../src/udev/udev-builtin-hwdb.c:80:38: error: '%04X' directive output may be truncated writing between 4 and 8 bytes into a region of size between 2 and 6 [-Werror=format-truncation=] Change-Id: I40b2eb8b424c57ba430b217ebead2fc5d67bbb14 Signed-off-by: Adam Williamson <awilliam@redhat.com> Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2020-02-26Merge v234 into tizenAdrian Szyndela70-570/+4832
Change-Id: If676fe909a40eadc60ee5ff023abe4ee2c64b44e
2019-12-05fs-util: add new chase_symlinks() flag CHASE_OPENMateusz Moscicki1-1/+61
The new flag returns the O_PATH fd of the final component, which may be converted into a proper fd by open()ing it again through the /proc/self/fd/xyz path. Together with O_SAFE this provides us with a somewhat safe way to open() files in directories potentially owned by unprivileged code, where we want to refuse operation if any symlink tricks are played pointing to privileged files. (cherry picked from commit 1ed34d75d4f21d2335c5625261954c848d176ae6) Change-Id: I5e5ce0affec97e4d19483b4f534db99f4f950f89 Related: #1663143
2019-12-05fs-util: add new CHASE_SAFE flag to chase_symlinks()Mateusz Moscicki1-0/+26
When the flag is specified we won't transition to a privilege-owned file or directory from an unprivileged-owned one. This is useful when privileged code wants to load data from a file unprivileged users have write access to, and validates the ownership, but want's to make sure that no symlink games are played to read a root-owned system file belonging to a different context. (cherry picked from commit f14f1806e329fe92d01f15c22a384702f0cb4ae0) Change-Id: I86dfede53114a23d708744a9c47abc9eaf05a8d1 Related: #1663143
2019-12-02backport chase_symlinksMateusz Moscicki2-0/+214
Related: #1663143 Change-Id: I57d945a208ade174c89ea2736357d8bce541a46f
2018-06-20tree-wide: pass NULL arguments to manager_startup() directly, avoid ↵Lennart Poettering3-9/+3
declaring unneeded variables
2018-06-20test-condition: extend tests to all ConditionSecurity= valuesZbigniew Jędrzejewski-Szmek1-4/+29
Also print out what we detect, for manual verification.
2018-06-20test-sizeof: another aproach to _Float128 availability detectionZbigniew Jędrzejewski-Szmek1-1/+4
2018-06-20Drop copyrights tags for "systemd authors"Zbigniew Jędrzejewski-Szmek1-3/+0
2018-06-20tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek35-103/+0
Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
2018-06-18Correct a number of trivial typos.Chris Lamb1-1/+1
2018-06-14seccomp: add new system call filter, suitable as default whitelist for ↵Lennart Poettering1-1/+2
system services Currently we employ mostly system call blacklisting for our system services. Let's add a new system call filter group @system-service that helps turning this around into a whitelist by default. The new group is very similar to nspawn's default filter list, but in some ways more restricted (as sethostname() and suchlike shouldn't be available to most system services just like that) and in others more relaxed (for example @keyring is blocked in nspawn since it's not properly virtualized yet in the kernel, but is fine for regular system services).
2018-06-14Fix SPDX license tagsZbigniew Jędrzejewski-Szmek1-3/+1
2018-06-14Drop my copyright headersZbigniew Jędrzejewski-Szmek22-59/+1
perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
2018-06-14Merge pull request #9274 from poettering/comment-header-cleanupZbigniew Jędrzejewski-Szmek118-462/+69
drop "this file is part of systemd" and lennart's copyright from header
2018-06-14Merge pull request #9199 from poettering/copy-file-atomicZbigniew Jędrzejewski-Szmek1-0/+21
make copy_file_atomic() use O_TMPFILE to create the destination file
2018-06-14tree-wide: beautify remaining copyright statementsLennart Poettering65-68/+68
Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
2018-06-14tree-wide: remove Lennart's copyright linesLennart Poettering62-160/+0
These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
2018-06-14tree-wide: use proper unicode © instead of (C) where we canLennart Poettering1-1/+1
Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
2018-06-14tree-wide: drop 'This file is part of systemd' blurbLennart Poettering116-233/+0
This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
2018-06-14Merge pull request #9193 from keszybz/coverityLennart Poettering1-0/+8
Coverity support for glibc-2.27
2018-06-13test-alloc-util: add casts to bools from p ointersZbigniew Jędrzejewski-Szmek1-1/+5
C++03: "An rvalue of arithmetic, enumeration, pointer, or pointer to member type can be converted to an rvalue of type bool. A zero value, null pointer value, or null member pointer value is converted to false; any other value is converted to true" C should behave the same because pointers are scalars in C, but let's verify that.
2018-06-13test-alloc-util: add a "test" for bool castsZbigniew Jędrzejewski-Szmek1-0/+17
Just in case ;) There is no good place, test-alloc-util.c is as good as any, and it's quite short so far, so let's add this there.
2018-06-11Merge pull request #9185 from marckleinebudde/canLennart Poettering1-0/+50
networkd: add support to configure CAN devices
2018-06-11Merge pull request #9246 from keszybz/ellipsize-invalid-mem-refLennart Poettering1-1/+12
Fix invalid memory reference in ellipsize_mem()
2018-06-11resolved: rework NSEC covering testsLennart Poettering1-0/+1
This makes two changes: first of all we will now explicitly check whether a domain to test against an NSEC record is actually below the signer's name. This is relevant for NSEC records that chain up the end and the beginning of a zone: we shouldn't alow that NSEC record to match against domains outside of the zone. This also fixes how we handle NSEC checks for domains that are prefixes of the NSEC RR domain itself, fixing #8164 which triggers this specific case. The non-wildcard NSEC check is simplified for that, we can directly make our between check, there's no need to find the "Next Closer" first, as the between check should not be affected by additional prefixes. For the wild card NSEC check we'll prepend the asterisk in this case to the NSEC RR itself to make a correct check. Fixes: #8164
2018-06-09parse-util: add permille parser + testsMarc Kleine-Budde1-0/+50
2018-06-09basic/utf8: add ascii_is_valid_n()Zbigniew Jędrzejewski-Szmek1-1/+12
2018-06-07copy: rework copy_file_atomic() to copy the specified file via O_TMPFILE if ↵Lennart Poettering1-0/+21
possible
2018-06-06test-bus-util: add a test for destroy callbacksZbigniew Jędrzejewski-Szmek1-0/+43
2018-06-06test-bus-util: add a simple test for bus_request_name_async_may_reload_dbus()Zbigniew Jędrzejewski-Szmek2-0/+51
This shows a minor memleak: ==1883== 24 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==1883== at 0x4C2DBAB: malloc (vg_replace_malloc.c:299) ==1883== by 0x4E9D385: malloc_multiply (alloc-util.h:69) ==1883== by 0x4EA2959: bus_request_name_async_may_reload_dbus (bus-util.c:1841) ==1883== by ... The exchange of messages is truncated at two different points: once right after the first callback is requested, and the second time after the full sequence has run (usually resulting in an error because of policy).
2018-06-06main: split out reading of /proc/sys/fs/nr_open into its own functionLennart Poettering1-0/+8
This doesn't really reduce the code size over all, but it does make main.c shorter and more readable, and that's always a good thing.
2018-06-05test-sizeof: also print float types from ISO/IEC TS 18661-3Zbigniew Jędrzejewski-Szmek1-0/+8
2018-06-04basic/log: add the log_struct terminator to macroZbigniew Jędrzejewski-Szmek1-6/+3
This way all callers do not need to specify it. Exhaustively tested by running test-log under valgrind ;)
2018-06-04Merge pull request #9167 from keszybz/ellipsizationLennart Poettering2-9/+85
Ellipsization fixes based on unit-testing and fuzzing
2018-06-04Merge pull request #9149 from yuwata/fix-9107Zbigniew Jędrzejewski-Szmek3-11/+36
path-util: introduce path_simplify()
2018-06-04test: fix function nameYu Watanabe1-2/+2
2018-06-04conf-parser: remove redundant utf8-validity checkYu Watanabe1-1/+1
2018-06-03test: add test for trailing dot in WorkingDirectory= and RuntimeDirectory=Yu Watanabe1-0/+1
2018-06-03conf-parse: use path_simplify_and_warn() in config_parse_path()Yu Watanabe1-0/+1
2018-06-03path-util: make path_make_relative() support path including dotsYu Watanabe1-1/+1
2018-06-03path-util: introduce path_simplify()Yu Watanabe1-9/+32
The function is similar to path_kill_slashes() but also removes initial './', trailing '/.', and '/./' in the path. When the second argument of path_simplify() is false, then it behaves as the same as path_kill_slashes(). Hence, this also replaces path_kill_slashes() with path_simplify().