|
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.18 GB of 70.42 GB (34.34%) |
|
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: aliascombine.C (2.98 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 1998 - 2007 Double Precision, Inc. ** See COPYING for distribution information. */
#include "courier.h" #include "rw.h" #include "comcargs.h" #include "rfc822.h" #include <string.h> #include <signal.h> #include <stdlib.h> #include <stdio.h>
#if HAVE_UNISTD_H #include <unistd.h> #endif #include <string> #include <algorithm> #include <sstream> #include <iostream> #include "dbobj.h" #include "maxlongsize.h" #include "numlib/numlib.h"
static int readalias(DbObj &obj, std::string aliasname) { std::string key=aliasname + "\n0"; std::string lenptr=obj.Fetch(key, "");
size_t num; std::string name; std::string namelist; unsigned cnt;
if (!lenptr.size()) { num=1; } else { num=atol(lenptr.c_str())+1; }
cnt=0; namelist=""; for (;;) { if (!std::getline(std::cin, name).good()) return (-1); if (name.size() == 0) break; if (cnt >= 100) { std::ostringstream o;
o << aliasname << "\n" << num++;
key=o.str(); if (obj.Store(key, namelist, "R")) return (-1); namelist=""; cnt=0; } namelist += name.substr(1, name.size()-2) + "\n"; ++cnt; }
if (cnt) { std::ostringstream o;
o << aliasname << "\n" << num;
key=o.str(); if (obj.Store(key, namelist, "R")) return (-1); key=aliasname + "\n0";
std::ostringstream oo;
oo << num;
if (obj.Store(key, oo.str(), "R")) return (-1); } return (0); }
static int dumpdb(DbObj &obj) { std::string key, val; size_t nblocks, i;
for (key=obj.FetchFirstKeyVal(val); key.size(); key=obj.FetchNextKeyVal(val)) { if (key.size() < 2 || key.substr(key.size()-2) != "\n0") continue; std::cout << "*" << key.substr(0, key.size()-2) << std::endl; }
for (key=obj.FetchFirstKeyVal(val); key.size(); key=obj.FetchNextKeyVal(val)) { if (key.size() < 2 || key.substr(key.size()-2) != "\n0") continue;
std::string keystr=key.substr(0, key.size()-2);
std::istringstream ii(val);
nblocks=0;
ii >> nblocks; std::cout << '<' << keystr << '>' << std::endl; for (i=0; i<nblocks; ) { ++i;
std::ostringstream o;
o << keystr << "\n" << i;
if ((val=obj.Fetch(o.str(), "")).size()) { std::string::iterator b=val.begin(), e=val.end(), p;
while ((p=std::find(b, e, '\n')) != e) { std::cout << "<" << std::string(b, p) << ">" << std::endl; b= ++p; } } } std::cout << std::endl; } return (0); }
int cppmain(int argc, char **argv) { char *filename=mktmpfilename(); DbObj tempdb; std::string aliasname;
clog_open_stderr("aliascombine"); if (!filename || tempdb.Open(filename, "N")) clog_msg_errno(); unlink(filename); free(filename);
while (std::getline(std::cin, aliasname).good()) { if (aliasname == ".") { if (dumpdb(tempdb)) { clog_msg_prerrno(); break; }
std::cout << "." << std::endl; break; } aliasname=aliasname.substr(1, aliasname.size()-2); if (readalias(tempdb, aliasname)) { clog_msg_prerrno(); break; } } return (0); }
|