}
}
+ if (suppliedrecords == nullptr && (di.backend->getCapabilities() & DNSBackend::CAP_LIST) == 0) {
+ cout << "Backend for zone '" << zone << "' does not support listing its contents." << endl;
+ return 1;
+ }
+
SOAData sd;
try {
if (!B.getSOAUncached(zone, sd)) {
cerr << "Zone '" << zone << "' not found!" << endl;
return EXIT_FAILURE;
}
+ if ((di.backend->getCapabilities() & DNSBackend::CAP_LIST) == 0) {
+ cerr << "Backend for zone '" << zone << "' does not support listing its contents," << endl;
+ return EXIT_FAILURE;
+ }
+
di.backend->list(zone, di.id);
DNSResourceRecord rr;
cout<<"$ORIGIN ."<<endl;
cerr << "Zone '" << zone << "' not found!" << endl;
return EXIT_FAILURE;
}
+ if ((di.backend->getCapabilities() & DNSBackend::CAP_LIST) == 0) {
+ cerr << "Backend for zone '" << zone << "' does not support listing its contents," << endl;
+ return EXIT_FAILURE;
+ }
if (isatty(STDIN_FILENO) == 0) {
cerr << "edit-zone requires a terminal" << endl;
return 1;
}
+ if ((src->getCapabilities() & DNSBackend::CAP_LIST) == 0) {
+ cerr << "Source backend does not support listing zone contents." << endl;
+ return 1;
+ }
cout<<"Moving zone(s) from "<<src->getPrefix()<<" to "<<tgt->getPrefix()<<endl;
vector<DomainInfo> domains;
// move comments
nc=0;
if (src->listComments(di.id)) {
+ if ((tgt->getCapabilities() & DNSBackend::CAP_COMMENTS) == 0) {
+ throw PDNSException("Target backend does not support comments - remove them first");
+ }
Comment c; // NOLINT(readability-identifier-length)
while(src->getComment(c)) {
// NOLINTNEXTLINE(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
c.domain_id = di_new.id;
if (!tgt->feedComment(c)) {
- throw PDNSException("Target backend does not support comments - remove them first");
+ throw PDNSException("Failed to feed zone comments");
}
nc++;
}
return 1;
}
+ if ((matchingBackend->getCapabilities() & DNSBackend::CAP_DIRECT) == 0) {
+ cerr << "Backend '" << cmds.at(1) << "' does not support direct commands" << endl;
+ return 1;
+ }
+
for (auto i = next(begin(cmds), 2); i != end(cmds); ++i) {
cerr << "== " << *i << endl;
cout << matchingBackend->directBackendCmd(*i);