git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Be more careful with objects directory permissions on clone
@ 2008-05-04 11:37 Mark Hills
  2008-05-05  9:01 ` Johannes Sixt
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Hills @ 2008-05-04 11:37 UTC (permalink / raw)
  To: git

Honour the setgid and umask when re-creating the objects directory
at the destination.

cpio in copy-pass mode aims to copy file permissions which causes this
problem and cannot be disabled. Be explicit by copying the directory
structure first, honouring the permissions at the destination, then copy
the files with their existing read-only permissions.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
---
  git-clone.sh |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-clone.sh b/git-clone.sh
index 8c7fc7f..53c7e06 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -334,7 +334,10 @@ yes)
  			fi
  		fi &&
  		cd "$repo" &&
-		find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
+		# Create dirs using umask and permissions and destination
+		find objects -type d -print | (cd "$GIT_DIR" && xargs mkdir -p) &&
+		# Copy 0444 permissions on files
+		find objects -type f -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
  			exit 1
  	fi
  	git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
-- 
1.5.5.1.126.g48d0c

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-06  8:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04 11:37 [PATCH] Be more careful with objects directory permissions on clone Mark Hills
2008-05-05  9:01 ` Johannes Sixt
2008-05-05  9:56   ` Mark Hills
2008-05-05 10:07     ` Johannes Sixt
2008-05-05 10:25       ` Mark Hills
2008-05-05 10:42         ` Johannes Sixt
2008-05-05 16:46           ` Mark Hills
2008-05-06  6:53             ` Junio C Hamano
2008-05-06  7:25             ` Jakub Narebski
2008-05-06  8:08               ` Johannes Sixt

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 NNTP newsgroup(s).