1. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  2. 15 2月, 2007 1 次提交
  3. 04 2月, 2007 1 次提交
  4. 29 1月, 2007 1 次提交
    • L
      git-push through git protocol · 4b3b1e1e
      Linus Torvalds 提交于
      This allows pushing over the git:// protocol, and while it's not
      authenticated, it could make sense from within a firewalled
      setup where nobody but trusted internal people can reach the git
      port.  git-daemon is possibly easier and faster to set up in the
      kind of situation where you set up git instead of CVS inside a
      company.
      
      "git-receive-pack" is disabled by default, so you need to enable it
      explicitly by starting git-daemon with the "--enable=receive-pack"
      command line argument, or by having your config enable it automatically.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4b3b1e1e
  5. 09 1月, 2007 1 次提交
  6. 21 12月, 2006 1 次提交
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85023577
  7. 24 10月, 2006 1 次提交
  8. 29 9月, 2006 2 次提交
  9. 28 9月, 2006 2 次提交
  10. 21 9月, 2006 1 次提交
  11. 10 9月, 2006 1 次提交
    • F
      Add git-upload-archive · 39345a21
      Franck Bui-Huu 提交于
      This command implements the git archive protocol on the server
      side. This command is not intended to be used by the end user.
      Underlying git-archive command line options are sent over the
      protocol from "git-archive --remote=...", just like upload-tar
      currently does with "git-tar-tree=...".
      
      As for "git-archive" command implementation, this new command
      does not execute any existing "git-{tar,zip}-tree" but rely
      on the archive API defined by "git-archive" patch. Hence we
      get 2 good points:
      
       - "git-archive" and "git-upload-archive" share all option
         parsing code.
      
       - All kind of git-upload-{tar,zip} can be deprecated.
      Signed-off-by: NFranck Bui-Huu <vagabon.xyz@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      39345a21
  12. 07 9月, 2006 1 次提交
  13. 28 8月, 2006 2 次提交
    • J
      daemon: add upload-tar service. · 74c0cc21
      Junio C Hamano 提交于
      This allows clients to ask for tarballs with:
      
      	git tar-tree --remote=git://server/repo refname
      
      By default, the upload-tar service is not enabled.  To enable
      it server-wide, the server can be started with:
      
      	git-daemon --enable=upload-tar
      
      This service is by default overridable per repostiory, so
      alternatively, a repository can define "daemon.uploadtar = true"
      to enable it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      74c0cc21
    • J
      daemon: prepare for multiple services. · d819e4e6
      Junio C Hamano 提交于
      This adds an infrastructure to selectively enable and disable
      more than one services in git-daemon.  Currently upload-pack
      service, which serves the git-fetch-pack and git-peek-remote
      clients, is the only service that is defined.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d819e4e6
  14. 27 8月, 2006 1 次提交
  15. 23 8月, 2006 1 次提交
  16. 16 8月, 2006 1 次提交
  17. 28 7月, 2006 1 次提交
  18. 14 7月, 2006 4 次提交
  19. 28 6月, 2006 1 次提交
  20. 22 6月, 2006 1 次提交
  21. 21 6月, 2006 1 次提交
  22. 20 6月, 2006 1 次提交
    • J
      Restore SIGCHLD to SIG_DFL where we care about waitpid(). · f0b7367c
      Junio C Hamano 提交于
      It was reported that under one implementation of socks client
      "git clone" fails with "error: waitpid failed (No child processes)",
      because "git" is spawned after setting SIGCHLD to SIG_IGN.
      
      Arguably it may be a broken setting, but we should protect
      ourselves so that we can get reliable results from waitpid() for
      the children we care about.
      
      This patch resets SIGCHLD to SIG_DFL in three places:
      
       - connect.c::git_connect() - initiators of git native
         protocol transfer are covered with this.
      
       - daemon.c::main() - obviously.
      
       - merge-index.c::main() - obviously.
      
      There are other programs that do fork() but do not waitpid():
      http-push, imap-send.  upload-pack does not either, but in the
      case of that program, each of the forked halves runs exec()
      another program, so this change would not have much effect
      there.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f0b7367c
  23. 07 6月, 2006 1 次提交
  24. 25 4月, 2006 1 次提交
  25. 19 4月, 2006 1 次提交
  26. 06 2月, 2006 3 次提交
  27. 04 2月, 2006 1 次提交
  28. 14 1月, 2006 1 次提交
    • M
      Exec git programs without using PATH. · 77cb17e9
      Michal Ostrowski 提交于
      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: NMichal Ostrowski <mostrows@watson.ibm.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      77cb17e9
  29. 08 1月, 2006 1 次提交
  30. 04 12月, 2005 1 次提交
    • J
      [PATCH] daemon.c and path.enter_repo(): revamp path validation. · d79374c7
      Junio C Hamano 提交于
      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: NJunio C Hamano <junkio@cox.net>
      d79374c7
  31. 22 11月, 2005 2 次提交