Browse Source

fix INSTALLURL detection

reported by Alexey Proschenko
> There is unsafe use of "cat /etc/installurl" in PKG_PATH composition code
> because of man INSTALLURL(5):
> "Empty lines and lines beginning with ‘#’ in the file are ignored."

the current code was looking for the first line not starting with #
which was wrong in case the line was empty.
hacker
Solene Rapenne 9 months ago
parent
commit
c13f3d30dc
  1. 2
      pkgupdate

2
pkgupdate

@ -1,6 +1,6 @@
#!/bin/sh
INSTALLURL=$(grep -v ^# /etc/installurl | head -n 1)
INSTALLURL=$(awk '/^./ && ! /^#/ { print ; exit }' /etc/installurl)
export PKG_PATH="${INSTALLURL}/$(uname -r)/packages-stable/$(machine)/"
CACHE_DIR=/var/cache/pkgupdate/

Loading…
Cancel
Save