Merge pull request #26 from crosbymichael/device-copy-links

Use lstat to check device symlinks
This commit is contained in:
Victor Marmol 2014-06-16 17:42:34 -07:00
commit c4ec56a9ac
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. // 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) { func GetDevice(path, cgroupPermissions string) (*Device, error) {
fileInfo, err := os.Stat(path) fileInfo, err := os.Lstat(path)
if err != nil { if err != nil {
return nil, err return nil, err
} }