%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'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.mustSucceed((r) => { 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 );