Commit Graph

145 Commits

Author SHA1 Message Date
Matthias Sohn f6c989665e Fix API problem filters
Change-Id: I0f7a72934022346c9903d7dc5ec11e959cc8dac3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-17 00:35:10 +02:00
Matthias Sohn 8bf9c668ad Wait opening new packfile until it can't be racy anymore
If
- pack.waitPreventRacyPack = true (default is false)
- packfile size > pack.minSizePreventRacyPack (default is 100 MB)
wait after a new packfile was written and before it is opened until it
cannot be racy anymore.

If a new packfile is accessed while it's still racy at least the pack's
index will be reread by ObjectDirectory.scanPacksImpl(). Hence it may
save resources to wait one tick of the file system timer to avoid this
reloading. On filesystems with a coarse timestamp resolution it may be
beneficial to skip this wait for small packfiles.

Bug: 546891
Change-Id: I0e8bf3d7677a025edd2e397dd2c9134ba59b1a18
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-04 18:15:17 +02:00
Matthias Sohn b513b77477 Measure file timestamp resolution used in FileSnapshot
FileSnapshot.notRacyClean() assumed a worst case filesystem timestamp
resolution of 2.5 sec (FAT has a resolution of 2 sec). Instead measure
timestamp resolution to avoid unnecessary IO caused by false positives
in detecting the racy git problem caused by finite filesystem timestamp
resolution [1].

Cache the measured resolution per FileStore since timestamp resolution
depends on the respective filesystem type. If timestamp resolution
cannot be measured or fails due to an exception fallback to the worst
case FAT timestamp resolution and avoid caching this value.

Add a 10% safety margin in FileSnapshot.notRacyClean(), though running
FsTest.testFsTimestampResolution() 1000 times which is not using a
safety margin didn't fail on Mac using APFS and Java 8, 11, 12.

Measured Java file timestamp resolution: [2]

[1] https://github.com/git/git/blob/master/Documentation/technical/racy-git.txt
[2] https://docs.google.com/spreadsheets/d/1imy0y6WmRqBf0kjCxzxj2X7M50eIVfa7oaUIzEOHmjo

Bug: 546891
Change-Id: I493f3b57b6b306285ffa7d392339d253e5966ab8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:13:22 +02:00
Matthias Sohn ed2e515ddf Fix API problem filters
Change-Id: I566391d7c51875f30cf580d64e6784819985709f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-05-22 08:03:29 +02:00
Matthias Sohn f33fd16425 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I685d8a797209bc1b9c1bb9caba40ac8713c6ce5b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-20 01:52:02 +02:00
Matthias Sohn 710d00b85e Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.9-SNAPSHOT builds
  JGit v4.11.8.201904181247-r
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I9b7f9faf3dc584068456f1ae2cacc4ce5137d4ad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-19 12:36:24 +02:00
Matthias Sohn bb7d58d670 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: Ib2a170e24bddad0e8c9c7be6688269f6318bf30f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-18 18:44:35 +02:00
Matthias Sohn 53014c0804 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.11-SNAPSHOT builds
  JGit v4.9.10.201904181027-r
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I94c9e6300b5f77b185ec6661fa76f0c74a5fc2a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-18 18:43:01 +02:00
Matthias Sohn d5ec15c8d0 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: Idaa789e699f1ef568ea957184d0641355d9e3181
2019-04-18 14:43:23 +02:00
Matthias Sohn fad5cf8b23 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.10-SNAPSHOT builds
  JGit v4.7.9.201904161809-r
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I7984f68833f2d615399296e53cb9a64e5b4ca6ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-17 00:54:37 +02:00
Matthias Sohn b23735107b Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I6ea51dde6608a4163d681aa1ebf710f06da44b21
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-16 23:53:21 +02:00
Matthias Sohn 422f030d29 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.8-SNAPSHOT builds
  JGit v4.5.7.201904151645-r
  Remember the cause for invalidating a packfile
  Fix API problem filters
  Fix pack files scan when filesnapshot isn't modified

Change-Id: I0b4eaa521ebdea83ab18c05915d691c07a575a7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-16 23:36:46 +02:00
Luca Milanesio d6e00d2015 Remember the cause for invalidating a packfile
Keep track of the original cause for a packfile invalidation.
It is needed for the sysadmin to understand if there is a real
underlying filesystem problem and repository corruption or if it is
simply a consequence of a concurrency of Git operations (e.g. repack
or GC).

Change-Id: I06ddda9ec847844ec31616ab6d17f153a5a34e33
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-11 10:55:45 +02:00
Matthias Sohn aa6e7e2c12 Fix API problem filters
Change-Id: I96e0ddc34251348ec4877c9d94b045eb1c53e758
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-04-11 00:34:20 +02:00
Matthias Sohn b0d27cdae9 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.8-SNAPSHOT builds
  JGit v4.11.7.201903122105-r
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I71771dcc086a9a0097bad74d65ec71ad97106a38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 07:38:38 +01:00
Matthias Sohn 7480737aac Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.8-SNAPSHOT builds
  JGit v4.11.7.201903122105-r
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I04c70f66c6f1e53bdc199fb5b24c9136c9a8e4f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 02:21:54 +01:00
Matthias Sohn 7204e35f93 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: Ic66dc00455c05f7627919f682a7221ffeef1629d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:55:24 +01:00
Matthias Sohn f53c2d11af Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.10-SNAPSHOT builds
  JGit v4.9.9.201903122025-r
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: Ifcd8ea6a2b59f6f8e9d896d8407cfcaef0a9375d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:48:06 +01:00
Matthias Sohn c452c007ce Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I9a47153831f8eb10d3cd91b4157cf45385e5b13a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:18:01 +01:00
Matthias Sohn 2bf3cc56db Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.9-SNAPSHOT builds
  JGit v4.7.8.201903121755-r
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I1136eaa1590b225ceaf16ba7552af0374253a74e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-13 01:16:28 +01:00
Matthias Sohn 92525b584a Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I3d1544d034783fe0fa1385dfe9b03ad8e9247c63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12 22:39:53 +01:00
Matthias Sohn d96eb8b3e6 Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.7-SNAPSHOT builds
  JGit v4.5.6.201903121547-r
  Check for packfile validity and fd before reading
  Move throw of PackInvalidException outside the catch
  Use FileSnapshot to get lastModified on PackFile
  Include size when comparing FileSnapshot
  Do not reuse packfiles when changed on filesystem
  Silence API warnings for new API introduced for fixes

Change-Id: I029e1797447e6729de68bd89d4d69b324dbb3f5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12 22:26:58 +01:00
Luca Milanesio 2dc572df24 Include size when comparing FileSnapshot
Due to finite filesystem timestamp resolution the last modified
timestamp of files cannot detect file changes which happened in the
immediate past (less than one filesystem timer tick ago).

Read and consider file size also, so that differing file size can help
to more accurately detect file changes without reading the file content.
Use bulk read to avoid multiple stat calls to retrieve file attributes.

Change-Id: I974288fff78ac78c52245d9218b5639603f67a46
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12 14:39:14 +01:00
Matthias Sohn d4078dccda Silence API warnings for new API introduced for fixes
Change-Id: I3ea7ff2efd33ca6c780afaef9010cec82780d7fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-03-12 14:30:20 +01:00
Matthias Sohn fafad4196d Prepare 5.1.6-SNAPSHOT builds
Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:35:30 +01:00
Matthias Sohn d14209e81b Prepare 5.1.5-SNAPSHOT builds
Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:57:01 +01:00
Matthias Sohn c93aec2b73 JGit v5.1.4.201812251853-r
Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:53:51 +01:00
Matthias Sohn 23e4765a65 Prepare 4.11.7-SNAPSHOT builds
Change-Id: I97dc0f4aeb51c2084f40531ceac84e90bf70608d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 01:08:03 +01:00
Matthias Sohn affbb99271 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I937e9a4547fc10e4de7c887163022d1ab0322d64
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:54:15 +01:00
Matthias Sohn 3dd3fe9ea4 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Ib44e314a68bca2349b45f4937257aa1298c8d74b
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:36:29 +01:00
Matthias Sohn 391371cad2 Prepare 4.7.8-SNAPSHOT builds
Change-Id: Ic4ab4aae6d87392d1a5a8bbda06384b7a5b64182
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:16:19 +01:00
Matthias Sohn 97b62cf9dd Update API problem filter
Change-Id: Iba8650900d3936edccbe30de9d3eafd4f9e0dba6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-19 23:54:38 +02:00
Matthias Sohn 2674bec32b Update API problem filter
Change-Id: I66c0c490bb66adafac5d670d2d9571f1674a281e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-19 22:15:39 +02:00
Matthias Sohn 1bec897ada Update API warning filter to 5.1.3
We added API in 4.7.5 to fix CVE-2018-17456

Change-Id: I14698fb088de91b8ba8856e461f64138025a89fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-07 09:46:05 +02:00
Matthias Sohn dff99a272a Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

* Fix todos in SubmoduleAddTest

Change-Id: I53272081094b8948a40a1ce409af08b6ef330c1e
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 16:56:12 +02:00
Matthias Sohn 23ebbe5662 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

* Fix configuration of maven-javadoc-plugin for site generation

Change-Id: Ic6ff8d324867ee41f15a5b890c7eee5092e8453e
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 16:40:46 +02:00
Matthias Sohn f016e32471 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ibd759f5d425f714e79b3137ff8e5b0f989933de0
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 02:26:05 +02:00
Matthias Sohn c0a973657f Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ie59e34eb591a827d1ce8e483eec6d390a3c81702
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:52:38 +02:00
Matthias Sohn 7d94b446fe Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ia7a826399d8d5b8a0eb7169b40e98a6f5c207a4c
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:16:08 +02:00
Matthias Sohn a8bd7dcc58 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Id6fabec4d0b682a7e20a46e88cbc05432efca062
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-10-06 01:03:20 +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 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
Matthias Sohn c857e7f09b Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Prepare 4.11.3-SNAPSHOT builds
  JGit v4.11.2.201809100523-r

Change-Id: I6bd3cb830b7b44dc6e5fd66ff0732957be6b5710
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-10 21:30:49 +02:00
Matthias Sohn 8527e74ea0 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.3-SNAPSHOT builds
  JGit v4.11.2.201809100523-r

Change-Id: I8a6f2667f9e43d53e995554224c2a538d1959996
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-10 21:29:46 +02:00
Matthias Sohn 0d4e04c575 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.5-SNAPSHOT builds
  JGit v4.9.4.201809090327-r
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: I8e962758973753fe7baffd959050593a059ee44e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-09 15:44:44 +02:00
Matthias Sohn 8f46488385 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.5-SNAPSHOT builds
  JGit v4.9.4.201809090327-r
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: I78099d2a5ba895273ca3ac587c7aa5f3f43fe869
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-09 15:43:04 +02:00
Matthias Sohn f8de0596d7 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: Id3c85149316cbe671e55f41438bd3a3a892b4ed0
2018-09-09 09:25:54 +02:00
Matthias Sohn b0a0c1004f Fix @since tag for LOCK_SUFFIX
Change-Id: Ia65cf3f12ec6d35a21b4d9332be912f06d8bf834
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-09 08:46:11 +02:00
Matthias Sohn 582d623964 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: I3c8892e33516bdcadd983e7ab668635b7fa3d4c5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-09-08 22:13:00 +02:00