Parcourir la source

when sharing a /var/lib/docker dir with more than one distribution, an existing lxc-start-unconfined softlink may point to a non-existant path, following that link (as Stat does) will cause the daemon to fail to start

Sven Dowideit il y a 11 ans
Parent
commit
0a3eedd4c9
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      runtime.go

+ 1 - 1
runtime.go

@@ -868,7 +868,7 @@ func linkLxcStart(root string) error {
 	}
 	}
 	targetPath := path.Join(root, "lxc-start-unconfined")
 	targetPath := path.Join(root, "lxc-start-unconfined")
 
 
-	if _, err := os.Stat(targetPath); err != nil && !os.IsNotExist(err) {
+	if _, err := os.Lstat(targetPath); err != nil && !os.IsNotExist(err) {
 		return err
 		return err
 	} else if err == nil {
 	} else if err == nil {
 		if err := os.Remove(targetPath); err != nil {
 		if err := os.Remove(targetPath); err != nil {