<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/path.c, branch v1.0rc6</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.0rc6</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.0rc6'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2005-12-04T07:17:42Z</updated>
<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.stealer.net/cgit.cgi/user/sven/git.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>Check repository format version in enter_repo().</title>
<updated>2005-11-27T09:32:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-11-25T18:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=1644162ad53da1d0107c5c45c866e75ef95660bb'/>
<id>urn:sha1:1644162ad53da1d0107c5c45c866e75ef95660bb</id>
<content type='text'>
After daemon, upload-pack and receive-pack find out where the
git directory is and chdir() there, make sure that repository is
in a format we understand, after putenv("GIT_DIR=.") so that it
knows to pick up the configuration file from there.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix "do not DWIM" patch to enter_repo"</title>
<updated>2005-11-21T07:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-11-21T07:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e0a87193d3f2b78b7b687405c0315e1517d36912'/>
<id>urn:sha1:e0a87193d3f2b78b7b687405c0315e1517d36912</id>
<content type='text'>
We wanted --strict to mean "do not DWIM", but the code required to
see absolute path.  daemon does its own path verification and chdirs
to the verified repository, so enter_repo() called from upload-pack
will always enter ".".  Requiring absolute path does not make any sense.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix sparse warnings</title>
<updated>2005-11-21T06:14:16Z</updated>
<author>
<name>Timo Hirvonen</name>
<email>tihirvon@gmail.com</email>
</author>
<published>2005-11-21T00:52:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bd22c904a0f1c88a3a7bfa96bbf690de2f5cb278'/>
<id>urn:sha1:bd22c904a0f1c88a3a7bfa96bbf690de2f5cb278</id>
<content type='text'>
Make some functions static and convert func() function prototypes to to
func(void).  Fix declaration after statement, missing declaration and
redundant declaration warnings.

Signed-off-by: Timo Hirvonen &lt;tihirvon@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Do not DWIM in userpath library under strict mode.</title>
<updated>2005-11-20T04:50:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-11-18T22:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=0870ca7fabe6f25095431280e480859f7c66e8ab'/>
<id>urn:sha1:0870ca7fabe6f25095431280e480859f7c66e8ab</id>
<content type='text'>
This should force git-daemon administrator's job a bit harder
because the exact paths need to be given in the whitelist, but
at the same time makes the auditing easier.

This moves validate_symref() from refs.c to path.c, because we
need to link path.c with git-daemon for its "enter_repo()", but
we do not want to link the daemon with the rest of git libraries
and its requirements.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Library code for user-relative paths, take three.</title>
<updated>2005-11-20T04:50:37Z</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.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=54f4b87454824fedc629219620ce9b7cdcab3d27'/>
<id>urn:sha1:54f4b87454824fedc629219620ce9b7cdcab3d27</id>
<content type='text'>
This patch provides the work-horse of the user-relative paths feature,
using Linus' idea of a blind chdir() and getcwd() which makes it
remarkably simple.

Signed-off-by: Andreas Ericsson &lt;ae@op5.se&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>[PATCH] Provide access to git_dir through get_git_dir().</title>
<updated>2005-09-27T07:16:39Z</updated>
<author>
<name>Sven Verdoolaege</name>
<email>skimo@kotnet.org</email>
</author>
<published>2005-09-26T20:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5da1606d0bf5b970fadfa0ca91618a1e871f6755'/>
<id>urn:sha1:5da1606d0bf5b970fadfa0ca91618a1e871f6755</id>
<content type='text'>
Signed-off-by: Sven Verdoolaege &lt;skimo@kotnet.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Retire support for old environment variables.</title>
<updated>2005-09-09T21:48:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-09-09T21:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a9ab586a5db015d200dfdadcf5876d62f15dd36c'/>
<id>urn:sha1:a9ab586a5db015d200dfdadcf5876d62f15dd36c</id>
<content type='text'>
We have deprecated the old environment variable names for quite a
while and now it's time to remove them.  Gone are:

    SHA1_FILE_DIRECTORIES AUTHOR_DATE AUTHOR_EMAIL AUTHOR_NAME
    COMMIT_AUTHOR_EMAIL COMMIT_AUTHOR_NAME SHA1_FILE_DIRECTORY

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix ?: statements.</title>
<updated>2005-08-24T03:41:12Z</updated>
<author>
<name>Jason Riedy</name>
<email>ejr@cs.berkeley.edu</email>
</author>
<published>2005-08-23T20:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c7c81b3a51de2778535c8bb18d42a4bb7dfd57bc'/>
<id>urn:sha1:c7c81b3a51de2778535c8bb18d42a4bb7dfd57bc</id>
<content type='text'>
Omitting the first branch in ?: is a GNU extension.  Cute,
but not supported by other compilers.  Replaced mostly
by explicit tests.  Calls to getenv() simply are repeated
on non-GNU compilers.

Signed-off-by: Jason Riedy &lt;ejr@cs.berkeley.edu&gt;
</content>
</entry>
<entry>
<title>[PATCH] git_mkstemp() fix</title>
<updated>2005-08-09T05:51:44Z</updated>
<author>
<name>Holger Eitzenberger</name>
<email>holger@my-eitzenberger.de</email>
</author>
<published>2005-08-08T20:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=35c3c6298308563a3dd4a5c4bb0870748833643f'/>
<id>urn:sha1:35c3c6298308563a3dd4a5c4bb0870748833643f</id>
<content type='text'>
git_mkstemp() attempted to use TMPDIR environment variable, but it botched
copying the templates.

[jc: Holger, please add your own Signed-off-by line, and also if you can,
send in future patches as non attachments.]

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