Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Introduce core.sharedrepository
Date: Thu, 22 Dec 2005 14:40:51 -0800	[thread overview]
Message-ID: <7vaceshi18.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0512222313070.12044@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Thu, 22 Dec 2005 23:13:56 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> +static int make_group_writable(const char *path)
> +{
> +	struct stat st;
> +
> +	if (lstat(path, &st) < 0)
> +		return -1;
> +	if (st.st_mode & S_IWUSR)
> +		st.st_mode |= S_IWGRP;
> +	if (S_ISDIR(st.st_mode))
> +		st.st_mode |= S_ISGID;
> +	if (chmod(path, st.st_mode) < 0)
> +		return -2;
> +	return 0;
> +}

Perhaps g+sx not just g+s on directories.

> +
>  int safe_create_leading_directories(char *path)
>  {
>  	char *pos = path;
> @@ -64,6 +79,10 @@ int safe_create_leading_directories(char
>  				*pos = '/';
>  				return -1;
>  			}
> +		if (shared_repository && make_group_writable(path)) {
> +			*pos = '/';
> +			return -2;
> +		}

Wouldn't this safe_create_leading_directories("/pub/git.git/objects")
try chmod "/pub" and fail?

  reply	other threads:[~2005-12-22 22:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-22 22:13 [PATCH] Introduce core.sharedrepository Johannes Schindelin
2005-12-22 22:40 ` Junio C Hamano [this message]
2005-12-22 22:59   ` Johannes Schindelin
2005-12-22 23:04     ` Johannes Schindelin
2005-12-23  9:10       ` Junio C Hamano
2005-12-23 10:42         ` Johannes Schindelin
2005-12-23 11:07           ` Johannes Schindelin

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=7vaceshi18.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox