git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] fatal: transport 'file' not allowed during submodule add
@ 2022-12-27 23:00 rsbecker
  2022-12-28  3:34 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: rsbecker @ 2022-12-27 23:00 UTC (permalink / raw)
  To: git

As of 2.39.0, I am now getting fatal: transport 'file' not allowed when
performing a submodule add after a clone -l. The simple reproduce of this
is:

1. Start with an empty bare repository, src.git.
2. Create an empty non-bare repository and set the upstream remote to the
bare repo.
3. Populate the non-bare repository with:
	touch .gitignore &&
	git add .gitignore &&
	touch file1 &&
	git add file1 &&
	git commit -m initial &&
	git remote add origin ../src.git &&
	git push --set-upstream origin master
4. Create another empty bare repository to be used as the submodule,
subsrc.git.
5. Create another empty non-bare repository and set the upstream remote to
the bare repo for the submodule.
6. Populate the non-bare submodule repository with
	touch .gitignore &&
	git add .gitignore &&
	git commit -m initial &&
	git add .gitignore &&
	touch file2 &&
	git add file2 &&
	git commit -m initial &&
	git remote add origin ../subsrc.git &&
	git push --set-upstream origin master
7. Clone the main repo using -l or without it (makes no difference):
	git clone -l src.git dest
8. Attempt to add the submodule:
	cd dest &&
	git submodule add -- ../subsrc.git subsrc

This results in:
Cloning into 'dest'...
done.
Cloning into '/home/randall/dest/subsrc'...
fatal: transport 'file' not allowed
fatal: clone of '/home/randall/subsrc.git' into submodule path
'/home/randall/dest/subsrc' failed

This happens for any submodule add on the same system. Some online research
indicates that there was a security patch to git causing this, but I can't
find it. This does not seem correct to me or how this improves security.
Help please - this is causing some of my workflows to break.

Thanks,
Randall
--
Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)
NonStop(211288444200000000)
-- In real life, I talk too much.




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

end of thread, other threads:[~2023-01-03  8:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 23:00 [BUG] fatal: transport 'file' not allowed during submodule add rsbecker
2022-12-28  3:34 ` Junio C Hamano
2022-12-28 14:42   ` rsbecker
2022-12-28 22:10     ` Jonathan Nieder
2022-12-28 22:25       ` rsbecker
2022-12-30 21:08       ` Taylor Blau
2022-12-30 21:48         ` rsbecker
2023-01-03  8:57         ` Jeff King
2022-12-30 21:04     ` Taylor Blau
2022-12-30 21:43       ` rsbecker
2022-12-30 23:16       ` rsbecker
2022-12-30 20:15   ` rsbecker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).