Browse code

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 authored on 2013/12/14 14:29:08
Showing 1 changed files
... ...
@@ -868,7 +868,7 @@ func linkLxcStart(root string) error {
868 868
 	}
869 869
 	targetPath := path.Join(root, "lxc-start-unconfined")
870 870
 
871
-	if _, err := os.Stat(targetPath); err != nil && !os.IsNotExist(err) {
871
+	if _, err := os.Lstat(targetPath); err != nil && !os.IsNotExist(err) {
872 872
 		return err
873 873
 	} else if err == nil {
874 874
 		if err := os.Remove(targetPath); err != nil {