summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-sysroot-cleanup.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2014-05-30 10:02:01 -0400
committerColin Walters <walters@verbum.org>2014-06-03 13:41:48 -0400
commitb4d21e9406b1bd178f9a9875ba145c48a9591311 (patch)
tree66a78c33a055c6252696ca73be66332b56507656 /src/libostree/ostree-sysroot-cleanup.c
parent93c68083ac68c87627a1b4fb43510fa064260320 (diff)
downloadostree-b4d21e9406b1bd178f9a9875ba145c48a9591311.tar.gz
deploy: Set the immutable bit on the deployment root
This prevents people from creating new directories there and expecting them to be persisted. The OSTree model has all local state to be in /etc and /var. This introduces a compile-time dependency on libe2fsprogs. We're only doing this for the root directory at the moment. https://bugzilla.gnome.org/show_bug.cgi?id=728006
Diffstat (limited to 'src/libostree/ostree-sysroot-cleanup.c')
-rw-r--r--src/libostree/ostree-sysroot-cleanup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot-cleanup.c b/src/libostree/ostree-sysroot-cleanup.c
index ade75bba..825d6c4d 100644
--- a/src/libostree/ostree-sysroot-cleanup.c
+++ b/src/libostree/ostree-sysroot-cleanup.c
@@ -22,6 +22,7 @@
#include "otutil.h"
#include "libgsystem.h"
+#include "ostree-linuxfsutil.h"
#include "ostree-sysroot-private.h"
@@ -341,6 +342,9 @@ cleanup_old_deployments (OstreeSysroot *self,
if (device == root_device && inode == root_inode)
continue;
+ if (!_ostree_linuxfs_alter_immutable_flag (deployment_path, FALSE,
+ cancellable, error))
+ goto out;
if (!gs_shutil_rm_rf (deployment_path, cancellable, error))
goto out;
if (!gs_shutil_rm_rf (origin_path, cancellable, error))