bool GSQLBackend::isMaster(const DNSName &domain, const string &ip)
{
- if (!isOurDomain(domain)) return false;
+ if (!isOurDomain(&domain)) return false;
try {
d_MasterOfDomainsZoneQuery_stmt->
bool GSQLBackend::setMaster(const DNSName &domain, const string &ip)
{
- if (!isOurDomain(domain)) return false;
+ if (!isOurDomain(&domain)) return false;
try {
d_UpdateMasterOfZoneQuery_stmt->
bool GSQLBackend::setKind(const DNSName &domain, const DomainInfo::DomainKind kind)
{
- if (!isOurDomain(domain)) return false;
+ if (!isOurDomain(&domain)) return false;
try {
d_UpdateKindOfZoneQuery_stmt->
bool GSQLBackend::setAccount(const DNSName &domain, const string &account)
{
- if (!isOurDomain(domain)) return false;
+ if (!isOurDomain(&domain)) return false;
try {
d_UpdateAccountOfZoneQuery_stmt->
bool GSQLBackend::getDomainInfo(const DNSName &domain, DomainInfo &di)
{
- if (!isOurDomain(domain)) return false;
+ if (!isOurDomain(&domain)) return false;
/* fill DomainInfo from database info:
id,name,master IP(s),last_check,notified_serial,type,account */
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
if (!ordername.empty()) {
if (qtype == QType::ANY) {
bool GSQLBackend::updateEmptyNonTerminals(uint32_t domain_id, const DNSName& zonename, set<DNSName>& insert, set<DNSName>& erase, bool remove)
{
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
if(remove) {
try {
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(DNSName(""),id)) return false;
+ if (!isOurDomain(nullptr,id)) return false;
// cerr<<"gsql before/after called for id="<<id<<", qname='"<<qname<<"'"<<endl;
after.clear();
{
if(!d_dnssecQueries)
return -1;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_AddDomainKeyQuery_stmt->
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_ActivateDomainKeyQuery_stmt->
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_DeactivateDomainKeyQuery_stmt->
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_RemoveDomainKeyQuery_stmt->
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_ListDomainKeysQuery_stmt->
bool GSQLBackend::getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta)
{
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_GetAllDomainMetadataQuery_stmt->
{
if(!d_dnssecQueries && isDnssecDomainMetadata(kind))
return false;
- if (!isOurDomain(name)) return false;
+ if (!isOurDomain(&name)) return false;
try {
d_ClearDomainMetadataQuery_stmt->
bool GSQLBackend::list(const DNSName &target, int domain_id, bool include_disabled)
{
- if (!isOurDomain(target, domain_id)) return false;
+ if (!isOurDomain(&target, domain_id)) return false;
DLOG(L<<"GSQLBackend constructing handle for list of domain id '"<<domain_id<<"'"<<endl);
}
bool GSQLBackend::listSubZone(const DNSName &zone, int domain_id) {
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
string wildzone = "%." + stripDot(zone.toString()); // tolower()?
bool GSQLBackend::replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset)
{
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
try {
if (qt != QType::ANY) {
bool GSQLBackend::feedEnts(int domain_id, map<DNSName,bool>& nonterm)
{
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
for(const auto& nt: nonterm) {
try {
{
if(!d_dnssecQueries)
return false;
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
string ordername;
bool GSQLBackend::startTransaction(const DNSName &domain, int domain_id)
{
- if (domain_id >=0 && !isOurDomain(DNSName(""), domain_id)) return false;
+ if (domain_id >=0 && !isOurDomain(nullptr, domain_id)) return false;
try {
d_db->startTransaction();
bool GSQLBackend::calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial)
{
- if (!isOurDomain(DNSName(""), sd.domain_id)) return false;
+ if (!isOurDomain(nullptr, sd.domain_id)) return false;
if (d_ZoneLastChangeQuery.empty()) {
// query not set => fall back to default impl
return DNSBackend::calculateSOASerial(domain, sd, serial);
bool GSQLBackend::listComments(const uint32_t domain_id)
{
- if (!isOurDomain(DNSName(""), domain_id)) return false;
+ if (!isOurDomain(nullptr, domain_id)) return false;
try {
d_query_name = "list-comments-query";
comment.content = row[5];
}
-bool GSQLBackend::isOurDomain(const DNSName &zone, int domain_id) {
+bool GSQLBackend::isOurDomain(const DNSName *zone, int domain_id) {
try {
d_IsOurDomainQuery_stmt->
- bind("id", domain_id)->
- bind("zone", zone)->
+ bind("id", domain_id);
+ if (zone)
+ d_IsOurDomainQuery_stmt->bind("zone", *zone);
+ else
+ d_IsOurDomainQuery_stmt->bindNull("zone");
+ d_IsOurDomainQuery_stmt->
execute()->
getResult(d_result)->
reset();