|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 24.41 GB of 70.42 GB (34.66%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
src/
courier-0.66.1/
courier/
- drwxrwxrwx
|
Viewing file: cmlmsublist.C (3.32 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 2000-2007 Double Precision, Inc. ** See COPYING for distribution information. */
#include "config.h" #include "cmlmsublist.h" #include <string.h>
SubscriberList::SubscriberList( bool wantalias) : dirp(0), next_func( wantalias ? &SubscriberList::openalias: &SubscriberList::domain ) { }
SubscriberList::~SubscriberList() { if (dirp) closedir(dirp); }
// // Read addresses from dedicated domain files. //
bool SubscriberList::domain(std::string &ret) { struct dirent *de; std::string key; std::string val;
if (!dirp) dirp=opendir(DOMAINS);
if (domain_file.IsOpen()) // A domain file is currently open { key=domain_file.FetchNextKeyVal(val);
if (key.size()) { ret=key; sub_info=val; return (true); }
domain_file.Close(); }
// Searching for the next domain file.
while (dirp && (de=readdir(dirp)) != 0) { if (de->d_name[0] == '.') continue; if (strchr(de->d_name, '.') == 0) continue;
std::string filename;
filename=DOMAINS "/"; filename += de->d_name;
if (domain_file.Open(filename, "R") == 0) { key=domain_file.FetchFirstKeyVal(val); if (key.size()) { ret=key; sub_info=val; return (true); } domain_file.Close(); } } closedir(dirp); dirp=0;
// Now, read the miscellaneous database
if (domain_file.Open(MISC, "R")) return (false);
key=domain_file.FetchFirstKeyVal(val); if (key.size() == 0) { domain_file.Close(); return (false); }
splitmisc(val, misclist); next_func= &SubscriberList::shared; return (shared(ret)); }
void SubscriberList::splitmisc(std::string s, std::list<std::string> &misclist) { misclist.clear();
std::string::iterator b=s.begin(), e=s.end(), p=b;
while (b != e) { if (*b == 0) { misclist.push_back(std::string(p, b)); p= ++b; continue; } ++b; continue; }
if (p != b) misclist.push_back(std::string(p, e)); }
std::string SubscriberList::joinmisc(const std::list<std::string> &misclist) { std::list<std::string>::const_iterator mb, me; std::string r;
mb=misclist.begin(); me=misclist.end();
while (mb != me) { r += *mb++; r.push_back((char)0); }
return r; }
// Read the miscellaneous database file
bool SubscriberList::shared(std::string &ret) { while (misclist.empty()) { if (!domain_file.IsOpen()) return false;
std::string key; std::string val;
key=domain_file.FetchNextKeyVal(val);
if (key.size() == 0) { domain_file.Close(); return false; }
splitmisc(val, misclist); }
ret=misclist.front(); misclist.pop_front(); sub_info="";
if (!misclist.empty()) { sub_info=misclist.front(); misclist.pop_front(); }
return true; }
// Read the alias file, instead of the subscriber database.
bool SubscriberList::openalias(std::string &ret) { if (domain_file.Open( ALIASES, "R" )) return false;
next_func= &SubscriberList::nextalias;
std::string keys, vals;
keys=domain_file.FetchFirstKeyVal(vals);
if (keys.size() == 0) return false;
ret=keys; posting_alias=vals;
if (ret.substr(0, 1) == "1") return nextalias(ret); ret=ret.substr(1);
return true; }
bool SubscriberList::nextalias(std::string &ret) { do { std::string keys, vals;
keys=domain_file.FetchNextKeyVal(vals);
if (keys.size() == 0) return false;
ret=keys; posting_alias=vals; } while (ret.substr(0, 1) == "1");
ret=ret.substr(1); return true; }
|