)]}'
{
  "commit": "f6d4def4e27b13fab174e948b94cd10550d3e10e",
  "tree": "90f7240d55b4173ff6c457189ba18f8607ffa9dc",
  "parents": [
    "d0ed169b4599f48baa5cc6f2b9085e90e1dcefdb"
  ],
  "author": {
    "name": "Jonathan Nieder",
    "email": "jrnieder@gmail.com",
    "time": "Tue Sep 27 18:19:06 2011 -0500"
  },
  "committer": {
    "name": "Herbert Xu",
    "email": "herbert@gondor.apana.org.au",
    "time": "Mon Nov 17 22:51:37 2014 +0800"
  },
  "message": "[BUILTIN] Fix \"test -x\" as root on FreeBSD 8\n\nPOSIX.1-2008 §4.4 \"File Access Permission\" sayeth:\n\n\tIf execute permission is requested, access shall be granted\n\tif execute permission is granted to at least one user by the\n\tfile permission bits or by an alternate access control\n\tmechanism; otherwise, access shall be denied.\n\nFor historical reasons, POSIX unfortunately also allows access() and\nfaccessat() to return success for X_OK if the current process is\nprivileged, even when the above condition is not fulfilled and actual\nexecution would fail.  On the affected platforms, \"test -x \u003cpath\u003e\" as\nroot started returning true on nonexecutable files when dash switched\nfrom its own emulation to the true faccessat in v0.5.7~54\n(2010-04-02).\n\nWork around this by checking the permissions bits when mode \u003d\u003d X_OK\nand geteuid() \u003d\u003d 0 on such platforms.\n\nUnfortunately the behavior seems to vary from one kernel version to\nanother, so we cannot just check the behavior at compile time and rely\non that.  A survey of some affected kernels:\n\n - NetBSD\u0027s kernel moved to the sane semantics in 1997\n - OpenBSD\u0027s kernel made the same change in version 4.4, three years\n   ago\n - FreeBSD 9\u0027s kernel fixes this but hasn\u0027t been released yet\n\nIt seems safe to only apply the workaround on systems using the\nFreeBSD kernel for now, and to push for standardization on the\nexpected access()/faccessat() semantics so we can drop the workaround\naltogether in a few years.\n\nTo try it on other platforms, use \"./configure --enable-test-workaround\".\n\nReported-by: Christoph Egger \u003cchristoph@debian.org\u003e\nAnalysis-by: Petr Salinger \u003cPetr.Salinger@seznam.cz\u003e\nSigned-off-by: Jonathan Nieder \u003cjrnieder@gmail.com\u003e\nSigned-off-by: Herbert Xu \u003cherbert@gondor.apana.org.au\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "60a2a2638fd1eff7c434605cda023b41c45badde",
      "old_mode": 33188,
      "old_path": "configure.ac",
      "new_id": "8ae0dc601db8fd409485136900662e6169deb06e",
      "new_mode": 33188,
      "new_path": "configure.ac"
    },
    {
      "type": "modify",
      "old_id": "458e9f5555b1062ad2d2be8978e25786e05d6443",
      "old_mode": 33188,
      "old_path": "src/bltin/test.c",
      "new_id": "bab9a1f97b6b9203114b43ce80c3e7053d71ec57",
      "new_mode": 33188,
      "new_path": "src/bltin/test.c"
    }
  ]
}
