summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-summary.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2015-01-16 13:28:36 -0500
committerColin Walters <walters@verbum.org>2015-03-25 17:24:05 -0400
commit1d5e2682fdb493d6f2ed0dc695ed08586db1d227 (patch)
treefa878c4411f8a5221302f1561ee54ef2a3b79988 /src/ostree/ot-builtin-summary.c
parent7941189dfde3795fb649aba41e207f0072dfcd86 (diff)
downloadostree-1d5e2682fdb493d6f2ed0dc695ed08586db1d227.tar.gz
Check repo permission prior to attempting to modify it
Fail early with a helpful message if the user does not have sufficient permission to modify an OSTree repository.
Diffstat (limited to 'src/ostree/ot-builtin-summary.c')
-rw-r--r--src/ostree/ot-builtin-summary.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ostree/ot-builtin-summary.c b/src/ostree/ot-builtin-summary.c
index d7bed442..81566898 100644
--- a/src/ostree/ot-builtin-summary.c
+++ b/src/ostree/ot-builtin-summary.c
@@ -46,6 +46,9 @@ ostree_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError
if (opt_update)
{
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (!ostree_repo_regenerate_summary (repo, NULL, cancellable, error))
goto out;
}