Sebastiaan van Stijn
a345ccfd0e
Graphdriver: fix "device" mode not being detected if "character-device" bit is set
...
Due to a bug in Golang (github.com/golang#27640 ), the "character device"
bit was omitted when checking file-modes with `os.ModeType`.
This bug was resolved in Go 1.12, but as a result, graphdrivers
would no longer recognize "device" files, causing pulling of
images that have a file with this filemode to fail;
failed to register layer:
unknown file type for /var/lib/docker/vfs/dir/.../dev/console
The current code checked for an exact match of Modes to be set. The
`os.ModeCharDevice` and `os.ModeDevice` bits will always be set in
tandem, however, because the code was only looking for an exact
match, this detection broke now that `os.ModeCharDevice` was added.
This patch changes the code to be more defensive, and instead
check if the `os.ModeDevice` bit is set (either with, or without
the `os.ModeCharDevice` bit).
In addition, some information was added to the error-message if
no type was matched, to assist debugging in case additional types
are added in future.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
(cherry picked from commit c7a38c2c06f7ab844a48c6c447942913131b83d6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
Upstream-commit: 3744b45ba8ad93f1a21cbc80420856b04efc4593
Component: engine
2019-02-20 14:31:18 +01:00
..
2018-06-15 16:03:33 -07:00
2018-10-30 23:04:27 +00:00
2018-09-21 17:06:25 -07:00
2018-06-13 09:04:30 +02:00
2018-02-05 16:51:57 -05:00
2018-06-08 11:07:48 +08:00
2019-02-20 14:31:18 +01:00
2018-09-21 17:06:25 -07:00
2018-08-13 21:59:11 -07:00
2018-02-05 16:51:57 -05:00
2018-05-23 21:57:30 +02:00
2018-11-08 15:26:01 +01:00
2018-02-05 16:51:57 -05:00
2018-08-20 15:28:15 -05:00
2018-03-15 17:56:15 +01:00
2017-09-06 12:05:19 -04:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-08-13 21:59:11 -07:00
2018-02-05 16:51:57 -05:00
2018-08-13 21:59:11 -07:00
2018-04-19 06:35:54 -04:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-09-06 18:39:22 -07:00
2018-04-23 13:52:44 -07:00
2018-02-05 16:51:57 -05:00
2018-02-09 11:24:09 -08:00
2018-02-05 16:51:57 -05:00
2018-06-27 17:11:29 -07:00
2018-02-26 16:48:29 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-16 11:25:14 -05:00
2018-02-05 16:51:57 -05:00
2018-08-13 21:59:11 -07:00
2018-07-26 11:17:56 -07:00
2018-07-26 11:17:56 -07:00
2018-06-13 09:04:30 +02:00
2018-02-05 16:51:57 -05:00
2018-04-19 06:35:54 -04:00
2018-06-13 09:04:30 +02:00
2018-08-13 21:59:11 -07:00
2018-05-25 14:21:07 -04:00
2018-08-13 21:59:11 -07:00
2018-08-13 21:59:11 -07:00
2018-07-26 11:17:56 -07:00
2018-08-13 21:59:11 -07:00
2018-04-17 14:06:53 -04:00
2018-12-07 18:58:03 +01:00
2018-07-26 11:17:56 -07:00
2018-02-05 16:51:57 -05:00
2018-10-11 16:04:45 +02:00
2018-09-21 17:06:25 -07:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-06-13 09:04:30 +02:00
2018-05-25 14:21:07 -04:00
2018-02-05 16:51:57 -05:00
2018-05-25 14:21:07 -04:00
2018-05-25 14:21:07 -04:00
2018-02-05 16:51:57 -05:00
2018-02-21 18:26:16 -05:00
2018-06-13 09:04:30 +02:00
2018-03-02 14:05:36 +01:00
2018-02-05 16:51:57 -05:00
2018-06-08 11:07:48 +08:00
2018-08-13 21:59:11 -07:00
2018-02-05 16:51:57 -05:00
2018-04-23 13:52:44 -07:00
2018-10-04 21:20:54 +02:00
2018-06-13 09:04:30 +02:00
2018-10-05 12:35:59 +02:00
2018-08-21 11:36:15 +02:00
2018-10-12 02:26:17 +02:00
2018-02-05 16:51:57 -05:00
2018-06-13 09:04:30 +02:00
2018-02-05 16:51:57 -05:00
2018-05-25 14:21:07 -04:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-07-11 15:51:51 +02:00
2018-08-17 17:05:21 -07:00
2018-08-17 17:05:21 -07:00
2018-02-05 16:51:57 -05:00
2018-08-29 12:54:06 +02:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-08-29 12:54:06 +02:00
2018-08-17 09:36:56 -07:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-09-06 18:39:22 -07:00
2018-05-25 15:18:53 -04:00
2018-02-05 16:51:57 -05:00
2018-05-30 15:22:10 -04:00
2018-07-11 15:51:51 +02:00
2018-05-25 14:21:07 -04:00
2018-02-05 16:51:57 -05:00
2018-08-20 18:55:01 +00:00
2018-08-13 21:59:11 -07:00
2018-08-13 21:59:11 -07:00
2018-06-15 16:14:17 -07:00
2018-06-15 16:14:17 -07:00
2018-02-05 16:51:57 -05:00
2018-06-27 17:11:29 -07:00
2018-06-13 09:04:30 +02:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-09-04 15:01:46 +00:00
2018-02-05 16:51:57 -05:00
2018-06-13 09:04:30 +02:00
2018-06-08 11:07:48 +08:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-06-08 19:19:06 -07:00
2018-02-05 16:51:57 -05:00
2018-02-26 16:49:37 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-04-23 13:52:44 -07:00
2018-05-03 10:04:33 -07:00
2018-02-05 16:51:57 -05:00
2018-05-24 18:24:36 -07:00
2018-02-05 16:51:57 -05:00
2018-06-13 09:04:30 +02:00
2018-09-18 12:34:56 +02:00
2018-07-11 15:51:51 +02:00
2018-05-23 17:50:54 +02:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-06-08 11:07:48 +08:00
2018-02-07 14:27:09 -05:00
2018-08-09 00:45:00 +09:00
2018-04-19 06:35:54 -04:00
2018-04-19 06:35:54 -04:00
2018-08-13 21:59:11 -07:00
2018-08-13 21:59:11 -07:00
2018-08-30 17:34:59 -07:00
2018-04-23 13:52:44 -07:00
2018-08-13 21:59:11 -07:00