Author: emaste
Date: Fri Dec  9 17:21:59 2016
New Revision: 309742
URL: https://svnweb.freebsd.org/changeset/base/309742

Log:
  MFC r306825: portsnap: use lam on the known good hash list
  
  This change is equivalent to the approach committed in r306417, but if
  sed has a bug it could be exploited by the untrusted tar file. Instead,
  generate the expected tar content and compare that with find's output.
  
  Submitted by: cperciva (in review D8052)

Modified:
  stable/11/usr.sbin/portsnap/portsnap/portsnap.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- stable/11/usr.sbin/portsnap/portsnap/portsnap.sh    Fri Dec  9 17:20:24 
2016        (r309741)
+++ stable/11/usr.sbin/portsnap/portsnap/portsnap.sh    Fri Dec  9 17:21:59 
2016        (r309742)
@@ -691,8 +691,9 @@ fetch_snapshot() {
        fetch_index_sanity || return 1
 # Verify the snapshot contents
        cut -f 2 -d '|' INDEX.new | fetch_snapshot_verify || return 1
-       cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u > files.expected
-       find snap -mindepth 1 | sed -E 's^snap/(.*)\.gz^\1^' | sort > files.snap
+       cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u |
+           lam -s 'snap/' - -s '.gz' > files.expected
+       find snap -mindepth 1 | sort > files.snap
        if ! cmp -s files.expected files.snap; then
                echo "unexpected files in snapshot."
                return 1
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to