[LTP] lib: New library function tst_get_free_uid
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jul 7 09:48:39 CEST 2026
Hi Wei,
On Tue, 7 Jul 2026 05:47:53 +0000, Wei Gao wrote:
> lib: New library function tst_get_free_uid
--- [PATCH 1/2] ---
> +/**
> + * tst_get_free_uid() - Find a UID not assigned to any user.
> + * @skip: UID value to skip (pass 0 to skip none).
The summary line says tst_get_free_uid() but the symbol being declared
is tst_get_free_uid_(). linuxdoc requires the summary name to match the
symbol exactly, so it would fail to associate this /** block with the
implementation.
Should this be "tst_get_free_uid_() - ..." to match the symbol, or is
the intent to document the macro tst_get_free_uid() instead?
Same issue applies to the modified tst_get_free_gid() summary below.
> +uid_t tst_get_free_uid_(const char *file, const int lineno, uid_t skip);
The function has three parameters but the kernel-doc block only documents
@skip. linuxdoc expects an @name: entry for every parameter in declaration
order. @file and @lineno are missing.
Same gap in the modified tst_get_free_gid_() block.
> + if (errno == 0 || errno == ENOENT || errno == ESRCH) {
> + tst_res_(file, lineno, TINFO | TERRNO,
> + "Found unused UID %d", (int)ret);
> + return ret;
When getpwuid() returns NULL with errno set to ENOENT or ESRCH, TERRNO
appends the errno string to the message, producing output like:
"Found unused UID 5: No such file or directory". The function succeeded,
so the error string is misleading. Should TERRNO be dropped here, or
should it be conditionally omitted when errno indicates "not found"?
--- [PATCH 2/2] ---
> +Add LTP coverage for kernel commit 30aba6656f61 (Linux 4.19), which
> +introduced protection against spoofing attacks via O_CREAT of FIFOs and
> +regular files in world-writable sticky directories.
> +
> +This commit adds test cases to verify these security restrictions for
> +opening FIFOs and regular files in world-writable sticky directories.
tcase[2] uses dir_mode=0030|SVTX (group-writable sticky, level 2), which
the commit body doesn't mention. The test's own doc block describes both
"world-writable (level 1) or group-writable (level 2)" correctly — does
the body need updating to match?
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list