Changeset 1251
- Timestamp:
- 03/15/10 16:34:17 (5 months ago)
- Location:
- trunk/unxsBind
- Files:
-
- 3 modified
-
interfaces/org/resource.c (modified) (1 diff)
-
mysqlrad.h (modified) (1 diff)
-
tzonefunc.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/unxsBind/interfaces/org/resource.c
r1249 r1251 1570 1570 else if(1) 1571 1571 { 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>"; 1573 1573 cRRTypeStyle="type_fields_req"; 1574 1574 return(16); -
trunk/unxsBind/mysqlrad.h
r1215 r1251 168 168 void ExttZoneGetHook(entry gentries[], int x); 169 169 void ExttZoneNavBar(void); 170 unsigned OnLineZoneCheck(unsigned uZone,unsigned uCalledMode,unsigned uCalledFrom); 170 171 171 172 //tResource -
trunk/unxsBind/tzonefunc.h
r1132 r1251 104 104 void PrepareTestData(unsigned uResource,char *cName,char *cParam1,char *cParam2,char *cParam3, 105 105 char *cParam4,char *cRRType,char *cComment,unsigned uRRTTL,unsigned uCalledFrom); 106 unsigned OnLineZoneCheck(unsigned uCalledFrom);107 106 void PrepDelToolsTestData(unsigned uNumIPs); 108 107 … … 842 841 //named-checkzone online check 843 842 PrepDelToolsTestData(uNumIPs); 844 OnLineZoneCheck( 1);843 OnLineZoneCheck(uZone,4001,1); 845 844 fprintf(stderr,"cNSList=%s\n",cNSList); 846 845 while(1) … … 3639 3638 3640 3639 3641 unsigned OnLineZoneCheck(unsigned u CalledFrom)3640 unsigned OnLineZoneCheck(unsigned uZone,unsigned uCalledMode,unsigned uCalledFrom) 3642 3641 { 3643 3642 //This function will create a zonefile online and run named-checkzone … … 3648 3647 FILE *zfp; 3649 3648 FILE *dnfp; 3650 unsigned uZone=0;3651 3649 unsigned uRRType=0; 3652 3650 char cTTL[50]={""}; 3653 3651 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 3657 3655 //Test if named-checkzone can be run, otherwise return 0 3658 3656 if(access("/usr/sbin/named-checkzone",X_OK)==-1) return(0); //Ticket #100 3659 3657 3658 sprintf(cZone,"%.255s",ForeignKey("tZone","cZone",uZone)); 3660 3659 sprintf(cZoneFile,"/tmp/%s",cZone); 3661 3660 … … 3670 3669 "tZone.uMailServers,tZone.cMainAddress,tView.cLabel FROM tZone,tNSSet,tNS,tView" 3671 3670 " 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); 3673 3672 3674 3673 mysql_query(&gMysql,gcQuery); … … 3702 3701 //13 tView.cMaster 3703 3702 //14 tView.uOrder 3704 sscanf(field[1],"%u",&uZone);3705 3706 3703 if((cp=strchr(field[3],' '))) *cp=0; 3707 3704 … … 3748 3745 while((field2=mysql_fetch_row(res2))) 3749 3746 { 3747 char cRRType[9]=""; 3748 3750 3749 sscanf(field2[2],"%u",&uRRType); 3750 sprintf(cRRType,"%.8s",GetRRType(uRRType)); 3751 3751 3752 if(field2[1][0]!='0') strcpy(cTTL,field2[1]); 3753 3752 3754 //Do not write TTL if cName is a $GENERATE line 3753 3755 if(strstr(field2[0],"$GENERATE")==NULL) 3754 3756 { 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")) 3763 3758 fprintf(zfp,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 3764 3759 field2[0], 3765 3760 cTTL, 3766 GetRRType(uRRType),3761 cRRType, 3767 3762 field2[3], 3768 3763 field2[4], 3769 3764 field2[5], 3770 3765 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]); 3771 3782 } 3772 3783 else 3784 { 3773 3785 fprintf(zfp,"%s\t%s\t%s\t%s\n", 3774 3786 field2[0], 3775 GetRRType(uRRType),3787 cRRType, 3776 3788 field2[3], 3777 3789 field2[4]); 3778 } 3790 } 3791 } 3792 3779 3793 mysql_free_result(res2); 3780 3794 fclose(zfp); … … 3797 3811 cp=strstr(cLine,cZoneFile); 3798 3812 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); 3800 3814 if(uCalledFrom) 3801 3815 { 3802 guMode= 4001;3803 tZone( gcQuery);3816 guMode=uCalledMode; 3817 tZone(cMessage); 3804 3818 } 3805 3819 else 3806 tResource(gcQuery); 3820 { 3821 guMode=uCalledMode; 3822 tResource(cMessage); 3823 } 3807 3824 } 3808 3825 }
