Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem at line 185 of deb-get script #721

Closed
peutch opened this issue Jan 11, 2023 · 1 comment
Closed

problem at line 185 of deb-get script #721

peutch opened this issue Jan 11, 2023 · 1 comment

Comments

@peutch
Copy link
Contributor

peutch commented Jan 11, 2023

Hi,

the cited line is:

if ! "${ELEVATE}" wget -q --no-use-server-timestamps "${1}" -O "${CACHE_FILE}"; then

and I think that it should be:

if ! ${ELEVATE} wget -q --no-use-server-timestamps "${1}" -O "${CACHE_FILE}"; then

otherwise when ${ELEVATE} is empty the test be always true.

@philclifford
Copy link
Member

hmmm ... good spot

if ! "$ELEVATE" echo oops ; then echo fail;else echo not fail;fi
Command '' not found, but can be installed with:
sudo apt install mailutils-mh  # version 1:3.15-2, or
sudo apt install mmh           # version 0.4-4
sudo apt install nmh           # version 1.7.1-12
sudo apt install termtris      # version 1.3-1ubuntu1
fail # <--
$ if ! "$ELEVATE echo oops" ; then echo fail;else echo not fail;fi
 echo oops: command not found
fail # <--
 $ if ! $ELEVATE echo oops ; then echo fail;else echo not fail;fi
oops
not fail  # <--

subtle because it only gets set to "" if we call elevate_privs as root already and otherwise it is set to sudo or doas or we bail.

peutch added a commit to peutch/deb-get that referenced this issue Jan 13, 2023
philclifford pushed a commit to philclifford/deb-get that referenced this issue Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants