Skip to content

Don't flood stdout with unanswered question

Arnaud Rebillout requested to merge arnaudr/dput-ng:fix-login-question into master

I happen to run dput from a script (via rebuildd), and I guess that stdin is closed by rebuildd. In that case, the question(s) asked by dput-ng is asked non-stop in a wild loop, as sys.stdin.realine() returns immediately.

To reproduce: first assume that you try to upload to a host that is unknown (not present in known_hosts), dput will prompt as such:

please login: To accept ssh-ed25519 hostkey b'<...>' for repo.kali.org type "yes": [yes, no]:

Now run this script:

#!/bin/sh
exec 0</dev/null
dput -U <host> <some-package>.changes

And witness the flood, which either wastes your terminal, or quickly fills up gigabytes if stdout is redirected.

This commit limits the damage.

Edited by Arnaud Rebillout

Merge request reports

Loading