Opened 2 years ago

Last modified 2 years ago

#80 new task

Settle on a method to find internal libraries

Reported by: Kris Deugau Owned by:
Priority: major Milestone:
Version: Keywords:
Cc:

Description

With recent-ish Perl releases, "." was justifiably removed from @INC.

This used to mostly work to keep scripts with library modules working when plonked down on some arbitrary path, but wasn't entirely reliable.

Strictly hardcoding a path works fine for any one given installation, but doesn't work well for code expected to be portable or easily moved elsewhere within a single system.

Some searching led to FindBin, applied in r797. However, after encountering a tainting issue with that fix, further searching led to https://www.perlmonks.org/?node_id=585299 and https://www.perlmonks.org/?node_id=41213, pretty clearly indicating that while FindBin basically worked, it a) did a lot of unnecessary work and b) largely succeeded by accident.

The second link led to the "scriptname" module, however on closer inspection it checks the script name for a handful of file extensions - which doesn't include several used by DNSAdmin. Also, this code is expected to run on some Truly Ancient(TM) systems on which it would be a pain to get said module properly installed.

Change History (5)

comment:1 by Kris Deugau, 2 years ago

In 834:

/trunk

Accumulated tinkering on compact-recs.pl, part 1

  • Switch module-finding blob to latest theoretically-good form. See #80.
  • Fix broken handling of "n'th natural IP" on compaction, possibly also on export
  • Trim some development comments

comment:2 by Kris Deugau, 2 years ago

In 837:

/trunk

Commit some lurking tweaks to mergerecs

  • user info for log
  • use location of ':ANY:' to find and match domains or reverse zones that may have default locations set

Update include path finder - see #80

comment:3 by Kris Deugau, 2 years ago

In 839:

/trunk

Update dns.cgi include path finder - see #80
Allow more characters through from the web layer to the back end for the

record search and record list filter, building on r838

comment:4 by Kris Deugau, 2 years ago

In 841:

/trunk

Update textrecs.cgi include path finder - see #80

comment:5 by Kris Deugau, 2 years ago

In 843:

/trunk

Minor accumulated refinements on tiny-import.pl

  • Update include path finder - see #80
  • Clean up extra trailing :'s that sometimes confused the location
  • Better handle "empty" TTL values
  • Slightly improve SOA serial type tagging; only handles the most common case of "let tinydns handle it" UNIX-epoch serials for now
Note: See TracTickets for help on using tickets.