1. 06 6月, 2019 2 次提交
  2. 05 6月, 2019 7 次提交
  3. 04 6月, 2019 7 次提交
  4. 03 6月, 2019 1 次提交
  5. 02 6月, 2019 3 次提交
  6. 01 6月, 2019 1 次提交
  7. 31 5月, 2019 14 次提交
  8. 30 5月, 2019 4 次提交
    • C
      list-objects-filter: disable 'sparse:path' filters · e693237e
      Christian Couder 提交于
      If someone wants to use as a filter a sparse file that is in the
      repository, something like "--filter=sparse:oid=<ref>:<path>"
      already works.
      
      So 'sparse:path' is only interesting if the sparse file is not in
      the repository. In this case though the current implementation has
      a big security issue, as it makes it possible to ask the server to
      read any file, like for example /etc/password, and to explore the
      filesystem, as well as individual lines of files.
      
      If someone is interested in using a sparse file that is not in the
      repository as a filter, then at the minimum a config option, such
      as "uploadpack.sparsePathFilter", should be implemented first to
      restrict the directory from which the files specified by
      'sparse:path' can be read.
      
      For now though, let's just disable 'sparse:path' filters.
      Helped-by: NMatthew DeVore <matvore@google.com>
      Helped-by: NJeff Hostetler <git@jeffhostetler.com>
      Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e693237e
    • N
      parse-options: check empty value in OPT_INTEGER and OPT_ABBREV · f7e68a08
      Nguyễn Thái Ngọc Duy 提交于
      When parsing the argument for OPT_INTEGER and OPT_ABBREV, we check if we
      can parse the entire argument to a number with "if (*s)". There is one
      missing check: if "arg" is empty to begin with, we fail to notice.
      
      This could happen with long option by writing like
      
        git diff --inter-hunk-context= blah blah
      
      Before 16ed6c97 (diff-parseopt: convert --inter-hunk-context,
      2019-03-24), --inter-hunk-context is handled by a custom parser
      opt_arg() and does detect this correctly.
      
      This restores the bahvior for --inter-hunk-context and make sure all
      other integer options are handled the same (sane) way. For OPT_ABBREV
      this is new behavior. But it makes it consistent with the rest.
      
      PS. OPT_MAGNITUDE has similar code but git_parse_ulong() does detect
      empty "arg". So it's good to go.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7e68a08
    • N
      diff-parseopt: restore -U (no argument) behavior · 8ef05193
      Nguyễn Thái Ngọc Duy 提交于
      Before d473e2e0 (diff.c: convert -U|--unified, 2019-01-27), -U and
      --unified are implemented with a custom parser opt_arg() in diff.c. I
      didn't check this code carefully and not realize that it's the
      equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.
      
      In other words, if -U is specified without any argument, the option
      should be accepted, and the default value should be used. Without
      PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
      regression.
      Reported-by: NBryan Turner <bturner@atlassian.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef05193
    • N
      diff-parseopt: correct variable types that are used by parseopt · 7f125ff9
      Nguyễn Thái Ngọc Duy 提交于
      Most number-related OPT_ macros store the value in an 'int'
      variable. Many of the variables in 'struct diff_options' have a
      different type, but during the conversion to using parse_options() I
      failed to notice and correct.
      
      The problem was reported on s360x which is a big-endian
      architechture. The variable to store '-w' option in this case is
      xdl_opts, 'long' type, 8 bytes. But since parse_options() assumes
      'int' (4 bytes), it will store bits in the wrong part of xdl_opts. The
      problem was found on little-endian platforms because parse_options()
      will accidentally store at the right part of xdl_opts.
      
      There aren't much to say about the type change (except that 'int' for
      xdl_opts should still be big enough, since Windows' long is the same
      size as 'int' and nobody has complained so far). Some safety checks may
      be implemented in the future to prevent class of bugs.
      Reported-by: NTodd Zullinger <tmz@pobox.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7f125ff9
  9. 29 5月, 2019 1 次提交