<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.c, branch v1.4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.4.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.4.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2006-06-25T06:16:25Z</updated>
<entry>
<title>Rename safe_strncpy() to strlcpy().</title>
<updated>2006-06-25T06:16:25Z</updated>
<author>
<name>Peter Eriksen</name>
<email>s022018@student.dtu.dk</email>
</author>
<published>2006-06-24T14:01:25Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=817151e61a74241df5b5dd206d27086283f28b84'/>
<id>urn:sha1:817151e61a74241df5b5dd206d27086283f28b84</id>
<content type='text'>
This cleans up the use of safe_strncpy() even more.  Since it has the
same semantics as strlcpy() use this name instead.  Also move the
definition from inside path.c to its own file compat/strlcpy.c, and use
it conditionally at compile time, since some platforms already has
strlcpy().  It's included in the same way as compat/setenv.c.

Signed-off-by: Peter Eriksen &lt;s022018@student.dtu.dk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/diff'</title>
<updated>2006-06-18T00:08:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-06-18T00:08:36Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=fc5201ac9f17abf8b70b248b17595f3f3d35c056'/>
<id>urn:sha1:fc5201ac9f17abf8b70b248b17595f3f3d35c056</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement safe_strncpy() as strlcpy() and use it more.</title>
<updated>2006-06-17T05:45:12Z</updated>
<author>
<name>Peter Eriksen</name>
<email>s022018@student.dtu.dk</email>
</author>
<published>2006-06-11T12:03:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e'/>
<id>urn:sha1:bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e</id>
<content type='text'>
Signed-off-by: Peter Eriksen &lt;s022018@student.dtu.dk&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>shared repository: optionally allow reading to "others".</title>
<updated>2006-06-10T08:31:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-06-10T06:09:49Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=94df2506edd76a886a1044376f8c99349b2f226e'/>
<id>urn:sha1:94df2506edd76a886a1044376f8c99349b2f226e</id>
<content type='text'>
This enhances core.sharedrepository to have additionally
specify that read and exec permissions to be given to others as
well.  It is useful when serving a repository via gitweb and
git-daemon that runs as a user outside the project group.

The configuration item can take the following values:

    [core]
	sharedrepository 	 ; the same as "group"
	sharedrepository = true  ; ditto
	sharedrepository = 1	 ; ditto
	sharedrepository = group ; allow rwx to group
	sharedrepository = all   ; allow rwx to group, allow rx to other
	sharedrepository = umask ; not shared - use umask

It also extends "git init-db" to take "--shared=all" and friends
from the command line.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>shared repository - add a few missing calls to adjust_shared_perm().</title>
<updated>2006-06-10T05:15:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-06-10T05:07:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=138086a72582620e0b3ec0aa60a78da208e89a2a'/>
<id>urn:sha1:138086a72582620e0b3ec0aa60a78da208e89a2a</id>
<content type='text'>
There were a few calls to adjust_shared_perm() that were
missing:

 - init-db creates refs, refs/heads, and refs/tags before
   reading from templates that could specify sharedrepository in
   the config file;

 - updating config file created it under user's umask without
   adjusting;

 - updating refs created it under user's umask without
   adjusting;

 - switching branches created .git/HEAD under user's umask
   without adjusting.

This moves adjust_shared_perm() from sha1_file.c to path.c,
since a few SIMPLE_PROGRAM need to call repository configuration
functions which in turn need to call adjust_shared_perm().
sha1_file.c needs to link with SHA1 computation library which
is usually not linked to SIMPLE_PROGRAM.

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://www.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>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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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://www.git.shady.money/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>
</feed>
