Browse Source

remove .git/gitweb

I don't think this is a security issue, but it has no business being
distributed in debian source packages.
Joey Hess 19 years ago
parent
commit
f973b85582
1 changed files with 10 additions and 0 deletions
  1. 10 0
      scripts/Dpkg/Source/VCS/git.pm

+ 10 - 0
scripts/Dpkg/Source/VCS/git.pm

@@ -168,6 +168,11 @@ sub prep_tar {
 	$? && main::subprocerr("rm -rf .git/logs");
 	$? && main::subprocerr("rm -rf .git/logs");
 	system("git-gc", "--prune");
 	system("git-gc", "--prune");
 	$? && main::subprocerr("git-gc --prune");
 	$? && main::subprocerr("git-gc --prune");
+	
+	# .git/gitweb is created and used by git-instaweb and should not be
+	# transferwed by source package.
+	system("rm", "-rf", ".git/gitweb");
+	$? && main::subprocerr("rm -rf .git/gitweb");
 
 
 	# As an optimisation, remove the index. It will be recreated by git
 	# As an optimisation, remove the index. It will be recreated by git
 	# reset during unpack. It's probably small, but you never know, this
 	# reset during unpack. It's probably small, but you never know, this
@@ -243,6 +248,11 @@ sub post_unpack_tar {
 		close GIT_CONFIG;
 		close GIT_CONFIG;
 	}
 	}
 
 
+	# .git/gitweb is created and used by git-instaweb and should not be
+	# transferwed by source package.
+	system("rm", "-rf", ".git/gitweb");
+	$? && main::subprocerr("rm -rf .git/gitweb");
+
 	# git-checkout is used to repopulate the WC with files
 	# git-checkout is used to repopulate the WC with files
 	# and recreate the index.
 	# and recreate the index.
 	system("git-checkout", "-f");
 	system("git-checkout", "-f");