ShellBanner
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.45 GB of 70.42 GB (34.73%)
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,

/ usr/ src/ courier-0.66.1/ rfc2045/ - drwxrwxrwx

Directory:
Viewing file:     rfc2045decodemsgtoutf8.c (2.96 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
** Copyright 2010-2011 Double Precision, Inc.  See COPYING for
** distribution information.
*/

#include    "rfc2045.h"
#include    "rfc822/rfc822.h"
#include    <ctype.h>
#include    <unistd.h>
#include    <string.h>



struct doconvtoutf8_info {

    struct rfc2045_decodemsgtoutf8_cb *callback;

    int err_flag;
};

static void doconvtoutf8_write(const char *p, size_t n,
                   void *void_arg)
{
    struct doconvtoutf8_info *ptr=
        (struct doconvtoutf8_info *)void_arg;

    if (n && ptr->err_flag == 0)
        ptr->err_flag=(*ptr->callback->output_func)
            (p, n, ptr->callback->arg);
}

static void doconvtoutf8_error(const char *p, int n,
                   void *void_arg)
{
    struct doconvtoutf8_info *ptr=(struct doconvtoutf8_info *)void_arg;

    ptr->err_flag= -1;
}

static int doconvtoutf8_rfc822hdr(const char *header,
                  const char *value,
                  struct rfc2045_decodemsgtoutf8_cb *callback)
{
    struct doconvtoutf8_info info;

    info.err_flag=0;
    info.callback=callback;

    if (callback->headerfilter_func &&
        (*callback->headerfilter_func)(header, value, callback->arg) == 0)
        return 0;

    if ((callback->flags & RFC2045_DECODEMSG_NOHEADERNAME) == 0)
    {
        doconvtoutf8_write(header, strlen(header), &info);
        doconvtoutf8_write(": ", 2, &info);
    }
    rfc822_display_hdrvalue(header, value, "utf-8", 
                doconvtoutf8_write,
                doconvtoutf8_error,
                &info);
    doconvtoutf8_write("\n", 1, &info);
    if (callback->headerdone_func && info.err_flag == 0)
    {
        int rc=(*callback->headerdone_func)(header, callback->arg);

        if (rc)
            info.err_flag=rc;
    }

    return info.err_flag;
}

static int decode_handler(const char *p, size_t n, void *voidarg)
{
    const struct doconvtoutf8_info *ptr=
        (const struct doconvtoutf8_info *)voidarg;

    int rc=0;

    if (n)
        rc=(*ptr->callback->output_func)(p, n, ptr->callback->arg);

    return rc;
}

int rfc2045_decodemsgtoutf8(struct rfc2045src *src,
                struct rfc2045 *p,
                struct rfc2045_decodemsgtoutf8_cb *callback)
{
    struct rfc2045headerinfo *hi;
    int rc;

    hi=rfc2045header_start(src, p);

    if (hi)
    {
        char *header;
        char *value;

        while (rfc2045header_get(hi, &header, &value,
                     RFC2045H_NOLC |
                     RFC2045H_KEEPNL) == 0 && header)
        {
            if (callback->flags & RFC2045_DECODEMSG_NOHEADERS)
                continue;

            if (doconvtoutf8_rfc822hdr(header, value,
                           callback) < 0)
                return -1;
        }
        rfc2045header_end(hi);
    }

    if (p->firstpart)
    {
        for (p=p->firstpart; p; p=p->next)
        {
            if (!p->isdummy)
            {
                if ((rc=rfc2045_decodemsgtoutf8(src, p,
                                callback))
                    != 0)
                    return rc;
            }
        }
    }
    else
    {
        const char *content_type;
        const char *transfer_encoding;
        const char *charset;
        struct doconvtoutf8_info info;

        info.callback=callback;

        rfc2045_mimeinfo(p, &content_type, &transfer_encoding,
                 &charset);

        if (strncmp(content_type, "text/", 5) == 0 &&
            (callback->flags & RFC2045_DECODEMSG_NOBODY) == 0 &&
            (rc=rfc2045_decodetextmimesection(src, p, "utf-8", NULL,
                              decode_handler,
                              &info)) != 0)
            return rc;
    }
    return 0;
}
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.3564 seconds