This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=ccb8427cb3af7b87ba8e9621a65f4aade360e12c

commit ccb8427cb3af7b87ba8e9621a65f4aade360e12c
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Mar 3 00:09:28 2021 +0100

    dpkg-realpath: Fix symlink loop tracker
    
    We need to move the symlink tracking from the general loop, which would
    limit the depth of the pathname to the case that handles symlinks in the
    pathname.
---
 scripts/dpkg-realpath.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/dpkg-realpath.sh b/scripts/dpkg-realpath.sh
index 21b0f20d9..bb7861038 100755
--- a/scripts/dpkg-realpath.sh
+++ b/scripts/dpkg-realpath.sh
@@ -69,10 +69,6 @@ canonicalize() {
      src=${src#/}
   done
   while [ -n "$src" ]; do
-    loop=$((loop + 1))
-    if [ "$loop" -gt 25 ]; then
-      error "too many levels of symbolic links"
-    fi
     # Get the first directory component.
     prefix=${src%%/*}
     # Remove the first directory component from src.
@@ -92,6 +88,10 @@ canonicalize() {
         result="$root"
       fi
     elif [ -h "$result/$prefix" ]; then
+      loop=$((loop + 1))
+      if [ "$loop" -gt 25 ]; then
+        error "too many levels of symbolic links"
+      fi
       # Resolve the symlink within $result.
       dst=$(readlink "$result/$prefix")
       case "$dst" in

-- 
Dpkg.Org's dpkg

Reply via email to