On Thu, Jun 22, 2017 at 9:51 PM, Junio C Hamano <[email protected]> wrote:
> Christian Couder <[email protected]> writes:
>> Let's fix that by using create_tempfile() instead of mks_tempfile()
>> to create the shared index file.
>>
>> ...
>> - fd = mks_tempfile(&temporary_sharedindex,
>> git_path("sharedindex_XXXXXX"));
>> + fd = create_tempfile(&temporary_sharedindex,
>> git_path("sharedindex_XXXXXX"));
>
> So we used to create a temporary file that made sure its name is
> unique but now we create sharedindex_XXXXXX with 6 X's literally
> at the end?
>
> Doesn't mks_tempfile() family include a variant where you can give
> custom mode? Better yet, perhaps you can call adjust_shared_perm()
> on the path _after_ seeing that mks_tempfile() succeeds (you can ask
> get_tempfile_path() which path to adjust, I presume)?
Yeah, adjust_shared_perm() is called after mks_tempfile() succeeds, in
the next version.