>Number:         186152
>Category:       bin
>Synopsis:       [patch] freebsd-update -b: correctly handle symlinks with 
>absolute paths
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 27 01:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     David Shane Holden
>Release:        10.0-RELEASE
>Organization:
>Environment:
FreeBSD node 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 
UTC 2014     r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When upgrading a base directory (freebsd-update -b), symlinks with absolute 
paths are checked against the host system instead of the base directory which 
was causing the problem reported at 
https://forums.freebsd.org/viewtopic.php?f=5&t=44520.

>How-To-Repeat:
Check forums thread.
>Fix:


Patch attached with submission follows:

--- freebsd-update.orig 2014-01-27 01:03:59.000000000 +0000
+++ freebsd-update      2014-01-27 01:18:01.000000000 +0000
@@ -1437,11 +1437,21 @@
        # sorted by device and inode number.
        while read F; do
                # If the symlink/file/directory does not exist, record this.
-               if ! [ -e ${BASEDIR}/${F} ]; then
+               # Symlinks with absolute paths need to be checked relative
+               # to their base directories.
+               FF=${F}
+               if [ -L ${BASEDIR}/${F} ]; then
+                       LINK=`readlink ${BASEDIR}/${F}`
+                       echo "${LINK}" | grep -qe "^/"
+                       if [ $? -eq 0 ]; then
+                               FF=${LINK}
+                       fi
+               fi
+               if ! [ -e ${BASEDIR}/${FF} ]; then
                        echo "${F}|-||||||"
                        continue
                fi
-               if ! [ -r ${BASEDIR}/${F} ]; then
+               if ! [ -r ${BASEDIR}/${FF} ]; then
                        echo "Cannot read file: ${BASEDIR}/${F}"        \
                            >/dev/stderr
                        touch .err


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to