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
This commit is contained in:
Colin Walters committed 2014-06-03 13:41:48 -04:00
1 parent 93c68083ac
commit b4d21e9406
6 files changed
+182

No files matched your search

+4
View File
@@ -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))