Changeset 1251

Show
Ignore:
Timestamp:
03/15/10 16:34:17 (5 months ago)
Author:
Hugo
Message:

iDNS: unstable save commit don't use

Location:
trunk/unxsBind
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/unxsBind/interfaces/org/resource.c

    r1249 r1251  
    15701570        else if(1) 
    15711571        { 
    1572                 gcMessage="<blink>Must select valid Resource Type (A,MX,PTR,TXT,NS,CNAME,HINFO)</blink>"; 
     1572                gcMessage="<blink>Must select valid Resource Type (A,MX,PTR,TXT,NS,CNAME,HINFO,NAPTR,AAAA)</blink>"; 
    15731573                cRRTypeStyle="type_fields_req"; 
    15741574                return(16); 
  • trunk/unxsBind/mysqlrad.h

    r1215 r1251  
    168168void ExttZoneGetHook(entry gentries[], int x); 
    169169void ExttZoneNavBar(void); 
     170unsigned OnLineZoneCheck(unsigned uZone,unsigned uCalledMode,unsigned uCalledFrom); 
    170171 
    171172//tResource 
  • trunk/unxsBind/tzonefunc.h

    r1132 r1251  
    104104void PrepareTestData(unsigned uResource,char *cName,char *cParam1,char *cParam2,char *cParam3, 
    105105                        char *cParam4,char *cRRType,char *cComment,unsigned uRRTTL,unsigned uCalledFrom); 
    106 unsigned OnLineZoneCheck(unsigned uCalledFrom); 
    107106void PrepDelToolsTestData(unsigned uNumIPs); 
    108107 
     
    842841                        //named-checkzone online check 
    843842                        PrepDelToolsTestData(uNumIPs); 
    844                         OnLineZoneCheck(1); 
     843                        OnLineZoneCheck(uZone,4001,1); 
    845844                        fprintf(stderr,"cNSList=%s\n",cNSList); 
    846845                        while(1) 
     
    36393638 
    36403639 
    3641 unsigned OnLineZoneCheck(unsigned uCalledFrom) 
     3640unsigned OnLineZoneCheck(unsigned uZone,unsigned uCalledMode,unsigned uCalledFrom) 
    36423641{ 
    36433642        //This function will create a zonefile online and run named-checkzone 
     
    36483647        FILE *zfp; 
    36493648        FILE *dnfp; 
    3650         unsigned uZone=0; 
    36513649        unsigned uRRType=0; 
    36523650        char cTTL[50]={""}; 
    36533651        char cZoneFile[100]={""}; 
    3654  
    3655         //PrepareTestData(uResource,cName,cParam1,cParam2,cParam3,cParam4,cRRType,cComment,uRRTTL,uCalledFrom); 
    3656          
     3652        char cZone[256]={""}; 
     3653        static char cMessage[512]={""}; 
     3654 
    36573655        //Test if named-checkzone can be run, otherwise return 0 
    36583656        if(access("/usr/sbin/named-checkzone",X_OK)==-1) return(0); //Ticket #100 
    36593657 
     3658        sprintf(cZone,"%.255s",ForeignKey("tZone","cZone",uZone)); 
    36603659        sprintf(cZoneFile,"/tmp/%s",cZone); 
    36613660 
     
    36703669                        "tZone.uMailServers,tZone.cMainAddress,tView.cLabel FROM tZone,tNSSet,tNS,tView" 
    36713670                        " WHERE tZone.uNSSet=tNSSet.uNSSet AND tNSSet.uNSSet=tNS.uNSSet AND" 
    3672                         " tZone.uView=tView.uView AND tZone.cZone='%s' AND tZone.uView='%u'",cZone,uView); 
     3671                        " tZone.uView=tView.uView AND tZone.uZone=%u'",uZone); 
    36733672 
    36743673        mysql_query(&gMysql,gcQuery); 
     
    37023701                //13 tView.cMaster 
    37033702                //14 tView.uOrder 
    3704                 sscanf(field[1],"%u",&uZone); 
    3705          
    37063703                if((cp=strchr(field[3],' '))) *cp=0; 
    37073704 
     
    37483745                while((field2=mysql_fetch_row(res2))) 
    37493746                { 
     3747                        char cRRType[9]=""; 
     3748 
    37503749                        sscanf(field2[2],"%u",&uRRType); 
     3750                        sprintf(cRRType,"%.8s",GetRRType(uRRType)); 
     3751 
    37513752                        if(field2[1][0]!='0') strcpy(cTTL,field2[1]); 
     3753 
    37523754                        //Do not write TTL if cName is a $GENERATE line 
    37533755                        if(strstr(field2[0],"$GENERATE")==NULL) 
    37543756                        { 
    3755                                 if(strcmp(GetRRType(uRRType),"SRV")) 
    3756                                         fprintf(zfp,"%s\t%s\t%s\t%s\t%s\n", 
    3757                                                         field2[0], 
    3758                                                         cTTL, 
    3759                                                         GetRRType(uRRType), 
    3760                                                         field2[3], 
    3761                                                         field2[4]); 
    3762                                 else 
     3757                                if(!strcmp(cRRType,"SRV")) 
    37633758                                        fprintf(zfp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 
    37643759                                                        field2[0], 
    37653760                                                        cTTL, 
    3766                                                         GetRRType(uRRType), 
     3761                                                        cRRType, 
    37673762                                                        field2[3], 
    37683763                                                        field2[4], 
    37693764                                                        field2[5], 
    37703765                                                        field2[6]); 
     3766                                else if(!strcmp(cRRType,"NAPTR")) 
     3767                                        fprintf(zfp,"%s\t%s\t%s\t%s\t%s\t(%s\t%s)\n", 
     3768                                                        field2[0], 
     3769                                                        cTTL, 
     3770                                                        cRRType, 
     3771                                                        field2[3], 
     3772                                                        field2[4], 
     3773                                                        field2[5], 
     3774                                                        field2[6]); 
     3775                                else if(1) 
     3776                                        fprintf(zfp,"%s\t%s\t%s\t%s\t%s\n", 
     3777                                                        field2[0], 
     3778                                                        cTTL, 
     3779                                                        cRRType, 
     3780                                                        field2[3], 
     3781                                                        field2[4]); 
    37713782                        } 
    37723783                        else 
     3784                        { 
    37733785                                fprintf(zfp,"%s\t%s\t%s\t%s\n", 
    37743786                                                field2[0], 
    3775                                                 GetRRType(uRRType), 
     3787                                                cRRType, 
    37763788                                                field2[3], 
    37773789                                                field2[4]); 
    3778                 } 
     3790                        } 
     3791                } 
     3792                 
    37793793                mysql_free_result(res2); 
    37803794                fclose(zfp); 
     
    37973811                                        cp=strstr(cLine,cZoneFile); 
    37983812                                        cp=cp+strlen(cZoneFile)+2; //2 more chars ': ' 
    3799                                         sprintf(gcQuery,"<blink>Error: </blink> The RR has an error: %s",cp); 
     3813                                        sprintf(cMessage,"<blink>Error: </blink> The RR has an error: %s",cp); 
    38003814                                        if(uCalledFrom) 
    38013815                                        { 
    3802                                                 guMode=4001; 
    3803                                                 tZone(gcQuery); 
     3816                                                guMode=uCalledMode; 
     3817                                                tZone(cMessage); 
    38043818                                        } 
    38053819                                        else 
    3806                                                 tResource(gcQuery); 
     3820                                        { 
     3821                                                guMode=uCalledMode; 
     3822                                                tResource(cMessage); 
     3823                                        } 
    38073824                                } 
    38083825                        }