localfs.js
function resolve() {
            resolvePath(path, function (err, _resolvedPath) {
                if (err) {
                    if (err.code !== "ENOENT") {
                        return error(err);
                    }
                    // If checkSymlinks is on we'll get an ENOENT when creating a new file.
                    // In that case, just resolve the parent path and go from there.
                    resolvePath(dirname(path), function (err, dir) {
                        if (err) return error(err);
                        resolvedPath = join(dir, basename(path));
                        createTempFile();
                    });
                    return;
                }
                
                resolvedPath = _resolvedPath;
                createTempFile();
            });
        }
function resolve() {
            resolvePath(path, function (err, _resolvedPath) {
                if (err) {
                    if (err.code !== "ENOENT") {
                        return error(err);
                    }
                    // If checkSymlinks is on we'll get an ENOENT when creating a new file.
                    // In that case, just resolve the parent path and go from there.
                    resolvePath(dirname(path), function (err, dir) {
                        if (err) return error(err);
                        resolvedPath = join(dir, basename(path));
                        createTempFile();
                    });
                    return;
                }
                
                resolvedPath = _resolvedPath;
                createTempFile();
            });
        }
function resolve ( ) { resolvePath ( path , function ( err , _resolvedPath ) { if ( err ) { if ( err . code !== "ENOENT" ) { return error ( err ) ; } // If checkSymlinks is on we'll get an ENOENT when creating a new file. // In that case, just resolve the parent path and go from there. resolvePath ( dirname ( path ) , function ( err , dir ) { if ( err ) return error ( err ) ; resolvedPath = join ( dir , basename ( path ) ) ; createTempFile ( ) ; } ) ; return ; } resolvedPath = _resolvedPath ; createTempFile ( ) ; } ) ; }
Make sure the user has access to the directory and get the real path.
Make sure the user has access to the directory and get the real path .