~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to modules/ldapbackend/utils.hh

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Mohlmann, Matthijs Mohlmann, Christoph Haas
  • Date: 2007-04-15 23:23:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415232339-5x3scc8gx04e50um
Tags: 2.9.21-1
[ Matthijs Mohlmann ]
* New upstream release. (Closes: #420294)
* Remove meta pdns package.
* Added new sqlite3 backend package.
* Months and minutes where mixed up. (Closes: #406462)
* Case sensitivity in bind backend caused PowerDNS to not serve a certain
  zone. (Closes: #406461)
* Bind backend forgot about zones on a notify. (Closes: #398213)

[ Christoph Haas ]
* Documented incorporated backend bind. (Closes: #415471)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <string>
2
2
#include <vector>
 
3
#include <time.h>
 
4
#include <stdlib.h>
3
5
#include <pdns/misc.hh>
4
6
 
5
7
 
131
133
        return subject;
132
134
}
133
135
 
 
136
/*
 
137
 *  Convert a LDAP time string to a time_t. Return 0 if unable to convert
 
138
 */
 
139
 
 
140
inline time_t str2tstamp( const string& str )
 
141
{
 
142
        char* tmp;
 
143
        struct tm tm;
 
144
 
 
145
        tmp =  strptime( str.c_str(), "%Y%m%d%H%M%SZ", &tm );
 
146
 
 
147
        if( tmp != NULL && *tmp == 0 )
 
148
        {
 
149
                return mktime( &tm );
 
150
        }
 
151
 
 
152
        return 0;
 
153
}
 
154
 
134
155
#endif