From bbb502c8db348477becfef3dfbc1f4e99c528035 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 16 Jun 2014 14:51:02 -0700 Subject: [PATCH] Use lstat to check device symlinks Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- devices/devices.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/devices.go b/devices/devices.go index f6bee56d..727a5bdf 100644 --- a/devices/devices.go +++ b/devices/devices.go @@ -39,8 +39,8 @@ func (device *Device) GetCgroupAllowString() string { } // Given the path to a device and it's cgroup_permissions(which cannot be easilly queried) look up the information about a linux device and return that information as a Device struct. -func GetDevice(path string, cgroupPermissions string) (*Device, error) { - fileInfo, err := os.Stat(path) +func GetDevice(path, cgroupPermissions string) (*Device, error) { + fileInfo, err := os.Lstat(path) if err != nil { return nil, err }