git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Riddell\, Matthew A" <mriddell@paychex.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 11:32:21 -0700	[thread overview]
Message-ID: <xmqqsgesns22.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <MN2PR02MB66232254F5F4BE27F21C441CD89B0@MN2PR02MB6623.namprd02.prod.outlook.com> (Matthew A. Riddell's message of "Thu, 18 Jun 2020 13:13:57 +0000")

"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.

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.

  reply	other threads:[~2020-06-18 18:32 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 [this message]
2020-06-18 20:30   ` Randall S. Becker
2020-06-18 20:57     ` Riddell, Matthew A
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=xmqqsgesns22.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mriddell@paychex.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).