]> git.ipfire.org Git - thirdparty/shadow.git/commit
Read whole line in yes_or_no
authorSamanta Navarro <ferivoz@riseup.net>
Fri, 27 Jan 2023 11:53:57 +0000 (11:53 +0000)
committerSerge Hallyn <serge@hallyn.com>
Fri, 21 Apr 2023 23:12:56 +0000 (18:12 -0500)
commit0c83b981053b65c9bab4f1c2e60d004e920f8faf
treefbbf42561abeaeee04514e1a57c9c8477b5f11be
parentc80788a3ac092bc5abfa89ff48060d3f95cd5812
Read whole line in yes_or_no

Do not stop after 79 characters. Read the complete line to avoid
arbitrary limitations.

Proof of Concept:

```
cat > passwd-poc << EOF
root:x:0:0:root:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
EOF
python -c "print(80*'y')" | pwck passwd-poc
```

Two lines should still be within the file because we agreed only once
to remove a duplicated line.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
libmisc/yesno.c