diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-01-27 21:46:26 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-01-27 21:46:26 +0000 |
commit | 68c7ab7473f68cbae78010ba1335541deb85154d (patch) | |
tree | c29beaa6b603a28a8a0579286c55f2d84e39f0a7 /kiss | |
parent | 94cf07d24bb9e47b5fe48ac8145464b37c205148 (diff) | |
download | cpt-68c7ab7473f68cbae78010ba1335541deb85154d.tar.gz |
kiss: fix cache
FossilOrigin-Name: 6865e6737fb8182ed991e7faa7ee7c3d11df8d1570207f89abe69f0732a18fa4
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -77,22 +77,18 @@ root_cache() { # by the user. The below commands read from '/dev/tty' to ensure # they work when run from a subshell. stty -F /dev/tty -echo - read -r pass < /dev/tty ||: + read -r pass < /dev/tty && cached=1 stty -F /dev/tty echo printf '\n' # Validate the password now with a simple 'true' command as we # don't yet need to elevate permissions. - # - # Rather than checking if the '$pass' variable is non-empty, - # use an additional variable. The '[' command can be external - # which would result in '/proc' leakage. - dosu /bin/true && have_pw=1 + dosu /bin/true } dosu() { - [ "$have_pw" ] || root_cache + [ "$cached" ] || root_cache # Declare this as a function to avoid repeating it twice # below. Great naming of functions all around. @@ -551,7 +547,7 @@ pkg_build() { [ $# -gt 1 ] || [ "$pkg_update" ] && { prompt - [ "$have_pw" ] || root_cache + [ "$cached" ] || root_cache } log "Checking to see if any dependencies have already been built" |