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

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/lib/node_modules/npm/node_modules/fs-vacuum/   drwxr-xr-x
Free 302.54 GB of 429.69 GB (70.41%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     vacuum.js (3.22 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var assert = require('assert')
var dirname = require('path').dirname
var resolve = require('path').resolve
var isInside = require('path-is-inside')

var rimraf = require('rimraf')
var lstat = require('graceful-fs').lstat
var readdir = require('graceful-fs').readdir
var rmdir = require('graceful-fs').rmdir
var unlink = require('graceful-fs').unlink

module.exports = vacuum

function vacuum (leaf, options, cb) {
  assert(typeof leaf === 'string', 'must pass in path to remove')
  assert(typeof cb === 'function', 'must pass in callback')

  if (!options) options = {}
  assert(typeof options === 'object', 'options must be an object')

  var log = options.log ? options.log : function () {}

  leaf = leaf && resolve(leaf)
  var base = options.base && resolve(options.base)
  if (base && !isInside(leaf, base)) {
    return cb(new Error(leaf + ' is not a child of ' + base))
  }

  lstat(leaf, function (error, stat) {
    if (error) {
      if (error.code === 'ENOENT') return cb(null)

      log(error.stack)
      return cb(error)
    }

    if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) {
      log(leaf, 'is not a directory, file, or link')
      return cb(new Error(leaf + ' is not a directory, file, or link'))
    }

    if (options.purge) {
      log('purging', leaf)
      rimraf(leaf, function (error) {
        if (error) return cb(error)

        next(dirname(leaf))
      })
    } else if (!stat.isDirectory()) {
      log('removing', leaf)
      unlink(leaf, function (error) {
        if (error) return cb(error)

        next(dirname(leaf))
      })
    } else {
      next(leaf)
    }
  })

  function next (branch) {
    branch = branch && resolve(branch)
    // either we've reached the base or we've reached the root
    if ((base && branch === base) || branch === dirname(branch)) {
      log('finished vacuuming up to', branch)
      return cb(null)
    }

    readdir(branch, function (error, files) {
      if (error) {
        if (error.code === 'ENOENT') return cb(null)

        log('unable to check directory', branch, 'due to', error.message)
        return cb(error)
      }

      if (files.length > 0) {
        log('quitting because other entries in', branch)
        return cb(null)
      }

      if (branch === process.env.HOME) {
        log('quitting because cannot remove home directory', branch)
        return cb(null)
      }

      log('removing', branch)
      lstat(branch, function (error, stat) {
        if (error) {
          if (error.code === 'ENOENT') return cb(null)

          log('unable to lstat', branch, 'due to', error.message)
          return cb(error)
        }

        var remove = stat.isDirectory() ? rmdir : unlink
        remove(branch, function (error) {
          if (error) {
            if (error.code === 'ENOENT') {
              log('quitting because lost the race to remove', branch)
              return cb(null)
            }
            if (error.code === 'ENOTEMPTY' || error.code === 'EEXIST') {
              log('quitting because new (racy) entries in', branch)
              return cb(null)
            }

            log('unable to remove', branch, 'due to', error.message)
            return cb(error)
          }

          next(dirname(branch))
        })
      })
    })
  }
}

:: 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.0033 ]--