����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/test/parallel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/test/parallel/test-repl-history-perm.js
'use strict';

// Verifies that the REPL history file is created with mode 0600

// Flags: --expose_internals

const common = require('../common');

if (common.isWindows) {
  common.skip('Win32 uses ACLs for file permissions, ' +
              'modes are always 0666 and says nothing about group/other ' +
              'read access.');
}

const assert = require('assert');
const path = require('path');
const fs = require('fs');
const repl = require('internal/repl');
const Duplex = require('stream').Duplex;
// Invoking the REPL should create a repl history file at the specified path
// and mode 600.

const stream = new Duplex();
stream.pause = stream.resume = () => {};
// ends immediately
stream._read = function() {
  this.push(null);
};
stream._write = function(c, e, cb) {
  cb();
};
stream.readable = stream.writable = true;

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const replHistoryPath = path.join(tmpdir.path, '.node_repl_history');

const checkResults = common.mustCall(function(err, r) {
  assert.ifError(err);

  const stat = fs.statSync(replHistoryPath);
  const fileMode = stat.mode & 0o777;
  assert.strictEqual(
    fileMode, 0o600,
    `REPL history file should be mode 0600 but was 0${fileMode.toString(8)}`);

  // Close the REPL
  r.input.emit('keypress', '', { ctrl: true, name: 'd' });
  r.input.end();
});

repl.createInternalRepl(
  { NODE_REPL_HISTORY: replHistoryPath },
  {
    terminal: true,
    input: stream,
    output: stream
  },
  checkResults
);

ZeroDay Forums Mini