From: Junio C Hamano <gitster@pobox.com>
To: Han-Wen Nienhuys <hanwen@google.com>
Cc: Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Re: [PATCH 3/3] reftable: support preset file mode for writing
Date: Mon, 10 Jan 2022 11:14:40 -0800 [thread overview]
Message-ID: <xmqqk0f7z9lr.fsf@gitster.g> (raw)
In-Reply-To: <CAFQ2z_MEN2j-sHmGK4SA6N8P9bHvjO2=+G0XxXp_9vzLRxwKuw@mail.gmail.com> (Han-Wen Nienhuys's message of "Mon, 10 Jan 2022 20:01:54 +0100")
Han-Wen Nienhuys <hanwen@google.com> writes:
> On Fri, Dec 24, 2021 at 5:46 AM Junio C Hamano <gitster@pobox.com> wrote:
>> > if (add->lock_file_fd < 0) {
>> > if (errno == EEXIST) {
>> > err = REFTABLE_LOCK_ERROR;
>> > @@ -478,6 +478,13 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
>> > }
>> > goto done;
>> > }
>> > + if (st->config.default_permissions) {
>> > + if (chmod(add->lock_file_name.buf, st->config.default_permissions) < 0) {
>> > + err = REFTABLE_IO_ERROR;
>> > + goto done;
>>
>> This part does not exactly make sense, though.
>
> why?
Explained in the part that follows that statement in the message you
are responding to.
> I read over the adjust_shared_perm function for a bit, but I'm puzzled
> why its complexity is necessary. It seems to do something with X-bits,
> maybe for directories, but that doesn't apply here as we're only
> handling files?
We are propagating executable bit, which affects both directories
and files.
> We also only write new files, so we never have to look at the existing
> mode of a file.
It is mostly about defeating the umask of whoever is esecuting "git".
next prev parent reply other threads:[~2022-01-10 19:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-23 19:29 [PATCH 0/3] preliminary fixes for reftable support Han-Wen Nienhuys via GitGitGadget
2021-12-23 19:29 ` [PATCH 1/3] reftable: fix typo in header Han-Wen Nienhuys via GitGitGadget
2021-12-23 19:29 ` [PATCH 2/3] reftable: signal overflow Han-Wen Nienhuys via GitGitGadget
2021-12-23 19:29 ` [PATCH 3/3] reftable: support preset file mode for writing Han-Wen Nienhuys via GitGitGadget
2021-12-24 4:46 ` Junio C Hamano
2022-01-10 19:01 ` Han-Wen Nienhuys
2022-01-10 19:14 ` Junio C Hamano [this message]
2021-12-23 20:27 ` [PATCH 0/3] preliminary fixes for reftable support Junio C Hamano
2021-12-24 2:15 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqk0f7z9lr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=hanwen@google.com \
--cc=hanwenn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).