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:23.92 GB of 70.42 GB (33.97%)
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/ maildrop-2.2.0/ maildir/ - drwxr-xr-x

Directory:
Viewing file:     maildirlock.c (1.46 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
** Copyright 2003 Double Precision, Inc.
** See COPYING for distribution information.
*/

#include "config.h"
#include "maildirwatch.h"
#include "maildircreate.h"
#include "liblock/config.h"
#include "liblock/liblock.h"
#include "liblock/mail.h"
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

static const char rcsid[]="$Id: maildirlock.c,v 1.2 2003/11/15 19:16:25 mrsam Exp $";

/*
** Courier-IMAP compatible maildir lock.
*/

char *maildir_lock(const char *dir, struct maildirwatch *w,
           int *tryAnyway)
{
    struct maildir_tmpcreate_info createInfo;
    char *tmpname;
    char *newname;
    int rc;

    *tryAnyway=0;

    maildir_tmpcreate_init(&createInfo);

    createInfo.maildir=dir;
    createInfo.uniq="courierlock";
    createInfo.hostname=getenv("HOSTNAME");
    createInfo.doordie=1;

    if ((rc=maildir_tmpcreate_fd(&createInfo)) < 0)
        return NULL;
    close(rc);

    tmpname=createInfo.tmpname;
    newname=createInfo.newname;

    createInfo.tmpname=NULL;
    createInfo.newname=NULL;
    maildir_tmpcreate_free(&createInfo);

    /* HACK: newname now contains: ".../new/filename" */

    strcpy(strrchr(newname, '/')-3, WATCHDOTLOCK);

    while (ll_dotlock(newname, tmpname, 120) < 0)
    {
        if (errno == EEXIST)
        {
            if (w == NULL || maildirwatch_unlock(w, 120) < 0)
                sleep(1);
            continue;
        }

        if (errno == EAGAIN)
        {
            unlink(newname);
            sleep(5);
            continue;
        }

        free(newname);
        newname=NULL;
        *tryAnyway=1;
        break;
    }

    free(tmpname);

    return newname;
}
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.5711 seconds