Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abeeson
Copy link
Contributor

@abeeson abeeson commented May 16, 2023

Changes proposed in this pull request:

  • Remove zones from changelog SQL call
  • Improve handling for non change log entries
  • Add extra protection from accidental zone insertions causing mismatch against zone_records

$mode = "add" unless defined($mode);

$r->{zone} = $self->{nte}->{zone_name} unless defined $r->{zone};
$r->{zone} = $self->{nte}->{zone_name} unless defined( $r->{zone} );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, why add parens here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually wondering the same. When I went through my original didn't have it but on merge it was complaining about that being different, so I matched it to the other entries that had it. Happy to remove them if you'd like

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's funny, b/c in the next change up, you removed a pair. Removing them is preferred as they're no longer necessary in modern perl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem, I'll adjust them and push up the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, fixed up those on the lines above too, as well as all the older entries above. They should be consistent now

@msimerson
Copy link
Collaborator

If I'm reading this correctly, you are expanding the criteria for when an update is detected. Previously only zone_record updates where considered. Correct?

@abeeson
Copy link
Contributor Author

abeeson commented May 16, 2023

Other way around, this is to prevent zone matches coming through, which were originally erroneously included in the select from the log.

We hit a problem where we've had some zone changes come through that have resulted in lookups against very old zone records, which obviously shouldn't occur.

@msimerson
Copy link
Collaborator

msimerson commented May 16, 2023

Oh right, I read the diff wrong. You're removing zones from the list of global log entries returned. But then, if a zone property changes (like the serial, TTL, or whatnot), then that change isn't going to be detected. Not a problem?

@abeeson
Copy link
Contributor Author

abeeson commented May 16, 2023

Not a problem for this, the zones are defined and managed via a different mechanism from NicTool, and nsupdate is just inserting dynamic changes. The whole nsupdate mechanism falls apart if you are trying to manage the zones that way whilst also doing the zone records.

Copy link
Collaborator

@msimerson msimerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@msimerson msimerson merged commit 5bd4f69 into NicTool:master May 16, 2023
@msimerson msimerson mentioned this pull request Oct 3, 2025
msimerson added a commit that referenced this pull request Oct 3, 2025
* New Features
    * allow A records in in-addr.arpa #230
    * import
        * tinydns type 'S' records #246
        * bind: add CAA imports #225
    * client: add SSHFP algos 4 & 6 #303
    * export/BIND: add sort order #270
* Fixes
    * bump DB version to 2.35 on new install (was 2.27)
    * sql
        * add quotes to rank (now a MySQL keyword)
        * don't save empty strings for INTs #268
        * zone.last_publish: TIMESTAMP DEFAULT 0 -> DATETIME DEFAULT NULL #249
    * SRV: always octal_escape numbers correctly #302
    * CAA: remove any quotes added to domain name #302
    * update MANIFEST path #302
    * NAPTR: do not export/encode quotes #302
    * NAPTR: tinydns export fix #297
    * URI: tinydns export needs target escaped #296
    * export: store last ts separate #247
    * client: fix user password change #241
* Updates & Changes
    * client: add help for CAA records #219
    * client: require NAPTR replacement #221
    * client: only send cookie when secure #181
    * zr/sanity: don't allow spaces in names #238
    * import/bind: strip trailing dot from zone #248
    * import/bind: report reason on rejected records #178
    * import/tinydns:
        * append trailing . to SOA mname and rname if missing #166
        * anchor record type detection for case lowering #165
        * add imports for type 3 & 6 (IPv6 patch) #167
        * handle ascii and binary in AAAA rdata #163
        * improved TXT & SPF imports #171
    * disable SPF records by default (flip DB flag to enable) #168
    * expand UTF support to cover all UTF8 characters (requires MySQL 5.5+)
        * change table encoding from utf8 (3 bits) to utf8mb4 (4 bits) #170
    * Export/BIND: export CAA correctly #193
    * Export/BIND/dyn: fixes for ZR updates #199, #306
    * Export/Dyn: more robust handling of zone deletions, that could
      result in a new zone with the same name getting unpublished.
    * Exports: split long SPF records into 255 byte strings #173
    * Exports: run postflight after no-change export
    * session: prune pass_salt from result hash
    * session: omit sessions from deleted groups
    * test: delete tests already migrated to nt3
    * zone2nic: match domain w/o case #254
    * improved sql/create_tables.pl #190
    * docker: container updates #300, #269, #267, #266, #265, #264, #263, #262, #260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants