summaryrefslogtreecommitdiffstats
path: root/coccinelle/redundant-if.cocci (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-01-04find-esp: adjust parameter indentating to our usual coding styleLennart Poettering1-17/+23
2024-01-04logind: use unlink_and_free() at once more placeLennart Poettering1-5/+1
2024-01-04json: drop redundant checkLennart Poettering1-3/+0
The same check is done exactly one line later, because this is one of the things that json_variant_is_regular() checks. As per: https://github.com/systemd/systemd/pull/30578/commits/fa9a6db478e3f0f2753e4633af6d0d4881707c2b#r1441792019
2024-01-04tmpfiles: add --purge switchLuca Boccassi3-10/+106
Any file/directory created by a tmpfiles.d will be deleted. Useful for purge/factory reset patterns.
2024-01-04shared/vpick: don't say "ptr" for TAKE_PICK_RESULT (struct)Mike Yuan1-1/+1
2024-01-04vpick-tool: sort includesMike Yuan1-1/+1
2024-01-04logind: do TTY idle logic only for sessions marked as "tty"Lennart Poettering1-12/+14
Otherwise things might be weird, because background sessions might become "idle", wich doesn#t really make much sense. This shouldn't change much in 99% of the cases, but slightly corrects behaviour as it ensures only "primary"/"foreground" sessions get the idle logic, i.e. where a user exists that could actually make it non-idle.
2024-01-04update TODOLennart Poettering1-5/+6
2024-01-04logind: don't make idle action timer accuracy more coarse than timeoutLennart Poettering1-1/+1
If we allow the timer accuracy to grow larger then the timeout itself things are very confusing, because people might set a 1s time-out and we turn that into 30s. Hence, let's just cut off the 30s accuracy to the time-out itself, so that we stay close to what users configured.
2024-01-04homed: when empty username is passed to bus calls, operate on client's UIDLennart Poettering1-16/+56
2024-01-04homed: fix home_count_bad_authentication() countingLennart Poettering1-11/+12
We want to cover not only regular bad password entries, but also bad recovery key entries. Hence let's move the list of errors into the function, and add more.
2024-01-04homed: tone down log message about bad passwords a bitLennart Poettering1-4/+29
We usually start out out authentication cycles with an "empty" password attempt, to give homed the chance to authenticated via any plugged in tokens. Hence frequently the first attempt will just fail, which is no reason to complain about.
2024-01-04network/route: make the route section invalid when an invalid MTUBytes= is ↵Yu Watanabe2-2/+2
specified We usually set the invalid flag for a section if a setting in the section has an invalid value. Let's also do the same thing for MTUBytes= in [Route].
2024-01-04update-man-rules: skip over standard-conf.xmlFrantisek Sumsal1-0/+1
bc6fdcbf5d switched its doctype to refentry, so the script started picking it up and complaining that it's missing required stuff. Since this file is only included from other man pages, let's skip it when putting together a list of valid targets. Resolves: #30715 Follow-up for: bc6fdcbf5d
2024-01-04homed: add missing bus call to homed access policyLennart Poettering1-0/+4
2024-01-04pam_systemd: drop unnecessary strempty() of 'tty' variableLennart Poettering1-7/+5
This probably predates our introduction of streq_ptr(). Let's drop this now however, as we actually want this to be NULL, further down, and handle that just fine. In particular as all the special cases we have explicitly set this to NULL anyway. No real change in behaviour, just some normalization of handling.
2024-01-04tmpfiles: 'x' takes globs, hence clean it with globbingLennart Poettering1-2/+2
2024-01-04tmpfiles: always list tmpfiles line types in same orderLennart Poettering1-9/+9
otherwise it just gets too confusing to follow.
2024-01-04execute: make sure Type=exec and PAMName= work togetherLennart Poettering1-2/+8
If PAMName= is used we'll spawn a PAM session for the service, and leave a process around that closes the PAM session eventually. That process must close the "exec_fd" that we use to implement Type=exec. After all the logic relies on the fact that execve() will implicitly close the exec_fd, and the EOF seen on it is hence indication for the service manager that execve() has worked. But if we keep an fd open in the PAM service process, then this is not going to work. Hence close the fd explicitly so that it definitely doesn't stay pinned in the child.
2024-01-04Fix typo in verb_make_policy explanationAlberto Planas1-1/+1
Signed-off-by: Alberto Planas <aplanas@suse.com>
2024-01-04network/netdev: call done() per netdev kind before freeing netdev name or soYu Watanabe1-8/+7
Otherwise, log_netdev_xyz() does not provide netdev name if it is called in done(). It is hard to debug. This should not change any effective behavior, at least with the current implementation of done() per netdev kind.
2024-01-04tpm2-generator: sort includesMike Yuan1-1/+1
2024-01-04logind: use FOREACH_ARRAY() where appropriateLennart Poettering1-6/+8
2024-01-04pam_systemd_home: minor coding style adjustmentLennart Poettering1-2/+2
2024-01-04homed: add some function parameter assert()sLennart Poettering1-0/+4
2024-01-04logind: cast various calls that return errors we ignore to (void)Lennart Poettering1-19/+16
2024-01-04pam_systemd_home: port over to pam_get_item_many()Lennart Poettering1-7/+6
2024-01-04pam_systemd: move over to pam_get_item_many()Lennart Poettering1-20/+12
2024-01-04man/loginctl: document "self" and "auto" special session IDsMike Yuan1-10/+9
session-status automatically uses "auto" if no ID is specified, but show-session shows the manager's properties. Let's document these special values so that users of show-session can benefit too.
2024-01-04pam-util: add pam_get_item_many() helper that gets many PAM items at onceLennart Poettering2-0/+28
Just to shorten a bit of code.
2024-01-04man/loginctl: use <literal> to quote possible values of --kill-whom=Mike Yuan1-6/+4
2024-01-04TEST-35-LOGIN: enable FileDescriptorStorePreserve= for coldplug testMike Yuan1-6/+14
2024-01-04strv: rename strv_endswith to endswith_strv and dedup ENDSWITH_SETMike Yuan4-31/+22
2024-01-04string-util: move startswith_strv to strvMike Yuan4-17/+15
2024-01-04string-util: use strneqMike Yuan1-1/+1
2024-01-04string-util-fundamental: postfix -> suffix, use streqMike Yuan2-10/+10
2024-01-04logind-session: watch pidfd in session_set_leader_consumeMike Yuan4-39/+38
2024-01-04logind: serialize session leader pidfd to fdstoreMike Yuan4-108/+208
2024-01-04process-util: ensure pidref_is_alive only return ESRCH if not setMike Yuan1-1/+3
2024-01-04logind-session: use one_zero where appropriateMike Yuan1-6/+6
2024-01-04logind-session: be tolerant if we failed to remove leader from hashmapMike Yuan1-1/+1
If something wrong happened before hashmap_put(), session_free() may be called through gc logic, and the assertion is triggered.
2024-01-04logind: use RET_GATHER more, return first errorMike Yuan1-40/+29
2024-01-04resolved: add transaction result for upstream failuresRonan Pigott5-4/+51
This new transaction result is emitted when the upstream server indicates a fatal error that we will not try to recover from. Currently, it is emitted when a validating recursive resolver reports an error validating dnssec records for a domain. The extended error message should help give context to the admin.
2024-01-04resolved: support RFC 8914 EDE error codesRonan Pigott3-3/+123
If the server is able to indicate an extended error to us, using a degraded feature set is unlikely to help.
2024-01-04resolved: delay server feature detectionRonan Pigott1-77/+77
Some fields of the DnsPacket are not populated until we extract an answer, like p->opt, despite being referenced by macros like DNS_PACKET_RCODE. We can reorder some of the basic checks to follow dns_packet_extract.
2024-01-04dns: remove some magic numbersRonan Pigott1-5/+5
Let's use enum values for the EDNS codes now that we have them, for readability.
2024-01-04dns: introduce more EDNS codes from IANARonan Pigott2-0/+106
2024-01-03logind: don't setup idle session watch for lock-screen and greeterMichal Sekletar2-5/+6
Reason to skip the idle session logic for these session classes is that they are idle by default.
2024-01-03basic: fix overflow detection in sigbus_popRose1-3/+3
The current check checks for n_sigbus_queue being greater than or equal to SIGBUS_QUEUE_MAX, when it should be just greater than as n_sigbus_queue being SIGBUS_QUEUE_MAX indicates that the queue is full, but not overflowed.
2024-01-03test: temporarily adjust the default mount rate limitFrantisek Sumsal1-0/+3
(Hopefully) a temporary workaround for #30573 where starting a user session when PID 1 is rate limited stalls even after it leaves the rate limited state: [ 11.658201] H systemd[1]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=4208 reply_cookie=0 signature=so error-name=n/a error-mes> [ 11.658233] H systemd[1]: Event source 0x559babdd8bb0 (mount-monitor-dispatch) left rate limit state. [ 101.562697] H busctl[784]: Failed to get credentials: Transport endpoint is not connected [ 101.563480] H systemd[1]: systemd-journald.service: Got notification message from PID 300 (WATCHDOG=1) [ 101.563725] H testsuite-74.sh[784]: BusAddress=unixexec:path=systemd-run,argv1=-M.host,argv2=-PGq,argv3=--wait,argv4=-pUser%3dtestuser,argv5=-pPAMName%3dlogin,argv6=systemd-stdio-bridge,argv7=-punix:path%3d%24%7bXDG_RUNTIME_DIR%7d/bus [ 101.564136] H systemd[1]: Successfully forked off '(sd-expire)' as PID 787. [ 101.564754] H systemd[1]: Successfully forked off '(sd-expire)' as PID 788. [ 101.564831] H testsuite-74.sh[381]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-74.busctl.sh failed' The issue appeared after ee07fff03b which does a bunch of mounts/umounts that get PID 1 into a rate limited state, and is frequent enough to be annoying, so let's temporarily bump the rate limit to alleviate that.