Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patches 2 upstream systemd #32430

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,17 @@ static void cmdline_take_random_seed(void) {
"This functionality should not be used outside of testing environments.");
}

static void set_suid_dumpable(void) {
const char *sd_path = "/proc/sys/fs/suid_dumpable";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, we already do this?

fs.suid_dumpable=2

const char *value = "2";

/* Write suid_dumpable setting: */
int r = write_string_file(sd_path, value, 0);

if (r < 0)
log_emergency("Failed to write to /proc/sys/fs/suid_dumpable");
}

static void initialize_coredump(bool skip_setup) {
if (getpid_cached() != 1)
return;
Expand Down Expand Up @@ -3147,6 +3158,7 @@ int main(int argc, char *argv[]) {
}

/* A core pattern might have been specified via the cmdline. */
set_suid_dumpable();
initialize_core_pattern(skip_setup);

/* Make /usr/ read-only */
Expand Down