fs: add helpers name_is_dot{,dot,_dotdot}

Rename the helper is_dot_dotdot() into the name_ namespace
and add complementary helpers to check for dot and dotdot
names individually.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://patch.msgid.link/20260128132406.23768-3-amir73il@gmail.com
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Amir Goldstein
2026-01-28 14:24:05 +01:00
committed by Christian Brauner
parent 1992330d90
commit 55fb177d3a
9 changed files with 22 additions and 10 deletions

View File

@@ -3042,7 +3042,7 @@ int lookup_noperm_common(struct qstr *qname, struct dentry *base)
if (!len)
return -EACCES;
if (is_dot_dotdot(name, len))
if (name_is_dot_dotdot(name, len))
return -EACCES;
while (len--) {