Git development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jacob Helwig <jacob.helwig@gmail.com>,
	Kjetil Barvik <barvik@broadpark.no>,
	"Randal L. Schwartz" <merlyn@stonehenge.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: "make quick-install-man" broke recently
Date: Mon, 17 Aug 2009 09:34:23 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908170932390.3162@localhost.localdomain> (raw)
In-Reply-To: <7vhbw72ap3.fsf@alter.siamese.dyndns.org>



On Sun, 16 Aug 2009, Junio C Hamano wrote:
>
> -/* "careful lstat()" */
> -extern int check_path(const char *path, int len, struct stat *st);
> -
>  #define REFRESH_REALLY		0x0001	/* ignore_valid */
>  #define REFRESH_UNMERGED	0x0002	/* allow unmerged */
>  #define REFRESH_QUIET		0x0004	/* be quiet about it */
> diff --git a/entry.c b/entry.c
> index f276cf3..6813f8a 100644
> --- a/entry.c
> +++ b/entry.c
> @@ -179,9 +179,18 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
>   * This is like 'lstat()', except it refuses to follow symlinks
>   * in the path.
>   */
> -int check_path(const char *path, int len, struct stat *st)
> +static int check_path(const char *path, int len, struct stat *st,
> +		      const struct checkout *co)
>  {
> -	if (has_symlink_leading_path(path, len)) {
> +	if (co->base_dir_len) {
> +		const char *slash = path + len;
> +		while (path < slash && *slash != '/')
> +			slash--;
> +		if (!has_dirs_only_path(path, slash-path, co->base_dir_len)) {
> +			errno = ENOENT;
> +			return -1;
> +		}
> +	} else if (has_symlink_leading_path(path, len)) {

Grr. Now 'check_path()' is no longer something generically useful.

Could you perhaps instead only change 'checkout_entry()' to do this hack, 
and leave 'check_path()' as a generic replacement for "lstat()" that 
doesn't follow symlinks?

		Linus

  parent reply	other threads:[~2009-08-17 16:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17  1:16 "make quick-install-man" broke recently Randal L. Schwartz
2009-08-17  1:29 ` Junio C Hamano
2009-08-17  1:33   ` Randal L. Schwartz
2009-08-17  5:17     ` Junio C Hamano
2009-08-17  5:58       ` Jacob Helwig
2009-08-17  6:01         ` Randal L. Schwartz
2009-08-17  6:53         ` Junio C Hamano
2009-08-17  8:00           ` Johannes Sixt
2009-08-17  8:02             ` Junio C Hamano
2009-08-17 14:26           ` Randal L. Schwartz
2009-08-17 15:57             ` Junio C Hamano
2009-08-17 16:34           ` Linus Torvalds [this message]
2009-08-17 17:09             ` Junio C Hamano

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0908170932390.3162@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=barvik@broadpark.no \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.helwig@gmail.com \
    --cc=merlyn@stonehenge.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox