chiark / gitweb /
path: follow symbolic link for parent path
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>
Tue, 16 Dec 2014 20:58:39 +0000 (21:58 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 17 Dec 2014 02:19:19 +0000 (21:19 -0500)
[zj: When we lstat the target path, symlinks above the last component
     will be followed by both stat and lstat. So when we look at the
     parent, we should follow symlinks.]

src/shared/path-util.c

index 3256deeec1e3535f25da63c48ba3a978fb49674d..9e2fd6434a988512f9d75ee2c0c3ea2a9535116a 100644 (file)
@@ -519,7 +519,7 @@ fallback:
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
-        r = lstat(parent, &b);
+        r = stat(parent, &b);
         if (r < 0)
                 return -errno;
 
         if (r < 0)
                 return -errno;