aboutsummaryrefslogtreecommitdiff
path: root/reftable/stack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-06 14:31:20 -0800
committerJunio C Hamano <gitster@pobox.com>2024-02-06 14:31:20 -0800
commit0f4e178a4f7ab6dd8758f0b581c5bfe7f71cf415 (patch)
tree37a2928261544746127349e72f11e2bb520d90d9 /reftable/stack.c
parentb6fdf9aafa936481163480984d1a620092765a38 (diff)
parentb3a79dd4e97a76317b528437e7413452b285ee88 (diff)
downloadgit-0f4e178a4f7ab6dd8758f0b581c5bfe7f71cf415.tar.xz
Merge branch 'ps/reftable-compacted-tables-permission-fix'
Reftable bugfix. * ps/reftable-compacted-tables-permission-fix: reftable/stack: adjust permissions of compacted tables
Diffstat (limited to 'reftable/stack.c')
-rw-r--r--reftable/stack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/reftable/stack.c b/reftable/stack.c
index bed25240e3..a1dd79fc06 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -849,6 +849,12 @@ static int stack_compact_locked(struct reftable_stack *st, int first, int last,
strbuf_addstr(temp_tab, ".temp.XXXXXX");
tab_fd = mkstemp(temp_tab->buf);
+ if (st->config.default_permissions &&
+ chmod(temp_tab->buf, st->config.default_permissions) < 0) {
+ err = REFTABLE_IO_ERROR;
+ goto done;
+ }
+
wr = reftable_new_writer(reftable_fd_write, reftable_fd_flush, &tab_fd, &st->config);
err = stack_write_compact(st, wr, first, last, config);