git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Riddell, Matthew A" <mriddell@paychex.com>
To: "Randall S. Becker" <rsbecker@nexbridge.com>,
	'Junio C Hamano' <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: RE: Git config command ignores explicitly set file permissions
Date: Thu, 18 Jun 2020 20:57:27 +0000	[thread overview]
Message-ID: <MN2PR02MB66237FBAE6695D80B1182BA5D89B0@MN2PR02MB6623.namprd02.prod.outlook.com> (raw)
In-Reply-To: <022601d645af$45d0e640$d172b2c0$@nexbridge.com>

> "Riddell, Matthew A" <mriddell@paychex.com> writes:
> > I noticed while working with Git that the file permissions on the 
> > gitconfig file is ignored and the parent folder permissions are used 
> > instead to update the file.  An example is as follows:
> >
> > Before running git config ensure the user running the command is not 
> > able to edit the file but has read access to the file. Ensure the 
> > User has full access to the parent folder.  After running any git 
> > config command the user previously without edit permissions on a 
> > file can now edit the config file.

>>Forgive me to asking, but is this an attempt at replicating what other VCS systems do? ClearCase is an example where files are forced to read-only and if the user wants to modify it, then they have to ask nicely for a >>lock on the file. The use of "read only" is a semi-guarantee that a user will not modify code and interfere with other users. In git, the rules are quite different, where modification resolution occurs later in the process.

We have had problems in our continuous integration environment with builds modifying the global configuration of tools. I came across this issue trying to lock down our git global configuration for the local user running our builds. The workaround I found is creating a symlink from the user home directory to another folder (which has read only permissions) which contains the actual gitconfig file.

-----Original Message-----
From: Randall S. Becker <rsbecker@nexbridge.com> 
Sent: Thursday, June 18, 2020 4:30 PM
To: 'Junio C Hamano' <gitster@pobox.com>; Riddell, Matthew A <mriddell@paychex.com>
Cc: git@vger.kernel.org
Subject: RE: Git config command ignores explicitly set file permissions


Warning: This email is from outside the company. Be careful clicking links or attachments.

On June 18, 2020 2:32 PM, Junio C Hamano wrote:
> "Riddell, Matthew A" <mriddell@paychex.com> writes:
> > I noticed while working with Git that the file permissions on the 
> > gitconfig file is ignored and the parent folder permissions are used 
> > instead to update the file.  An example is as follows:
> >
> > Before running git config ensure the user running the command is not 
> > able to edit the file but has read access to the file. Ensure the 
> > User has full access to the parent folder.  After running any git 
> > config command the user previously without edit permissions on a 
> > file can now edit the config file.

Forgive me to asking, but is this an attempt at replicating what other VCS systems do? ClearCase is an example where files are forced to read-only and if the user wants to modify it, then they have to ask nicely for a lock on the file. The use of "read only" is a semi-guarantee that a user will not modify code and interfere with other users. In git, the rules are quite different, where modification resolution occurs later in the process.

> That is pretty much how things are intended to work on a filesystem 
> and is not limited to Git.  Your arrangement, contrary to what you 
> said, does not "ensure the user running the command is not able to 
> edit but has read access".
> 
>     mkdir newdir
>     chmod +rwx newdir
>     >newdir/file
>     chmod a-w newdir/file
> 
> would not forbid you from doing
> 
>     rm -f newdir/file
>     ehco new >newdir/file
> 
> In other words, if you allow your user to write to a directory, you 
> cannot forbid the user from creating and removing files in it.

Just inquiring about this, as git operational decisions are fundamentally different from older systems.

Regards,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000  UNIX developer since approximately 421664400
-- In my real life, I talk too much.



----------------------------------------------------------------------
The information contained in this message may be privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify your representative immediately and delete this message from your computer. Thank you.

  reply	other threads:[~2020-06-18 21:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 13:13 Git config command ignores explicitly set file permissions Riddell, Matthew A
2020-06-18 18:32 ` Junio C Hamano
2020-06-18 20:30   ` Randall S. Becker
2020-06-18 20:57     ` Riddell, Matthew A [this message]
2020-06-18 21:37       ` Randall S. Becker

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=MN2PR02MB66237FBAE6695D80B1182BA5D89B0@MN2PR02MB6623.namprd02.prod.outlook.com \
    --to=mriddell@paychex.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rsbecker@nexbridge.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).