leamas / ddupdate

Update DNS Data for Dynamic IP Addresses
MIT License
40 stars 28 forks source link

nsupdate plugin: properly capture stderr #42

Closed aerusso closed 3 years ago

aerusso commented 4 years ago

I'm embarrassed to say that, while I have made heavy use of this plugin that I submitted last year, I only now have gotten around to fixing this silly mistake of mine. The plugin does not recognize errors returned by nsupdate, because it isn't properly capturing stderr. This patch fixes it.

The nsupdate plugin calls the same-named binary using the subprocess.Popen class, which by default, does NOT capture stderr output. Because of this, errors occurring during calls to nsupdate are not properly reflected by ddupdate.

Set stderr=PIPE, and then check for any stderr output. In the event of any such output, print the error output, and return failure.

leamas commented 3 years ago

Thanks for fix merging.