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:25.67 GB of 70.42 GB (36.46%)
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/ maildrop/ - drwxrwxrwx

Directory:
Viewing file:     filelock.C (1.12 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include    "filelock.h"
#include    "mio.h"
#if HAVE_FCNTL_H
#include    <fcntl.h>
#endif
#if HAVE_SYS_STAT_H
#include        <sys/stat.h>
#endif
#if HAVE_UNISTD_H
#include    <unistd.h>
#endif
#if HAVE_SYS_FILE_H
#include    <sys/file.h>
#endif
#include    <errno.h>

#include    "liblock/config.h"
#include    "liblock/liblock.h"


void FileLock::cleanup()
{
    UnLock();
}

void FileLock::forked()
{
    UnLock();
}

FileLock::FileLock() : fd(-1)
{
}

FileLock::~FileLock()
{
    UnLock();
}

void FileLock::Lock(const char *filename)
{
    UnLock();

    if ((fd=mopen(filename, O_CREAT | O_WRONLY, 0600)) < 0)
        throw "Unable to create flock file.";

    do_filelock(fd);
}


void FileLock::do_filelock(int fd)
{
int    flockrc;

    while ((flockrc=ll_lock_ex(fd)) < 0 && errno == EINTR)
        ;

    if (flockrc < 0)
    {
    struct stat stat_buf;

        // FreeBSD has problems locking /dev/null.  Presume that if
        // you're writing to a device file, you know what you're doing.

        if (fstat(fd, &stat_buf) >= 0 && (
            S_ISREG(stat_buf.st_mode) || S_ISDIR(stat_buf.st_mode)))
        {
            return;
        }

        throw "flock() failed.";
    }
}

void FileLock::UnLock()
{
    if (fd >= 0)
    {
        mclose(fd);
        fd= -1;
    }
}
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.2628 seconds