• Welcome to The Network People Support Forums. Please login or sign up.

nt_export_djb.pl has hardcoded location for tinydns-data

Started by monachus, June 18, 2009, 08:25:25 PM

Previous topic - Next topic


On line 353 of nt_export_djb.pl the location of the tinydns-data script is hardcoded to /usr/local/bin.  This should be a configurable option, perhaps a variable at the top of the file, a parameter with a default, or else some logic to find the binary itself.  At the very least, it should test that the binary exists before calling it and exit gracefully (with a nice error) - not with the error that tinydns-data exited with some arbitrary and non-useful error code.

my $djb_error = system("/usr/local/bin/tinydns-data");
Adrian Goins - President / CEO
Arces Network, LLC

PGP Key: 1024D/8AADA4B8 2009-04-20
Fingerprint: E3CD 96EA DF3F B345 7ADB  FB74 31EC 9F54 8AAD A4B8


-    my $djb_error = system("/usr/local/bin/tinydns-data");
+    my $tinydata = '/usr/local/bin/tinydns-data';
+    $tinydata = '/usr/bin/tinydns-data' if ! -x $tinydata;
+    die "unable to find tinydns-data" if ! -x $tinydata;
+    my $djb_error = system($tinydata);