Skip to content

Commit

Permalink
chore: avoid use of confusing base dir term in log (#27659)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Mar 1, 2024
1 parent 12773c6 commit 60a7de5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/util/fs/util.ts
Expand Up @@ -3,11 +3,11 @@ import { GlobalConfig } from '../../config/global';
import { FILE_ACCESS_VIOLATION_ERROR } from '../../constants/error-messages';
import { logger } from '../../logger';

function assertBaseDir(path: string, baseDir: string): void {
if (!path.startsWith(baseDir)) {
function assertBaseDir(path: string, allowedDir: string): void {
if (!path.startsWith(allowedDir)) {
logger.debug(
{ path, baseDir },
'Preventing access to file outside the base directory',
{ path, allowedDir },
'Preventing access to file outside allowed directory',
);
throw new Error(FILE_ACCESS_VIOLATION_ERROR);
}
Expand Down

0 comments on commit 60a7de5

Please sign in to comment.