git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: William Pursell <bill.pursell@gmail.com>
Cc: Alex Riesen <raa.lkml@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Andreas Schwab <schwab@linux-m68k.org>, <git@vger.kernel.org>
Subject: Re: permissions
Date: Wed, 9 Jun 2010 14:06:50 +0200	[thread overview]
Message-ID: <201006091406.50955.trast@student.ethz.ch> (raw)
In-Reply-To: <4C0F6CF0.3020603@wpursell.net>

William Pursell wrote:
> Alex Riesen wrote:
> > On Wed, Jun 9, 2010 at 00:27, William Pursell <bill.pursell@gmail.com> wrote:
> >> Junio C Hamano wrote:
> >>> Alex Riesen <raa.lkml@gmail.com> writes:
> >>>
> >>>> The patch moves the function is_git_directory at the level of user
> >>>> interface where it wasn't before: it now complains and die.
> >>>> Not all callers of the function call it only to die if it fails.
> >>> Thanks for shooting it down before I had to look at it ;-)
> >> The point of the patch is that it now complains and dies.
> > 
> > At wrong point. Points, actually. There are many callers of the
> > function you modified. You should have looked at them all.
> 
> I did look at all 4 calls, and it seemed to me
> that localizing the change in one location is a better
> design than adding logic to 4 different locations.
> 
> >> Perhaps I'm being obtuse, but can you describe a situation
> >> in which this causes git to terminate inappropriately?
> > 
> > Maybe. BTW, can you? (if you try, I mean).
> 
> No, I can't.  As far as I can tell, the patch adds
> exactly the functionality that I want it to add.  You
> do make good points about its problems below, however,
> and you are right that I did miss the point of
> your criticism.  Thank you for clarifying.

Maybe I'm missing something, but I think that also apart from any
meta-criticism the patch is wrong.  From the use of
setup_git_directory_gently() in cmd_apply() [for example; there are
other commands that are supposed to work both in- and outside of
repos], I conclude that the invocation of is_git_directory() must not
die() because it is *okay* if the directory is, after all, not a git
repo.

And I think the same goes for your new patch

> @@ -407,6 +413,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
>                 }
>                 if (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))
>                         break;
> +               if (access(DEFAULT_GIT_DIR_ENVIRONMENT, X_OK)
> +                                && errno != ENOENT )
> +                       die_errno("Unable to access %s/%s",
> +                                cwd, DEFAULT_GIT_DIR_ENVIRONMENT);
> +
>                 if (is_git_directory(".")) {
>                         inside_git_dir = 1;
>                         if (!work_tree_env)

[DEFAULT_GIT_DIR_ENVIRONMENT is ".git"]

Unless I'm missing something, this effectively prevents git-apply and
friends from working outside any repos if your BOFH sysadmin thinks it
funny to place an unreadable .git somewhere on the way up to /.

Or maybe we don't care about BOFH ideas?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2010-06-09 12:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05  9:33 permissions William Pursell
2010-06-05  9:50 ` permissions Andreas Schwab
2010-06-05 18:23   ` permissions William Pursell
2010-06-06  6:45     ` permissions Alex Riesen
2010-06-06  9:36       ` permissions William Pursell
2010-06-06 12:45         ` permissions Alex Riesen
2010-06-06 19:54         ` permissions Junio C Hamano
2010-06-08 10:25           ` permissions William Pursell
2010-06-08 14:52             ` permissions Alex Riesen
2010-06-08 21:05               ` permissions Junio C Hamano
2010-06-08 22:27                 ` permissions William Pursell
2010-06-09  7:20                   ` permissions Alex Riesen
2010-06-09 10:29                     ` permissions William Pursell
2010-06-09 12:06                       ` Thomas Rast [this message]
2010-06-09 13:00                         ` permissions Alex Riesen
2010-06-09 12:56                       ` permissions Alex Riesen
2010-06-09 10:39                     ` permissions Steven Michalske

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=201006091406.50955.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=bill.pursell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raa.lkml@gmail.com \
    --cc=schwab@linux-m68k.org \
    /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).