diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-06-27 19:04:31 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-06-27 19:35:57 +0200 |
commit | cf677ac1b7ae1e46c593d055df27f36528be548a (patch) | |
tree | 6e572b62e688dd303d5406956e5b06beba8bdf9c | |
parent | 168562d7ed8fcfc4612e51d221e7a5fa1e1297b5 (diff) |
coredump: don't expose the compression level as configuration option
This sounds overly low-level and implementation-detaily. Let's just
use the default level XZ suggests. This gives us more room to possibly
swap out the compression algorithm used, as the compression level range
will not leak into user configuration.
-rw-r--r-- | man/coredump.conf.xml | 9 | ||||
-rw-r--r-- | src/journal/coredump.c | 22 | ||||
-rw-r--r-- | src/journal/coredump.conf | 2 |
3 files changed, 4 insertions, 29 deletions
diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml index e24d958ac4..cc54466771 100644 --- a/man/coredump.conf.xml +++ b/man/coredump.conf.xml @@ -97,15 +97,6 @@ </varlistentry> <varlistentry> - <term><varname>CompressionLevel=</varname></term> - - <listitem><para>Controls the level of compression for external - storage. An integer between 0 and 9. See - <citerefentry><refentrytitle>xz</refentrytitle><manvolnum>1</manvolnum></citerefentry> - for more details.</para></listitem> - </varlistentry> - - <varlistentry> <term><varname>ProcessSizeMax=</varname></term> <listitem><para>The maximum size in bytes of a core diff --git a/src/journal/coredump.c b/src/journal/coredump.c index 6499fbdef8..28cde66954 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -121,7 +121,6 @@ static DEFINE_CONFIG_PARSE_ENUM(config_parse_coredump_compression, coredump_comp static CoredumpStorage arg_storage = COREDUMP_STORAGE_EXTERNAL; static CoredumpCompression arg_compression = COREDUMP_COMPRESSION_XZ; -static unsigned arg_compression_level = LZMA_PRESET_DEFAULT; static off_t arg_process_size_max = PROCESS_SIZE_MAX; static off_t arg_external_size_max = EXTERNAL_SIZE_MAX; static size_t arg_journal_size_max = JOURNAL_SIZE_MAX; @@ -129,12 +128,9 @@ static off_t arg_keep_free = (off_t) -1; static off_t arg_max_use = (off_t) -1; static int parse_config(void) { - int r; - static const ConfigTableItem items[] = { { "Coredump", "Storage", config_parse_coredump_storage, 0, &arg_storage }, { "Coredump", "Compression", config_parse_coredump_compression, 0, &arg_compression }, - { "Coredump", "CompressionLevel", config_parse_unsigned, 0, &arg_compression_level }, { "Coredump", "ProcessSizeMax", config_parse_iec_off, 0, &arg_process_size_max }, { "Coredump", "ExternalSizeMax", config_parse_iec_off, 0, &arg_external_size_max }, { "Coredump", "JournalSizeMax", config_parse_iec_size, 0, &arg_journal_size_max }, @@ -143,7 +139,7 @@ static int parse_config(void) { {} }; - r = config_parse( + return config_parse( NULL, "/etc/systemd/coredump.conf", NULL, @@ -153,15 +149,6 @@ static int parse_config(void) { false, false, NULL); - -#ifdef HAVE_XZ - if (arg_compression_level > 9) { - log_warning("Invalid CompressionLevel %u, ignoring.", arg_compression_level); - arg_compression_level = LZMA_PRESET_DEFAULT; - } -#endif - - return r; } static int fix_acl(int fd, uid_t uid) { @@ -380,7 +367,7 @@ static int save_external_coredump( goto uncompressed; } - r = compress_stream(fd, fd2, arg_compression_level, -1); + r = compress_stream(fd, fd2, LZMA_PRESET_DEFAULT, -1); if (r < 0) { log_error("Failed to compress %s: %s", tmp2, strerror(-r)); unlink_noerrno(tmp2); @@ -508,9 +495,8 @@ int main(int argc, char* argv[]) { parse_config(); log_debug("Selected storage '%s'.", coredump_storage_to_string(arg_storage)); - log_debug("Selected compression %s:%u.", - coredump_compression_to_string(arg_compression), - arg_compression_level); + log_debug("Selected compression %s.", + coredump_compression_to_string(arg_compression)); r = parse_uid(argv[INFO_UID + 1], &uid); if (r < 0) { diff --git a/src/journal/coredump.conf b/src/journal/coredump.conf index 050bde6491..20424f2138 100644 --- a/src/journal/coredump.conf +++ b/src/journal/coredump.conf @@ -10,8 +10,6 @@ [Coredump] #Storage=external #Compression=xz -#CompressionLevel=6 - #ProcessSizeMax=2G #ExternalSizeMax=2G #JournalSizeMax=767M |