1
0
mirror of https://github.com/systemd/systemd synced 2026-03-29 19:24:50 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Yu Watanabe
2d82ebf600
core/selinux-setup: actually skip setup gracefully when libselinux is not available (#39859) 2025-11-23 09:11:32 +09:00
Daan De Meyer
dd281e19a7 docs: Document cast formatting rules 2025-11-22 23:41:46 +01:00
Mike Yuan
375a4bd878
core/selinux-setup: actually skip setup gracefully when libselinux is not available
Follow-up for 83b6ef9b62765b11bc602eae906ff13a5464a638
2025-11-22 19:07:28 +01:00
Mike Yuan
32b7a07b8c
core/exec-invoke: deduplicate needs_setuid with needs_sandboxing 2025-11-22 19:07:28 +01:00
3 changed files with 17 additions and 3 deletions

View File

@ -67,6 +67,18 @@ SPDX-License-Identifier: LGPL-2.1-or-later
const char *foo(const char *input);
```
- Casts should be written like this:
```c
(const char*) s;
```
instead of this:
```c
(const char *)s;
```
- Single-line `if` blocks should not be enclosed in `{}`. Write this:
```c

View File

@ -5732,7 +5732,7 @@ int exec_invoke(
/* We need setresuid() if the caller asked us to apply sandboxing and the command isn't explicitly
* excepted from either whole sandboxing or just setresuid() itself. */
needs_setuid = (params->flags & EXEC_APPLY_SANDBOXING) && !(command->flags & (EXEC_COMMAND_FULLY_PRIVILEGED|EXEC_COMMAND_NO_SETUID));
needs_setuid = needs_sandboxing && !FLAGS_SET(command->flags, EXEC_COMMAND_NO_SETUID);
uint64_t capability_ambient_set = context->capability_ambient_set;

View File

@ -19,8 +19,10 @@ int mac_selinux_setup(bool *loaded_policy) {
int r;
r = dlopen_libselinux();
if (r < 0)
return log_debug_errno(r, "No SELinux library available, skipping setup: %m");
if (r < 0) {
log_debug_errno(r, "No SELinux library available, skipping setup.");
return 0;
}
mac_selinux_disable_logging();