mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 04:31:28 +00:00
Add key migration to daemon
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
@@ -37,3 +37,13 @@ func TreeSize(dir string) (size int64, err error) {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// IsFileOwner checks whether the current user is the owner of the given file.
|
||||
func IsFileOwner(f string) bool {
|
||||
if fileInfo, err := os.Stat(f); err == nil && fileInfo != nil {
|
||||
if stat, ok := fileInfo.Sys().(*syscall.Stat_t); ok && int(stat.Uid) == os.Getuid() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user