1. 12 4月, 2009 1 次提交
  2. 30 8月, 2008 1 次提交
  3. 29 8月, 2008 1 次提交
    • P
      make git-shell paranoid about closed stdin/stdout/stderr · 0cfeed2e
      Paolo Bonzini 提交于
      It is in general unsafe to start a program with one or more of file
      descriptors 0/1/2 closed.  Karl Chen for example noticed that stat_command
      does this in order to rename a pipe file descriptor to 0:
      
          dup2(from, 0);
          close(from);
      
      ... but if stdin was closed (for example) from == 0, so that
      
          dup2(0, 0);
          close(0);
      
      just ends up closing the pipe.  Another extremely rare but nasty problem
      would occur if an "important" file ends up in file descriptor 2, and is
      corrupted by a call to die().
      
      Fixing this in git was considered to be overkill, so this patch works
      around it only for git-shell.  The fix is simply to open all the "low"
      descriptors to /dev/null in main.
      Signed-off-by: NPaolo Bonzini <bonzini@gnu.org>
      Acked-by: NStephen R. van den Berg <srb@cuci.nl>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0cfeed2e
  4. 26 8月, 2008 1 次提交
    • J
      Revert "Build-in "git-shell"" · 1e7abc59
      Junio C Hamano 提交于
      This reverts commit daa0cc9a.
      It was a stupid idea to do this; when run as a log-in shell,
      it is spawned with argv[0] set to "-git-shell", so the usual
      name-based dispatch would not work to begin with.
      1e7abc59
  5. 20 8月, 2008 2 次提交
  6. 26 7月, 2008 1 次提交
  7. 28 6月, 2008 1 次提交
    • D
      shrink git-shell by avoiding redundant dependencies · 5b8e6f85
      Dmitry Potapov 提交于
      A lot of modules that have nothing to do with git-shell functionality
      were linked in, bloating git-shell more than 8 times.
      
      This patch cuts off redundant dependencies by:
      1. providing stubs for three functions that make no sense for git-shell;
      2. moving quote_path_fully from environment.c to quote.c to make the
         later self sufficient;
      3. moving make_absolute_path into a new separate file.
      
      The following numbers have been received with the default optimization
      settings on master using GCC 4.1.2:
      
      Before:
         text    data     bss     dec     hex filename
       143915    1348   93168  238431   3a35f git-shell
      
      After:
         text    data     bss     dec     hex filename
        17670     788    8232   26690    6842 git-shell
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5b8e6f85
  8. 27 6月, 2008 1 次提交
  9. 24 6月, 2008 1 次提交
  10. 30 10月, 2007 1 次提交
  11. 16 10月, 2007 1 次提交
  12. 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
  13. 05 3月, 2006 1 次提交
    • J
      Const tightening. · 9201c707
      Junio C Hamano 提交于
      Mark Wooding noticed there was a type mismatch warning in git.c; this
      patch does things slightly differently (mostly tightening const) and
      was what I was holding onto, waiting for the setup-revisions change
      to be merged into the master branch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9201c707
  14. 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
  15. 26 11月, 2005 1 次提交
  16. 25 10月, 2005 1 次提交
    • L
      Add git-shell. · 35eb2d36
      Linus Torvalds 提交于
      This adds a very git specific restricted shell, that can be
      added to /etc/shells and set to the pw_shell in the /etc/passwd
      file, to give users ability to push into repositories over ssh
      without giving them full interactive shell acount.
      
      [jc: I updated Linus' patch to match what the current sq_quote()
       does.]
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      35eb2d36