|
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.88 GB of 70.42 GB (33.92%) |
|
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/
maildrop-2.2.0/
maildir/
- drwxr-xr-x
|
Viewing file: maildiropen.c (2.01 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 2000 Double Precision, Inc. ** See COPYING for distribution information. */
#if HAVE_CONFIG_H #include "config.h" #endif
#include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <stdlib.h> #include <time.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #include <stdio.h> #include <ctype.h> #include <errno.h> #include <fcntl.h>
#include "maildirmisc.h"
static const char rcsid[]="$Id: maildiropen.c,v 1.8 2003/01/19 16:39:52 mrsam Exp $";
char *maildir_getlink(const char *filename) { #if HAVE_READLINK size_t bufsiz; char *buf;
bufsiz=0; buf=0;
for (;;) { int n;
if (buf) free(buf); bufsiz += 256; if ((buf=malloc(bufsiz)) == 0) { perror("malloc"); return (0); } if ((n=readlink(filename, buf, bufsiz)) < 0) { free(buf); return (0); } if (n < bufsiz) { buf[n]=0; break; } } return (buf); #else return (0); #endif }
int maildir_semisafeopen(const char *path, int mode, int perm) {
#if HAVE_READLINK
char *l=maildir_getlink(path);
if (l) { int f;
if (*l != '/') { char *q=malloc(strlen(path)+strlen(l)+2); char *s;
if (!q) { free(l); return (-1); }
strcpy(q, path); if ((s=strchr(q, '/')) != 0) s[1]=0; else *q=0; strcat(q, l); free(l); l=q; }
f=maildir_safeopen(l, mode, perm);
free(l); return (f); } #endif
return (maildir_safeopen(path, mode, perm)); } int maildir_safeopen(const char *path, int mode, int perm) { struct stat stat1;
return maildir_safeopen_stat(path, mode, perm, &stat1); }
int maildir_safeopen_stat(const char *path, int mode, int perm, struct stat *stat1) { struct stat stat2;
int fd=open(path, mode #ifdef O_NONBLOCK | O_NONBLOCK #else | O_NDELAY #endif , perm);
if (fd < 0) return (fd); if (fcntl(fd, F_SETFL, (mode & O_APPEND)) || fstat(fd, stat1) || lstat(path, &stat2)) { close(fd); return (-1); }
if (stat1->st_dev != stat2.st_dev || stat1->st_ino != stat2.st_ino) { close(fd); errno=ENOENT; return (-1); }
return (fd); }
|