Useful tip on nsupdate -- readline support.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Useful tip on nsupdate -- readline support.

Warren Kumari
Hi there all,

I manually use nsupdate to make some changes to some of my zones -
most recently I had to add a bunch of reverse DNS records. These are
all very similar - the first octet changes, and then the target name
changes. Unfortuniatly nsupdate doesn't support readline, and so the
obvious "press up arrow, edit previous line, press enter" doesn't
work, and so I end up entering one line, copying that into an editor,
making changes, pasting, making changes, etc.

I just stumbled across this --
https://dnsworkshop.de/nsupdate-history.html by Carsten Strotmann

Basically, uses rlwrap to wrap readline support into nsupdate - you
just call `rlwrap nsupdate` and magically nsupdate now supports
editing.

'tis a simple trick, but removes much annoyance.

W
[0]: Yes, I know I could rndc sync, rndc freeze, edit, rndc thaw, etc
-- but this is easier!

--
I don't think the execution is relevant when it was obviously a bad
idea in the first place.
This is like putting rabid weasels in your pants, and later expressing
regret at having chosen those particular rabid weasels and that pair
of pants.
   ---maf
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: Useful tip on nsupdate -- readline support.

Mukund Sivaraman-2
On Tue, Jun 11, 2019 at 10:03:30AM -0400, Warren Kumari wrote:

> Hi there all,
>
> I manually use nsupdate to make some changes to some of my zones -
> most recently I had to add a bunch of reverse DNS records. These are
> all very similar - the first octet changes, and then the target name
> changes. Unfortuniatly nsupdate doesn't support readline, and so the
> obvious "press up arrow, edit previous line, press enter" doesn't
> work, and so I end up entering one line, copying that into an editor,
> making changes, pasting, making changes, etc.
>
> I just stumbled across this --
> https://dnsworkshop.de/nsupdate-history.html by Carsten Strotmann
>
> Basically, uses rlwrap to wrap readline support into nsupdate - you
> just call `rlwrap nsupdate` and magically nsupdate now supports
> editing.
>
> 'tis a simple trick, but removes much annoyance.

nsupdate has built-in readline support (when it finds it during build).
(Though, for for some reason, the nsupdate that ships with Fedora
doesn't seem to be linking to readline.)

On that note, buyer beware. A warning to all redistributors who
commercially repackage BIND with modifications (whether with blessing
from ISC or not):

* readline is GPL, and so you'll link your code to GPL if you link to it
  (which can be esp. bad for you if you modify libisc, libdns,
  etc. also). It's best to either remove readline from such build
  environments (libedit may be a suitable drop-in replacement), or
  configure without it, or patch out the code.

  There is some interesting GPL license enforcement history with readline:
 
  https://en.wikipedia.org/wiki/GNU_Readline#Choice_of_the_GPL_as_GNU_Readline's_license
  https://gitlab.com/gnu-clisp/clisp/blob/master/doc/Why-CLISP-is-under-GPL

* libcap (POSIX capablities) is GPL similarly. An alternative is
  libcap-ng which is LGPLv2+, but it has a different API.

I think these are the only two libraries that are copyleft vs. BIND's
ISC (before) and MPL2 (now) licenses, and because they're GPL, your work
will be covered by GPL if you link against them.

This is usually not bad for the general public (and good for free
software), but if you're a commercial re-distributor of BIND and are
linking to GPL, good luck. I'm sure you'll even miss seeing this
thread. :)

                Mukund
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: Useful tip on nsupdate -- readline support.

Warren Kumari
On Tue, Jun 11, 2019 at 10:59 AM Mukund Sivaraman <[hidden email]> wrote:

>
> On Tue, Jun 11, 2019 at 10:03:30AM -0400, Warren Kumari wrote:
> > Hi there all,
> >
> > I manually use nsupdate to make some changes to some of my zones -
> > most recently I had to add a bunch of reverse DNS records. These are
> > all very similar - the first octet changes, and then the target name
> > changes. Unfortuniatly nsupdate doesn't support readline, and so the
> > obvious "press up arrow, edit previous line, press enter" doesn't
> > work, and so I end up entering one line, copying that into an editor,
> > making changes, pasting, making changes, etc.
> >
> > I just stumbled across this --
> > https://dnsworkshop.de/nsupdate-history.html by Carsten Strotmann
> >
> > Basically, uses rlwrap to wrap readline support into nsupdate - you
> > just call `rlwrap nsupdate` and magically nsupdate now supports
> > editing.
> >
> > 'tis a simple trick, but removes much annoyance.
>
> nsupdate has built-in readline support (when it finds it during build).
> (Though, for for some reason, the nsupdate that ships with Fedora
> doesn't seem to be linking to readline.)
>

Yup - Jim Reid also just sent me mail mentioning this, and looking in
the nsupdate code I find:

#if defined(HAVE_READLINE)
#include <readline/readline.h>
#include <readline/history.h>
#endif

I build from source, and apparently I need to add '--with-readline' to
my configure invocation.


> On that note, buyer beware. A warning to all redistributors who
> commercially repackage BIND with modifications (whether with blessing
> from ISC or not):
>
> * readline is GPL, and so you'll link your code to GPL if you link to it
>   (which can be esp. bad for you if you modify libisc, libdns,
>   etc. also). It's best to either remove readline from such build
>   environments (libedit may be a suitable drop-in replacement), or
>   configure without it, or patch out the code.
>
>   There is some interesting GPL license enforcement history with readline:
>
>   https://en.wikipedia.org/wiki/GNU_Readline#Choice_of_the_GPL_as_GNU_Readline's_license
>   https://gitlab.com/gnu-clisp/clisp/blob/master/doc/Why-CLISP-is-under-GPL
>
> * libcap (POSIX capablities) is GPL similarly. An alternative is
>   libcap-ng which is LGPLv2+, but it has a different API.
>
> I think these are the only two libraries that are copyleft vs. BIND's
> ISC (before) and MPL2 (now) licenses, and because they're GPL, your work
> will be covered by GPL if you link against them.
>
> This is usually not bad for the general public (and good for free
> software), but if you're a commercial re-distributor of BIND and are
> linking to GPL, good luck. I'm sure you'll even miss seeing this
> thread. :)

Indeed :-)
W

>
>                 Mukund



--
I don't think the execution is relevant when it was obviously a bad
idea in the first place.
This is like putting rabid weasels in your pants, and later expressing
regret at having chosen those particular rabid weasels and that pair
of pants.
   ---maf
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: Useful tip on nsupdate -- readline support.

Tony Finch
In reply to this post by Mukund Sivaraman-2
Mukund Sivaraman <[hidden email]> wrote:
> On Tue, Jun 11, 2019 at 10:03:30AM -0400, Warren Kumari wrote:
> >
> > I manually use nsupdate to make some changes to some of my zones -
> > most recently I had to add a bunch of reverse DNS records. These are
> > all very similar - the first octet changes, and then the target name
> > changes. Unfortuniatly nsupdate doesn't support readline,

This annoyed me too, so I added readline support to BIND in 2011 ish -
I think it was one of my earliest contributions :-) See CHANGES 3244.

You might also like my `nsvi` program. https://dotat.at/prog/nsdiff/

> * readline is GPL

There are non-GPL readline clones, e.g. the BSDs have libedit which I
think should work with BIND, though I can't conveniently check right now.

Tony.
--
f.anthony.n.finch  <[hidden email]>  http://dotat.at/
the market alone does not distribute wealth or income fairly
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: Useful tip on nsupdate -- readline support.

Ondřej Surý
In reply to this post by Mukund Sivaraman-2
Hey list,

I believe this needs addressing from the BIND team.

> * readline is GPL

BIND 9 supports compilation with libedit which is 99% drop-in replacement
since 2015 (017cbd44).

The well-established open-source distributions are well aware of the readline
firm stand on the GPL vs LGPL for the downstream users of the library.

> libcap (POSIX capablities) is GPL similarly.


No, it’s really not.  libcap is 3-clause BSD with following exception added:

> ALTERNATIVELY, this product may be distributed under the terms of the
> GNU General Public License (v2.0 - see below), in which case the
> provisions of the GNU GPL are required INSTEAD OF the above
> restrictions.  (This clause is necessary due to a potential conflict
> between the GNU GPL and the restrictions contained in a BSD-style
> copyright.)

e.g. the primary license is 3-clause BSD, but in case you need to use libcap
in GNU GPL project, you are allowed to do so without considering potential
conflicts between 3-clause BSD and GPL 2.0

Cheers,
Ondrej
--
Ondřej Surý
[hidden email]

> On 11 Jun 2019, at 16:58, Mukund Sivaraman <[hidden email]> wrote:
>
> * readline is GPL, and so you'll link your code to GPL if you link to it
>  (which can be esp. bad for you if you modify libisc, libdns,
>  etc. also). It's best to either remove readline from such build
>  environments (libedit may be a suitable drop-in replacement), or
>  configure without it, or patch out the code.
>
>  There is some interesting GPL license enforcement history with readline:
>
>  https://en.wikipedia.org/wiki/GNU_Readline#Choice_of_the_GPL_as_GNU_Readline's_license
>  https://gitlab.com/gnu-clisp/clisp/blob/master/doc/Why-CLISP-is-under-GPL
>
> * libcap (POSIX capablities) is GPL similarly. An alternative is
>  libcap-ng which is LGPLv2+, but it has a different API.
>
> I think these are the only two libraries that are copyleft vs. BIND's
> ISC (before) and MPL2 (now) licenses, and because they're GPL, your work
> will be covered by GPL if you link against them.
>
> This is usually not bad for the general public (and good for free
> software), but if you're a commercial re-distributor of BIND and are
> linking to GPL, good luck. I'm sure you'll even miss seeing this
> thread. :)
>
> Mukund
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list
>
> bind-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/bind-users

_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: Useful tip on nsupdate -- readline support.

Mukund Sivaraman-2
Hi Ondrej

On Wed, Jun 12, 2019 at 04:08:20PM +0200, Ondřej Surý wrote:
> Hey list,
>
> I believe this needs addressing from the BIND team.
>
> > * readline is GPL
>
> BIND 9 supports compilation with libedit which is 99% drop-in replacement
> since 2015 (017cbd44).

I had mentioned libedit in my email too. However, readline is more
likely to be found in a Linux distribution (that an appliance bases off)
unless the packager knows about the GPL linkage and includes libedit as
a dependency.

While BIND is MPL licensed, linkage to GPL makes the overall work (of
that program) be covered by GPL. So even supporting readline adds in
additional restrictions past the MPL implicitly for the covered programs
(and arguably modified BIND library code). Perhaps you may consider a
warning about less permissive dependencies than MPL in the documentation
or at configure time, so BIND customers are aware of it.

(My comment was not based on just a random observation that it could
happen, but I'm not at liberty to discuss it.)

> The well-established open-source distributions are well aware of the readline
> firm stand on the GPL vs LGPL for the downstream users of the library.

The comment was directed at commercial (closed-source) re-distributors
of BIND such as appliance vendors, so they can check their builds.

> > libcap (POSIX capablities) is GPL similarly.
>
>
> No, it’s really not.  libcap is 3-clause BSD with following exception added:
>
> > ALTERNATIVELY, this product may be distributed under the terms of the
> > GNU General Public License (v2.0 - see below), in which case the
> > provisions of the GNU GPL are required INSTEAD OF the above
> > restrictions.  (This clause is necessary due to a potential conflict
> > between the GNU GPL and the restrictions contained in a BSD-style
> > copyright.)
>
> e.g. the primary license is 3-clause BSD, but in case you need to use libcap
> in GNU GPL project, you are allowed to do so without considering potential
> conflicts between 3-clause BSD and GPL 2.0

I was not aware of the BSD option. Fedora lists it as a GPL
package. That clears linking vs. libcap.

BTW, if this revelation was somehow problematic, then I take it back and
will go mind my own business.

                Mukund
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users