[haiku-commits] haiku: hrev56214 - src/system/kernel/fs

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 24 Jun 2022 08:31:48 +0000 (UTC)

hrev56214 adds 1 changeset to branch 'master'
old head: c95c5ed8212b3ed87c394275255ec5032788afc3
new head: e49b671dcf36bcf8959719d3db5f7d4501f21b99
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=e49b671dcf36+%5Ec95c5ed8212b

----------------------------------------------------------------------------

e49b671dcf36: kernel/vfs: lstat a symlinked dir with a trailing slash should 
traverse
  
  golang's TestSymlinkWithTrailingSlash exhibits the bug.
  
  Change-Id: I7e16bad9857e9be042fc215a587c861bc4eef716
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/5395
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev56214
Commit:      e49b671dcf36bcf8959719d3db5f7d4501f21b99
URL:         https://git.haiku-os.org/haiku/commit/?id=e49b671dcf36
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Jun 23 17:23:52 2022 UTC
Committer:   Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Commit-Date: Fri Jun 24 08:31:44 2022 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 1 deletion(-)
src/system/kernel/fs/vfs.cpp | 4 +++-

----------------------------------------------------------------------------

diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp
index 938507c0bd..c99418093b 100644
--- a/src/system/kernel/fs/vfs.cpp
+++ b/src/system/kernel/fs/vfs.cpp
@@ -2179,7 +2179,9 @@ vnode_path_to_vnode(struct vnode* vnode, char* path, bool 
traverseLeafLink,
                for (nextPath = path + 1; *nextPath != '\0' && *nextPath != '/';
                                nextPath++);
 
+               bool directoryFound = false;
                if (*nextPath == '/') {
+                       directoryFound = true;
                        *nextPath = '\0';
                        do
                                nextPath++;
@@ -2226,7 +2228,7 @@ vnode_path_to_vnode(struct vnode* vnode, char* path, bool 
traverseLeafLink,
                // If the new node is a symbolic link, resolve it (if we've 
been told
                // to do it)
                if (S_ISLNK(nextVnode->Type())
-                       && (traverseLeafLink || nextPath[0] != '\0')) {
+                       && (traverseLeafLink || directoryFound)) {
                        size_t bufferSize;
                        char* buffer;
 


Other related posts:

  • » [haiku-commits] haiku: hrev56214 - src/system/kernel/fs - Adrien Destugues