]> git.ozlabs.org Git - ppp.git/commit
passwordfd: read password during option processing (#420)
authorMike Gilbert <floppym@gentoo.org>
Thu, 3 Aug 2023 08:57:23 +0000 (04:57 -0400)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 08:57:23 +0000 (18:57 +1000)
commitd190be23688da3ec15a1dad84b1ce9a1337656bb
treee1f76d267624515f349af6fa5dd24a157e467267
parent091e69b4e612427eeb95410dbc73eff10ea5dadb
passwordfd: read password during option processing (#420)

When configured to detach from the controlling terminal, pppd closes
file descriptors 0, 1, and 2 before the passwd hook is called. If the
user passes 0, 1, or 2 to the passwordfd option, pppd will fail to read
the password.

To work around this, treat passwordfd as a special option and read the
password during option processing, before pppd closes it.

Bug: https://bugs.gentoo.org/209294

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
pppd/plugins/passwordfd.c