Changeset 37
- Timestamp:
- 11/30/02 00:09:08 (10 years ago)
- Location:
- trunk/pdns
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
pdns/backends/bind/zone2sql.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/ChangeLog
r19 r37 3 3 - added db2 backend to distribution 4 4 - added beginnings of ./configure autoconfiscation of mysql location 5 - fixed very embarrassing bug in bind parser - would die on escaping a ' 5 6 6 7 Changes since 2.8: -
trunk/pdns/pdns/backends/bind/zone2sql.cc
r36 r37 19 19 /* accepts a named.conf as parameter and outputs heaps of sql */ 20 20 21 // $Id: zone2sql.cc,v 1. 2 2002/11/29 22:50:56ahu Exp $21 // $Id: zone2sql.cc,v 1.3 2002/11/29 23:09:08 ahu Exp $ 22 22 #ifdef WIN32 23 23 # pragma warning ( disable: 4786 ) … … 42 42 StatBag S; 43 43 44 string sqlstr(const string &str) 45 { 46 if(str.find("\'")!=string::npos) 47 throw 0; 48 49 string ret="\'"; 50 ret+=str; 51 ret+="\'"; 52 return ret; 44 static const string sqlstr(const string &name) 45 { 46 string a="\'"; 47 48 for(string::const_iterator i=name.begin();i!=name.end();++i) 49 if(*i=='\'' || *i=='\\'){ 50 a+='\\'; 51 a+=*i; 52 } 53 else 54 a+=*i; 55 a+="\'"; 56 return a; 53 57 } 54 58 … … 263 267 return 0; 264 268 } 269 catch(exception &e) { 270 cerr<<"died because of STL error: "<<e.what()<<endl; 271 exit(0); 272 } 265 273 catch(...) { 266 cerr<<" An unknown error occured"<<endl;267 return 0;274 cerr<<"died because of unknown exception"<<endl; 275 exit(0); 268 276 } 269 277