1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/graphdriver
Sebastiaan van Stijn c7a38c2c06
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>
2019-02-20 11:08:58 +01:00
..
aufs aufs: get rid of mount() 2018-12-10 20:06:10 -08:00
btrfs pkg/mount: wrap mount/umount errors 2018-12-10 20:07:02 -08:00
copy Graphdriver: fix "device" mode not being detected if "character-device" bit is set 2019-02-20 11:08:58 +01:00
devmapper pkg/mount: wrap mount/umount errors 2018-12-10 20:07:02 -08:00
graphtest Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
lcow LCOW:Enable image push when files have spaces 2019-02-04 12:07:58 -08:00
overlay Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
overlay2 overlay2: use index=off if possible 2018-10-11 12:52:57 -07:00
overlayutils Add additional message when backendfs is extfs without d_type support 2018-05-18 10:32:47 +08:00
quota Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
register Add canonical import comment 2018-02-05 16:51:57 -05:00
vfs Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
windows Remove duplicated words in daemon files 2018-10-06 00:06:38 +08:00
zfs pkg/mount: wrap mount/umount errors 2018-12-10 20:07:02 -08:00
counter.go graphdriver: Fix RefCounter memory leak 2018-02-09 10:26:06 +08:00
driver.go Deprecate AuFS storage driver, and add warning 2018-10-26 18:41:46 +02:00
driver_freebsd.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_linux.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_test.go Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
driver_unsupported.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
fsdiff.go Add layer id to NaiveDiffDriver untar timing log 2018-10-05 16:28:40 -07:00
plugin.go Move plugin client to separate interface 2018-05-30 15:22:10 -04:00
proxy.go Move plugin client creation to the extension point 2018-05-25 15:18:53 -04:00