<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/daemon.c, branch v1.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2006-02-06T00:51:01Z</updated>
<entry>
<title>daemon: extend user-relative path notation.</title>
<updated>2006-02-06T00:51:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-02-05T06:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=603968d22b19d1b98ff355cc32575a4d9845c151'/>
<id>urn:sha1:603968d22b19d1b98ff355cc32575a4d9845c151</id>
<content type='text'>
Earlier, we made --base-path to automatically forbid
user-relative paths, which was probably a mistake.  This
introduces --user-path (or --user-path=path) option to control
the use of user-relative paths independently.  The latter form
of the option can be used to restrict accesses to a part of each
user's home directory, similar to "public_html" some webservers
supports.

If we're invoked with --user-path=FOO option, then a URL of the
form git://~USER/PATH/... resolves to the path HOME/FOO/PATH/...,
where HOME is USER's home directory.

[jc: This is much reworked by me so bugs are mine, but the
 original patch was done by Mark Wooding.]

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>daemon: Set SO_REUSEADDR on listening sockets.</title>
<updated>2006-02-06T00:51:01Z</updated>
<author>
<name>Mark Wooding</name>
<email>mdw@distorted.org.uk</email>
</author>
<published>2006-02-03T20:27:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1955fabf4194f3629e028778d0081bb2aa16c06c'/>
<id>urn:sha1:1955fabf4194f3629e028778d0081bb2aa16c06c</id>
<content type='text'>
Without this, you can silently lose the ability to receive IPv4
connections if you stop and restart the daemon.

[jc: tweaked code organization a bit and made this controllable
 from a command line option.]

Signed-off-by: Mark Wooding &lt;mdw@distorted.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>daemon: do not forbid user relative paths unconditionally under --base-path</title>
<updated>2006-02-06T00:51:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-02-04T07:50:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=363f24c93695d26f5af584e99093689077b1c7dd'/>
<id>urn:sha1:363f24c93695d26f5af584e99093689077b1c7dd</id>
<content type='text'>
Using base-path to relocate the server public space does not
have anything to do with allowing or forbidding user relative
paths.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>daemon: Provide missing argument for logerror() call.</title>
<updated>2006-02-04T07:33:20Z</updated>
<author>
<name>Mark Wooding</name>
<email>mdw@distorted.org.uk</email>
</author>
<published>2006-02-03T20:27:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fda3d557b7c9e19e008c3a3d77f1922341796d7'/>
<id>urn:sha1:1fda3d557b7c9e19e008c3a3d77f1922341796d7</id>
<content type='text'>
Could cause a crash if --base-path set.  Unlikely to be a security the
concern: message doesn't go to the client, so we can't leak anything
(except by dumping core), and we've already forked, so it's not a denial
of service.

Signed-off-by: Mark Wooding &lt;mdw@distorted.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Exec git programs without using PATH.</title>
<updated>2006-01-14T00:49:01Z</updated>
<author>
<name>Michal Ostrowski</name>
<email>mostrows@watson.ibm.com</email>
</author>
<published>2006-01-11T02:12:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77cb17e940c806a4cc811bfd66187277b729a1e7'/>
<id>urn:sha1:77cb17e940c806a4cc811bfd66187277b729a1e7</id>
<content type='text'>
The git suite may not be in PATH (and thus programs such as
git-send-pack could not exec git-rev-list).  Thus there is a need for
logic that will locate these programs.  Modifying PATH is not
desirable as it result in behavior differing from the user's
intentions, as we may end up prepending "/usr/bin" to PATH.

- git C programs will use exec*_git_cmd() APIs to exec sub-commands.
- exec*_git_cmd() will execute a git program by searching for it in
  the following directories:
	1. --exec-path (as used by "git")
	2. The GIT_EXEC_PATH environment variable.
	3. $(gitexecdir) as set in Makefile (default value $(bindir)).
- git wrapper will modify PATH as before to enable shell scripts to
  invoke "git-foo" commands.

Ideally, shell scripts should use the git wrapper to become independent
of PATH, and then modifying PATH will not be necessary.

[jc: with minor updates after a brief review.]

Signed-off-by: Michal Ostrowski &lt;mostrows@watson.ibm.com&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>git-daemon --base-path</title>
<updated>2006-01-08T05:43:02Z</updated>
<author>
<name>Petr Baudis</name>
<email>pasky@suse.cz</email>
</author>
<published>2005-12-23T01:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b21c31c9a5edfd90d6f85481517f979352da4eed'/>
<id>urn:sha1:b21c31c9a5edfd90d6f85481517f979352da4eed</id>
<content type='text'>
Tommi Virtanen expressed a wish on #git to be able to use short and elegant
git URLs by making git-daemon 'root' in a given directory. This patch
implements this, causing git-daemon to interpret all paths relative to
the given base path if any is given.

Signed-off-by: Petr Baudis &lt;pasky@suse.cz&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>[PATCH] daemon.c and path.enter_repo(): revamp path validation.</title>
<updated>2005-12-04T07:17:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-12-03T09:45:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d79374c7b58d3814ffdc277de608243f8e665e3a'/>
<id>urn:sha1:d79374c7b58d3814ffdc277de608243f8e665e3a</id>
<content type='text'>
The whitelist of git-daemon is checked against return value from
enter_repo(), and enter_repo() used to return the value obtained
from getcwd() to avoid directory aliasing issues as discussed
earier (mid October 2005).

Unfortunately, it did not go well as we hoped.

For example, /pub on a kernel.org public machine is a symlink to
its real mountpoint, and it is understandable that the
administrator does not want to adjust the whitelist every time
/pub needs to point at a different partition for storage
allcation or whatever reasons.  Being able to keep using
/pub/scm as the whitelist is a desirable property.

So this version of enter_repo() reports what it used to chdir()
and validate, but does not use getcwd() to canonicalize the
directory name.  When it sees a user relative path ~user/path,
it internally resolves it to try chdir() there, but it still
reports ~user/path (possibly after appending .git if allowed to
do so, in which case it would report ~user/path.git).

What this means is that if a whitelist wants to allow a user
relative path, it needs to say "~" (for all users) or list user
home directories like "~alice" "~bob".  And no, you cannot say
/home if the advertised way to access user home directories are
~alice,~bob, etc.  The whole point of this is to avoid
unnecessary aliasing issues.

Anyway, because of this, daemon needs to do a bit more work to
guard itself.  Namely, it needs to make sure that the accessor
does not try to exploit its leading path match rule by inserting
/../ in the middle or hanging /.. at the end.  I resurrected the
belts and suspender paranoia code HPA did for this purpose.

This check cannot be done in the enter_repo() unconditionally,
because there are valid callers of enter_repo() that want to
honor /../; authorized users coming over ssh to run send-pack
and fetch-pack should be allowed to do so.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>git-daemon not listening when compiled with -DNO_IPV6</title>
<updated>2005-11-21T22:36:43Z</updated>
<author>
<name>Paul Serice</name>
<email>paul@serice.net</email>
</author>
<published>2005-11-21T17:07:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f35230fb1123a0db4776c574a874aecec1f38db8'/>
<id>urn:sha1:f35230fb1123a0db4776c574a874aecec1f38db8</id>
<content type='text'>
git-daemon was not listening when compiled with -DNO_IPV6.
socksetup() was not returning socket count when compiled with -DNO_IPV6.

Signed-off-by: Paul Serice &lt;paul@serice.net&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>daemon: further tweaks.</title>
<updated>2005-11-21T21:47:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-11-21T09:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce335fe04f32261e0204280281989ffbb5d990c6'/>
<id>urn:sha1:ce335fe04f32261e0204280281989ffbb5d990c6</id>
<content type='text'>
 - Do validation only on canonicalized paths
 - Run upload-pack with "." as repository argument

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>git-daemon support for user-relative paths.</title>
<updated>2005-11-21T21:47:00Z</updated>
<author>
<name>Andreas Ericsson</name>
<email>exon@op5.se</email>
</author>
<published>2005-11-17T19:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4dbd13527933261076bbed1a5a2daa60a752d096'/>
<id>urn:sha1:4dbd13527933261076bbed1a5a2daa60a752d096</id>
<content type='text'>
Dropped a fair amount of reundant code in favour of the library code
in path.c

Added option --strict-paths with documentation, with backwards
compatibility for whitelist entries with symlinks.

Everything that worked earlier still works insofar as I have
remembered testing it.

Signed-off-by: Andreas Ericsson &lt;ae@op5.se&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
