|
|
ac3a84 |
From e611a79647dd2ec68b8d5553d8aa566e79cd9f6e Mon Sep 17 00:00:00 2001
|
|
|
ac3a84 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
ac3a84 |
Date: Tue, 29 Nov 2022 09:00:16 +0100
|
|
|
ac3a84 |
Subject: [PATCH] coredump: adjust whitespace
|
|
|
ac3a84 |
|
|
|
ac3a84 |
(cherry picked from commit 510a146634f3e095b34e2a26023b1b1f99dcb8c0)
|
|
|
ac3a84 |
|
|
|
ac3a84 |
Related: #2155517
|
|
|
ac3a84 |
---
|
|
|
ac3a84 |
src/coredump/coredump.c | 56 ++++++++++++++++++++---------------------
|
|
|
ac3a84 |
1 file changed, 28 insertions(+), 28 deletions(-)
|
|
|
ac3a84 |
|
|
|
ac3a84 |
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
|
|
|
ac3a84 |
index 98e7492811..7a181bdeeb 100644
|
|
|
ac3a84 |
--- a/src/coredump/coredump.c
|
|
|
ac3a84 |
+++ b/src/coredump/coredump.c
|
|
|
ac3a84 |
@@ -110,16 +110,16 @@ enum {
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
static const char * const meta_field_names[_META_MAX] = {
|
|
|
ac3a84 |
- [META_ARGV_PID] = "COREDUMP_PID=",
|
|
|
ac3a84 |
- [META_ARGV_UID] = "COREDUMP_UID=",
|
|
|
ac3a84 |
- [META_ARGV_GID] = "COREDUMP_GID=",
|
|
|
ac3a84 |
- [META_ARGV_SIGNAL] = "COREDUMP_SIGNAL=",
|
|
|
ac3a84 |
- [META_ARGV_TIMESTAMP] = "COREDUMP_TIMESTAMP=",
|
|
|
ac3a84 |
- [META_ARGV_RLIMIT] = "COREDUMP_RLIMIT=",
|
|
|
ac3a84 |
- [META_ARGV_HOSTNAME] = "COREDUMP_HOSTNAME=",
|
|
|
ac3a84 |
- [META_COMM] = "COREDUMP_COMM=",
|
|
|
ac3a84 |
- [META_EXE] = "COREDUMP_EXE=",
|
|
|
ac3a84 |
- [META_UNIT] = "COREDUMP_UNIT=",
|
|
|
ac3a84 |
+ [META_ARGV_PID] = "COREDUMP_PID=",
|
|
|
ac3a84 |
+ [META_ARGV_UID] = "COREDUMP_UID=",
|
|
|
ac3a84 |
+ [META_ARGV_GID] = "COREDUMP_GID=",
|
|
|
ac3a84 |
+ [META_ARGV_SIGNAL] = "COREDUMP_SIGNAL=",
|
|
|
ac3a84 |
+ [META_ARGV_TIMESTAMP] = "COREDUMP_TIMESTAMP=",
|
|
|
ac3a84 |
+ [META_ARGV_RLIMIT] = "COREDUMP_RLIMIT=",
|
|
|
ac3a84 |
+ [META_ARGV_HOSTNAME] = "COREDUMP_HOSTNAME=",
|
|
|
ac3a84 |
+ [META_COMM] = "COREDUMP_COMM=",
|
|
|
ac3a84 |
+ [META_EXE] = "COREDUMP_EXE=",
|
|
|
ac3a84 |
+ [META_UNIT] = "COREDUMP_UNIT=",
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
typedef struct Context {
|
|
|
ac3a84 |
@@ -138,9 +138,9 @@ typedef enum CoredumpStorage {
|
|
|
ac3a84 |
} CoredumpStorage;
|
|
|
ac3a84 |
|
|
|
ac3a84 |
static const char* const coredump_storage_table[_COREDUMP_STORAGE_MAX] = {
|
|
|
ac3a84 |
- [COREDUMP_STORAGE_NONE] = "none",
|
|
|
ac3a84 |
+ [COREDUMP_STORAGE_NONE] = "none",
|
|
|
ac3a84 |
[COREDUMP_STORAGE_EXTERNAL] = "external",
|
|
|
ac3a84 |
- [COREDUMP_STORAGE_JOURNAL] = "journal",
|
|
|
ac3a84 |
+ [COREDUMP_STORAGE_JOURNAL] = "journal",
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
DEFINE_PRIVATE_STRING_TABLE_LOOKUP(coredump_storage, CoredumpStorage);
|
|
|
ac3a84 |
@@ -156,13 +156,13 @@ static uint64_t arg_max_use = UINT64_MAX;
|
|
|
ac3a84 |
|
|
|
ac3a84 |
static int parse_config(void) {
|
|
|
ac3a84 |
static const ConfigTableItem items[] = {
|
|
|
ac3a84 |
- { "Coredump", "Storage", config_parse_coredump_storage, 0, &arg_storage },
|
|
|
ac3a84 |
- { "Coredump", "Compress", config_parse_bool, 0, &arg_compress },
|
|
|
ac3a84 |
- { "Coredump", "ProcessSizeMax", config_parse_iec_uint64, 0, &arg_process_size_max },
|
|
|
ac3a84 |
- { "Coredump", "ExternalSizeMax", config_parse_iec_uint64_infinity, 0, &arg_external_size_max },
|
|
|
ac3a84 |
- { "Coredump", "JournalSizeMax", config_parse_iec_size, 0, &arg_journal_size_max },
|
|
|
ac3a84 |
- { "Coredump", "KeepFree", config_parse_iec_uint64, 0, &arg_keep_free },
|
|
|
ac3a84 |
- { "Coredump", "MaxUse", config_parse_iec_uint64, 0, &arg_max_use },
|
|
|
ac3a84 |
+ { "Coredump", "Storage", config_parse_coredump_storage, 0, &arg_storage },
|
|
|
ac3a84 |
+ { "Coredump", "Compress", config_parse_bool, 0, &arg_compress },
|
|
|
ac3a84 |
+ { "Coredump", "ProcessSizeMax", config_parse_iec_uint64, 0, &arg_process_size_max },
|
|
|
ac3a84 |
+ { "Coredump", "ExternalSizeMax", config_parse_iec_uint64_infinity, 0, &arg_external_size_max },
|
|
|
ac3a84 |
+ { "Coredump", "JournalSizeMax", config_parse_iec_size, 0, &arg_journal_size_max },
|
|
|
ac3a84 |
+ { "Coredump", "KeepFree", config_parse_iec_uint64, 0, &arg_keep_free },
|
|
|
ac3a84 |
+ { "Coredump", "MaxUse", config_parse_iec_uint64, 0, &arg_max_use },
|
|
|
ac3a84 |
{}
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
@@ -208,15 +208,15 @@ static int fix_acl(int fd, uid_t uid) {
|
|
|
ac3a84 |
static int fix_xattr(int fd, const Context *context) {
|
|
|
ac3a84 |
|
|
|
ac3a84 |
static const char * const xattrs[_META_MAX] = {
|
|
|
ac3a84 |
- [META_ARGV_PID] = "user.coredump.pid",
|
|
|
ac3a84 |
- [META_ARGV_UID] = "user.coredump.uid",
|
|
|
ac3a84 |
- [META_ARGV_GID] = "user.coredump.gid",
|
|
|
ac3a84 |
- [META_ARGV_SIGNAL] = "user.coredump.signal",
|
|
|
ac3a84 |
- [META_ARGV_TIMESTAMP] = "user.coredump.timestamp",
|
|
|
ac3a84 |
- [META_ARGV_RLIMIT] = "user.coredump.rlimit",
|
|
|
ac3a84 |
- [META_ARGV_HOSTNAME] = "user.coredump.hostname",
|
|
|
ac3a84 |
- [META_COMM] = "user.coredump.comm",
|
|
|
ac3a84 |
- [META_EXE] = "user.coredump.exe",
|
|
|
ac3a84 |
+ [META_ARGV_PID] = "user.coredump.pid",
|
|
|
ac3a84 |
+ [META_ARGV_UID] = "user.coredump.uid",
|
|
|
ac3a84 |
+ [META_ARGV_GID] = "user.coredump.gid",
|
|
|
ac3a84 |
+ [META_ARGV_SIGNAL] = "user.coredump.signal",
|
|
|
ac3a84 |
+ [META_ARGV_TIMESTAMP] = "user.coredump.timestamp",
|
|
|
ac3a84 |
+ [META_ARGV_RLIMIT] = "user.coredump.rlimit",
|
|
|
ac3a84 |
+ [META_ARGV_HOSTNAME] = "user.coredump.hostname",
|
|
|
ac3a84 |
+ [META_COMM] = "user.coredump.comm",
|
|
|
ac3a84 |
+ [META_EXE] = "user.coredump.exe",
|
|
|
ac3a84 |
};
|
|
|
ac3a84 |
|
|
|
ac3a84 |
int r = 0;
|