From 67081a93e36b1b8b87dbc39e3256a51e63f66f3f Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Jan 2016 14:38:12 -0500 Subject: install_*_pkgs(): Check return value of fopen() --- diff --git a/src/install.sh b/src/install.sh index f060b92..edd5c95 100644 --- a/src/install.sh +++ b/src/install.sh @@ -101,7 +101,9 @@ install_find_pkgs() local pkgs= mkdir -p "${root}/etc/opkg" "${root}/var/lib/opkg/lists" - fopen "${root}/etc/opkg/opkg.conf" 'w' + if ! fopen "${root}/etc/opkg/opkg.conf" 'w'; then + return 1 + fi opkg_conf_fd=${FD} install_deps= @@ -109,7 +111,9 @@ install_find_pkgs() install_md5sums= install_sha256sums= - fopen "${root}/.prokit/packages" 'w' + if ! fopen "${root}/.prokit/packages" 'w'; then + return 1 + fi pkgs_fd=${FD} while read -r opt feed_idx feed; do @@ -203,7 +207,9 @@ install_get_pkgs() mkdir -p "${root}/var/cache/opkg/archives" "${root}/tmp/opkg" \ "${root}/var/lib/opkg/info" - fopen "${root}/var/lib/opkg/status" 'w' + if ! fopen "${root}/var/lib/opkg/status" 'w'; then + return 1 + fi status_fd=${FD} for pkg in $(cat "${root}/.prokit/packages"); do -- cgit v0.9.1