]> git.puffer.fish Git - mirror/frr.git/commit
lib: vty: fix config-write fd leak 906/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 4 Aug 2017 10:05:38 +0000 (12:05 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 4 Aug 2017 10:15:54 +0000 (12:15 +0200)
commit10b8a9c0070e028daa072671427c44b051723c91
tree92f74ed90da526f40939b27266a6bcf880456619
parent3619938e2fba87a7600ad3febf551e6ef3dc611e
lib: vty: fix config-write fd leak

Since we were only setting vty->wfd in config_write, vty->fd would
remain 0 and vty_close() wouldn't close vty->wfd.

Clean up the entire fd closing and make it more explicit.  We were even
trying to write to stdin...

Reported-by: Jorge Boncompte <jbonor@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vty.c