Use lstat to check device symlinks

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-06-16 14:51:02 -07:00
parent e00eadd77d
commit bbb502c8db
1 changed files with 2 additions and 2 deletions

View File

@ -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
}