git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "make quick-install-man" broke recently

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 17, 2009, 16:34 UTC
Message-ID
<alpine.LFD.2.01.0908170932390.3162@localhost.localdomain>
In-Reply-To
<7vhbw72ap3.fsf@alter.siamese.dyndns.org>
On Sun, 16 Aug 2009, Junio C Hamano wrote:
Show 29 quoted lines
>
> -/* "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
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 13 in “"make quick-install-man" broke recently”
  1. Randal L. SchwartzAug 17, 2009
  2. Junio C HamanoAug 17, 2009
  3. Randal L. SchwartzAug 17, 2009
  4. Junio C HamanoAug 17, 2009
  5. Jacob HelwigAug 17, 2009
  6. Randal L. SchwartzAug 17, 2009
  7. Junio C HamanoAug 17, 2009
  8. Johannes SixtAug 17, 2009
  9. Junio C HamanoAug 17, 2009
  10. Randal L. SchwartzAug 17, 2009
  11. Junio C HamanoAug 17, 2009
  12. Linus TorvaldsAug 17, 2009
  13. Junio C HamanoAug 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.