Commit Graph

6450 Commits

Author SHA1 Message Date
Matthias Sohn 4a68f1a3c7 Prepare 4.7.6-SNAPSHOT builds
Change-Id: I99b59116999742d8d6cdba26287ea7c6eba11a30
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 00:36:30 +02:00
Matthias Sohn 9c90816cd9 JGit v4.7.5.201810051826-r
Change-Id: I60c7a2eff3dab5083f71df0d9465a4e94b5e2513
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 00:27:38 +02:00
Ivan Frade e4c28665b6 BaseReceivePack: Validate incoming .gitmodules files
The main concern are submodule urls starting with '-' that could pass as
options to an unguarded tool.

Pass through the parser the ids of blobs identified as .gitmodules
files in the ObjectChecker. Load the blobs and parse/validate them
in SubmoduleValidator.

Change-Id: Ia0cc32ce020d288f995bf7bc68041fda36be1963
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-05 23:49:00 +02:00
Ivan Frade 3ed3eafbd1 ObjectChecker: Report .gitmodules files found in the pack
In order to validate .gitmodules files, we first need to find them
in the incoming pack.

Do it in the ObjectChecker stage. Check in the tree objects if they
point to a .gitmodules file and report the tree id and the .gitmodules
blob id.

This can be used later to check if the file is in the root of the
project and if the contents are good.

While we're here, make isMacHFSGit more accurate by detecting variants
of filenames that vary in case.

[jn: tweaked NTFS and HFS+ checking; added more tests]

Change-Id: I70802e7d2c1374116149de4f89836b9498f39582
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-05 21:45:54 +02:00
Ivan Frade db9f7b028d SubmoduleAddCommand: Reject submodule URIs that look like cli options
In C git versions before 2.19.1, the submodule is fetched by running
"git clone <uri> <path>". A URI starting with "-" would be interpreted
as an option, causing security problems. See CVE-2018-17456.

Refuse to add submodules with URIs, names or paths starting with "-",
that could be confused with command line arguments.

[jn: backported to JGit 4.7.y, bringing portions of Masaya Suzuki's
 dotdot check code in v5.1.0.201808281540-m3~57 (Add API to specify
 the submodule name, 2018-07-12) along for the ride]

Change-Id: I2607c3acc480b75ab2b13386fe2cac435839f017
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-05 21:38:22 +02:00
Matthias Sohn 9dbb18291f Revert "Configure WindowCache settings to use in JGit CLI"
This reverts commit e6375445d1.

Hard coding WindowCache settings wasn't a good idea, this prevents that
custom settings can be configured. Also using virtual memory mapping has
issues on Windows.

Bug: 539789
Change-Id: I37434581f9e3db2f1d7442d893f0dda0c2488d93
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-05 11:09:27 +02:00
David Pursehouse 41b1a71cf3 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Ie7cb0c8a9775626cf2a2daae04b2d1f73a6c5af7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:19:32 +09:00
David Pursehouse 7893fcb0b4 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Icacfa8dcd1ced32715fb772c336574318f28ddd1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:18:54 +09:00
David Pursehouse 6b82c9ff7f Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: I2ab21595531bcd487ce6a5cb0a3bc3c6f6f6e518
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:18:27 +09:00
David Pursehouse 8ee64116b8 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: I3dff04d2ea99e5b6331e45e3ea2ccc78fb2d5a02
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:17:59 +09:00
David Pursehouse ffdaa0ff8f Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Ie3de769209ec8477c97df5f90b8c63c03e023be0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:17:30 +09:00
David Pursehouse 33c9906886 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Id0833112b0be4e78af375ee1fc78287743d7bc4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:16:53 +09:00
David Ostrovsky e5a4c0d17e ObjectDownloadListener#onWritePossible: Add comment on return statement
It is not obvious why this return statement is needed. Clarify with a
comment that otherwise endless loop may show up when recent versions
of Jetty are used.

Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2018-09-25 03:31:41 -05:00
Matthias Sohn 48e21dc10b Prepare 5.1.2-SNAPSHOT builds
Change-Id: I095d246e27de747a234bc058725454c222be51ce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 17:03:49 +02:00
Matthias Sohn b06d2e6a31 JGit v5.1.1.201809181055-r
Change-Id: I2366444fca125139eadb6d513be721167a266d70
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:55:20 +02:00
Matthias Sohn b1ac54034f Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.4-SNAPSHOT builds
  JGit v4.11.3.201809181037-r
  Prepare 4.9.6-SNAPSHOT builds
  JGit v4.9.5.201809180939-r
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I2ee1da73b4eb26f0017dd13a983aca62d4161c61
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:53:01 +02:00
Matthias Sohn a59bf16843 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.4-SNAPSHOT builds
  JGit v4.11.3.201809181037-r
  Prepare 4.9.6-SNAPSHOT builds
  JGit v4.9.5.201809180939-r
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I3f43af45a4c9023f0e8638fa1920db5d69276502
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:50:51 +02:00
Matthias Sohn 35255a2a29 Prepare 4.11.4-SNAPSHOT builds
Change-Id: Id2f83eb3b2070637997cfece59f4f15698267908
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:46:18 +02:00
Matthias Sohn 47ad1f6c8a JGit v4.11.3.201809181037-r
Change-Id: I6b57b02e41f02916127b1866d573a634d6f6d796
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:36:53 +02:00
Matthias Sohn 969af66800 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.6-SNAPSHOT builds
  JGit v4.9.5.201809180939-r
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I6633f1e147444385c999a6ff1d443b8a07d08bfc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:06:39 +02:00
Matthias Sohn 3d7476b1b3 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I19b9be956b4e9bb1bba303ad879baac250988e8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 16:02:22 +02:00
Matthias Sohn 430ff2187c Prepare 4.9.6-SNAPSHOT builds
Change-Id: I9fb8f6cc45409e0884b898187323ac91953754c3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:55:12 +02:00
Matthias Sohn 0bd9cb62cc JGit v4.9.5.201809180939-r
Change-Id: I36199607f3ec6e8bb841e9d9eade12251312447c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:44:16 +02:00
Matthias Sohn 78d90902e8 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: Ic353f93864ca4aec315f398f5c3e047dcda23125
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:33:11 +02:00
Matthias Sohn e4dd83a120 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I9a9abcd2e48e19295d537241c951308cd0210019
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:20:57 +02:00
Matthias Sohn 0de8e1e65c Prepare 4.7.5-SNAPSHOT builds
Change-Id: Ifce4311fe9429d751cec5b326b540d6233762153
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:16:36 +02:00
Matthias Sohn 6d4864ff15 JGit v4.7.4.201809180905-r
Change-Id: Iceee69df5fd593bece4532d5781e3771f5761ef8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:05:11 +02:00
Matthias Sohn e39cf68af4 Update API problem filter
Change-Id: Ie15c7d0b320f75915c362f5bd3bd6b39d84a900a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 15:03:40 +02:00
David Pursehouse 1cfb4241de Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Ib7a63b5144a89c213aff3b32c30a2a6526355e64
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:19:18 +09:00
David Pursehouse ca922217e2 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Iffe202a412b3bca1c8d8d7dc5dfd646c49838de9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:18:40 +09:00
David Pursehouse 1e170b16a4 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: I28ebf6138ccd9425fc05319de78c7716f0bdd199
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:17:02 +09:00
David Pursehouse ecf3227d32 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Ib7d01cb0ece8b259156855045a53b8baf3fa2968
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:16:29 +09:00
David Pursehouse 1780a12e20 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Id8eb635094336567d9f3c28ec985cd5127d31632
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:16:01 +09:00
David Pursehouse 531da4e5e9 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Iad9836811be034cf992ea25dad4409addba75115
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-18 09:15:24 +09:00
Matthias Sohn 1a4e12a451 Fix ObjectUploadListener#close
Do not try to set response status if response is already committed.

Change-Id: I9a7c2871c86eb53416b905324775f3ed961c8ae6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-18 01:29:58 +02:00
Matthias Sohn c18c768678 Fix error handling in FileLfsServlet
Check in #sendError method if the response was committed already.

If yes we cannot set response status or send an error message, last
resort is to close the outputstream.

If the response wasn't yet committed first reset the response before
using writer to send the error message to the client since mixing STREAM
and WRITE mode (mixing asynchronous and blocking I/O) is illegal in
servlet 3.1.

see the following bugs in the gerrit and jetty issue trackers
https://bugs.chromium.org/p/gerrit/issues/detail?id=9667
https://bugs.chromium.org/p/gerrit/issues/detail?id=9721
https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Ie35563c2e0ac1c5e918185a746622589a880dc7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-17 17:48:55 +02:00
David Ostrovsky 5c134f4d42 ObjectDownloadListener#onWritePossible: Make code spec compatible
Current code violates the ServletOutputStream contract. For every
out.isReady() == true either write or close of that ServletOutputStream
should be called.

See also this issue upstream for more context: [1].

[1] https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Ied575f3603a6be0d2dafc6c3329d685fc212c7a3
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-17 06:46:16 -05:00
David Ostrovsky f8e514c74a ObjectDownloadListener: Return from onWritePossible when data is written
When buffer was written not only call AsyncContext#complete() but also
return from the ObjectDownloadListener#onWritePossible(). This avoids
endless loop after upgrading from Jetty 9.3.x to 9.4.x lines.

In Jetty example implementation:[1] the return statemnt is also used:

  // If we are at EOF then complete
  if (len < 0)
  {
    async.complete();
    return;
  }

See also this issue upstream: [2].

[1] https://webtide.com/servlet-3-1-async-io-and-jetty
[2] https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Iac73fb25e67d40228a378a8e34103f1d28b72a76
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2018-09-15 19:20:55 -05:00
Matthias Sohn e6e9073fc7 Fix IOException when LockToken#close fails
This happened if the LockTokens hard link was already deleted earlier.

Bug: 531759
Change-Id: Idc84bd695fac1a763b3cbb797c9c4c636a16e329
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-15 09:11:17 +02:00
Cliffred van Velzen 0c8200b27b Fix logging null if called process fails
If some process executed by FS#readPipe ends in an error,
the error stream is never set as errorMessage because
FS#GobblerThread#waitForProcessCompletion always returned true.
This caused LOG#warn to be called with null.

Return false whenever FS#GobblerThread#waitForProcessCompletion fails.

Bug: 538723
Change-Id: Ic9492bd688431d52c8665f7a2efec2989e95a4ce
Signed-off-by: Cliffred van Velzen <cliffred@cliffred.nl>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-12 23:42:35 +02:00
David Pursehouse 7b365b2faa Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I9371f354d685545cc6a268420e44ae4c9577680f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 21:25:59 +09:00
David Pursehouse fc480b3efc Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: Ic7eaa0b6a4e750bc7853eb549a9e126269ae22cf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 19:03:32 +09:00
David Pursehouse 83c0369e29 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I191d56e3c0f11cf53076b06c7e7a05492c7a03f1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 17:02:23 +09:00
David Pursehouse 59ee33aee4 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: Ied2d7a70c5544ff012687a1aeb6e07394d9bd6fd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 16:38:56 +09:00
David Pursehouse b81092cc99 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I5e6cc35f3673545e7ff857e6ed0bcd2c44e50316
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 15:55:07 +09:00
David Pursehouse db756e9147 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I9ec6352b5ff57aa1a3380079dc9165890cc76d49
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 14:05:54 +09:00
Matthias Sohn 667ac8b318 Fix NoSuchFileException during directory cleanup in RefDirectory
Bug: 538285
Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 8ab89ef066)
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-12 09:12:11 +09:00
Matthias Sohn f1fd190939 Update japicmp to 0.13.0
Change-Id: Ib2bbdef1e1ede55115d1526b6699e905623c36a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-11 23:28:08 +02:00
Matthias Sohn a44d95c814 Prepare 5.1.1-SNAPSHOT builds
Change-Id: Ie220dd95fae18f894e2a04a5ae6d29a1e5a6d76b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-11 23:28:07 +02:00
Matthias Sohn 47956bcc68 JGit v5.1.0.201809111528-r
Change-Id: I583bf7d60bccc876156be1f605bfda32b89cd08b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-11 21:30:23 +02:00