Doctor/Security: fix telegram numeric ID + symlink config permission warnings (#19844)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: e42bf1e48d
Co-authored-by: joshp123 <1497361+joshp123@users.noreply.github.com>
Co-authored-by: joshp123 <1497361+joshp123@users.noreply.github.com>
Reviewed-by: @joshp123
This commit is contained in:
the sun gif man
2026-02-18 00:09:51 -08:00
committed by GitHub
parent 7ea7b7e7af
commit 114736ed1a
8 changed files with 82 additions and 11 deletions

View File

@@ -223,8 +223,10 @@ export async function noteStateIntegrity(
if (configPath && existsFile(configPath) && process.platform !== "win32") {
try {
const linkStat = fs.lstatSync(configPath);
const stat = fs.statSync(configPath);
if ((stat.mode & 0o077) !== 0) {
const isSymlink = linkStat.isSymbolicLink();
if (!isSymlink && (stat.mode & 0o077) !== 0) {
warnings.push(
`- Config file is group/world readable (${displayConfigPath ?? configPath}). Recommend chmod 600.`,
);