[systemd-commits] 3 commits - src/journal src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Mon Sep 10 18:04:30 PDT 2012


 src/journal/journal-file.c |   12 +++++++++---
 src/shared/util.c          |    2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 49a32d43de3bd57bced22ed9a94342ea1efbb31c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 11 03:03:36 2012 +0200

    journal: don't set seal flag if we don't have gcrypt built-in

diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 8bd5273..8016852 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2024,7 +2024,9 @@ int journal_file_open(
 #ifdef HAVE_XZ
         f->compress = compress;
 #endif
+#ifdef HAVE_GCRYPT
         f->seal = seal;
+#endif
 
         if (mmap_cache)
                 f->mmap = mmap_cache_ref(mmap_cache);
@@ -2059,9 +2061,11 @@ int journal_file_open(
 #ifdef HAVE_GCRYPT
                 /* Try to load the FSPRG state, and if we can't, then
                  * just don't do sealing */
-                r = journal_file_fss_load(f);
-                if (r < 0)
-                        f->seal = false;
+                if (f->seal) {
+                        r = journal_file_fss_load(f);
+                        if (r < 0)
+                                f->seal = false;
+                }
 #endif
 
                 r = journal_file_init_header(f, template);

commit 48b617399d7d8446c5310b2568b2af6f13331b4c
Author: Michael Olbrich <m.olbrich at pengutronix.de>
Date:   Mon Sep 3 15:46:44 2012 +0200

    journal: don't try to compress without XZ
    
    otherwise the header contains the HEADER_INCOMPATIBLE_COMPRESSED
    flag even though the data is not compressed and reading the journal
    fails.

diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index c8193ba..8bd5273 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2021,7 +2021,9 @@ int journal_file_open(
         f->flags = flags;
         f->prot = prot_from_flags(flags);
         f->writable = (flags & O_ACCMODE) != O_RDONLY;
+#ifdef HAVE_XZ
         f->compress = compress;
+#endif
         f->seal = seal;
 
         if (mmap_cache)

commit b3d284696cc244be51bbf82d5fa1bacc197c2f99
Author: Tom Gundersen <teg at jklm.no>
Date:   Mon Sep 3 15:40:37 2012 +0200

    util: rm_rf_children_dangerous: delete all descendants dangerously
    
    Call rm_rf_children_dangerous() recursively rather than falling back to
    rm_rf_children(). This fixes a bug in systemd-tmpfiles.
    
    The problem can easily be reproduced by:
    
      # mount /dev/sda1 /mnt
      # mkdir /mnt/test
      # echo "D /mnt" > /root/test.conf
      # systemd-tmpfiles --remove /root/test.conf
      Attempted to remove disk file system, and we can't allow that.
      rm_rf(/root/test): Operation not permitted
    
    Reported-by: Lukas Jirkovsky <l.jirkovsky at gmail.com>

diff --git a/src/shared/util.c b/src/shared/util.c
index 4f5cb26..eaf2721 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3358,7 +3358,7 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct
                                 continue;
                         }
 
-                        r = rm_rf_children(subdir_fd, only_dirs, honour_sticky, root_dev);
+                        r = rm_rf_children_dangerous(subdir_fd, only_dirs, honour_sticky, root_dev);
                         if (r < 0 && ret == 0)
                                 ret = r;
 



More information about the systemd-commits mailing list