git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Karsten Blees <karsten.blees@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stepan Kasal <kasal@ucw.cz>, Johannes Sixt <j6t@kdbg.org>,
	GIT Mailing-list <git@vger.kernel.org>,
	msysGit <msysgit@googlegroups.com>
Subject: Re: [PATCH 2/2] config: use chmod() instead of fchmod()
Date: Thu, 17 Jul 2014 10:57:58 +0200	[thread overview]
Message-ID: <53C79016.2020303@gmail.com> (raw)
In-Reply-To: <xmqqlhrtq7a7.fsf@gitster.dls.corp.google.com>

Am 17.07.2014 00:16, schrieb Junio C Hamano:
> Karsten Blees <karsten.blees@gmail.com> writes:
> 
>> There is no fchmod() on native Windows platforms (MinGW and MSVC), and the
>> equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista.
>>
>> Use chmod() instead.
>>
>> Signed-off-by: Karsten Blees <blees@dcon.de>
>> ---
> 
> I am wondering if it is saner to just revert the fchmod() patch and
> replace it with something along the lines of
> 
> http://thread.gmane.org/gmane.comp.version-control.git/251682/focus=253219
> 

I also think it makes a lot of sense to handle permissions centrally.

However, with this patch, the permissions of the target file will
additionally be limited by umask (by passing them to open()), and then
overridden completely if core.sharedRepository is set.

Perhaps the lockfile API should respect the location of the lock files
(i.e. use core.sharedRepository in .git, 0666 in the work-tree, and
copy permissions anywhere else).

Another thing I find strange is that, by doing copy/replace, git silently
overwrites readonly files. If we grab the permissions from the source
file anyway, we should perhaps add 'if (!(perms & 0222)) error("file
is readonly");', or even 'access(filename, W_OK)'?

> Having said that, these are the only two callers of fchmod()
> currently in our code base, so I'll queue this patch to allow us to
> kick the problem-can down the road ;-)
> 

Thanks.

  reply	other threads:[~2014-07-17  8:58 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 20:05 Topic sk/mingw-unicode-spawn-args breaks tests Johannes Sixt
2014-07-11 19:49 ` Karsten Blees
2014-07-12  7:50   ` Stepan Kasal
2014-07-15  0:21     ` Johannes Schindelin
2014-07-15 13:43     ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-15 13:43       ` [PATCH 1/3] Win32: Unicode file name support (except dirent) Stepan Kasal
2014-07-15 13:43       ` [PATCH 2/3] Win32: Unicode file name support (dirent) Stepan Kasal
2014-07-15 13:43       ` [PATCH 3/3] tests: do not pass iso8859-1 encoded parameter Stepan Kasal
2014-07-15 13:53       ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-15 18:20       ` Junio C Hamano
2014-07-15 22:52         ` Karsten Blees
2014-07-15 22:53           ` [PATCH 1/2] MinGW: fix compile error due to missing ELOOP Karsten Blees
2014-07-15 23:42             ` Jonathan Nieder
2014-07-15 23:57               ` Karsten Blees
2014-07-16 17:43             ` Junio C Hamano
2014-07-15 22:54           ` [PATCH 2/2] config: use chmod() instead of fchmod() Karsten Blees
2014-07-16  5:33             ` Johannes Sixt
2014-07-16 10:53               ` Karsten Blees
2014-07-16 22:16             ` Junio C Hamano
2014-07-17  8:57               ` Karsten Blees [this message]
2014-07-16  9:29           ` [PATCH 0/3] fix test suite with mingw-unicode patches Stepan Kasal
2014-07-16 11:01             ` Thomas Braun
2014-07-17 15:36             ` [PATCH 0/6] mingw test fixes Stepan Kasal
2014-07-17 15:37               ` [PATCH 1/6] MinGW: Skip test redirecting to fd 4 Stepan Kasal
2014-07-17 18:41                 ` Junio C Hamano
2014-07-17 20:06                   ` Johannes Schindelin
2014-07-17 20:18                   ` Karsten Blees
2014-07-17 20:38                     ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 2/6] Disable t0110's high-bit test on Windows Stepan Kasal
2014-07-17 18:20                 ` Karsten Blees
2014-07-18 18:26                   ` Junio C Hamano
2014-07-19 19:37                     ` [PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line Karsten Blees
2014-07-21 16:41                       ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 3/6] MinGW: disable legacy encoding tests Stepan Kasal
2014-07-17 15:37               ` [PATCH 4/6] t4210: skip command-line encoding tests on mingw Stepan Kasal
2014-07-18  9:52                 ` Erik Faye-Lund
2014-07-21 16:59                   ` Junio C Hamano
2014-07-21 17:45                     ` Johannes Schindelin
2014-07-21 19:21                       ` Johannes Sixt
2014-07-21 20:07                     ` Junio C Hamano
2014-07-21 22:29                       ` Junio C Hamano
2014-07-21 22:39                         ` Junio C Hamano
2014-07-21 22:30                       ` [PATCH 2/2] test prerequisites: enumerate with commas Junio C Hamano
2014-07-17 15:37               ` [PATCH 5/6] t9902: mingw-specific fix for gitfile link files Stepan Kasal
2014-07-17 20:42                 ` Junio C Hamano
2014-07-17 15:37               ` [PATCH 6/6] t800[12]: work around MSys limitation Stepan Kasal

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=53C79016.2020303@gmail.com \
    --to=karsten.blees@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=kasal@ucw.cz \
    --cc=msysgit@googlegroups.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).