Changes the core_pattern to prevent any core dumps by the kernel. Does
nothing if we're in a container environment as this is system wide
setting.
#include "umask-util.h"
#include "user-util.h"
#include "util.h"
+//#include "virt.h"
int saved_argc = 0;
char **saved_argv = NULL;
return strcmp(os1, os2);
}
+
+/* Turn off core dumps but only if we're running outside of a container. */
+void disable_core_dumps(void) {
+ if (detect_container() <= 0)
+ (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
+}
#if 0 /// UNNEEDED by elogind
#endif // 0
int str_verscmp(const char *s1, const char *s2);
+
+void disable_core_dumps(void);