GRAYBYTE WORDPRESS FILE MANAGER2986

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib/node_modules/npm/lib/doctor/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib/node_modules/npm/lib/doctor//check-files-permission.js
var fs = require('fs')
var path = require('path')
var getUid = require('uid-number')
var chain = require('slide').chain
var log = require('npmlog')
var npm = require('../npm.js')
var fileCompletion = require('../utils/completion/file-completion.js')

function checkFilesPermission (root, fmask, dmask, cb) {
  if (process.platform === 'win32') return cb(null, true)
  getUid(npm.config.get('user'), npm.config.get('group'), function (e, uid, gid) {
    var tracker = log.newItem('checkFilePermissions', 1)
    if (e) {
      tracker.finish()
      tracker.warn('checkFilePermissions', 'Error looking up user and group:', e)
      return cb(e)
    }
    tracker.info('checkFilePermissions', 'Building file list of ' + root)
    fileCompletion(root, '.', Infinity, function (e, files) {
      if (e) {
        tracker.warn('checkFilePermissions', 'Error building file list:', e)
        tracker.finish()
        return cb(e)
      }
      tracker.addWork(files.length)
      tracker.completeWork(1)
      chain(files.map(andCheckFile), function (er) {
        tracker.finish()
        cb(null, !er)
      })
      function andCheckFile (f) {
        return [checkFile, f]
      }
      function checkFile (f, next) {
        var file = path.join(root, f)
        tracker.silly('checkFilePermissions', f)
        fs.lstat(file, function (e, stat) {
          tracker.completeWork(1)
          if (e) return next(e)
          if (!stat.isDirectory() && !stat.isFile()) return next()
          // 6 = fs.constants.R_OK | fs.constants.W_OK
          // constants aren't available on v4
          fs.access(file, stat.isFile() ? fmask : dmask, (err) => {
            if (err) {
              tracker.error('checkFilePermissions', `Missing permissions on ${file}`)
              return next(new Error('Missing permissions for ' + file))
            } else {
              return next()
            }
          })
        })
      }
    })
  })
}

module.exports = checkFilesPermission

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:36:29
root / root
0755
check-files-permission.js
1.931 KB
March 10 2021 14:36:36
root / root
0644
check-ping.js
0.397 KB
March 10 2021 14:36:36
root / root
0644
get-git-path.js
0.293 KB
March 10 2021 14:36:36
root / root
0644
get-latest-nodejs-version.js
0.781 KB
March 10 2021 14:36:36
root / root
0644
get-latest-npm-version.js
0.434 KB
March 10 2021 14:36:36
root / root
0644
verify-cached-files.js
0.907 KB
March 10 2021 14:36:36
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF