find: Don't allow negative GIDs to be passed to the -group
option
This commit is contained in:
parent
6d7a2f5cc9
commit
bc50b629ee
Notes:
sideshowbarker
2024-07-17 01:06:10 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/bc50b629ee Pull-request: https://github.com/SerenityOS/serenity/pull/20835
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ public:
|
|||
m_gid = gr->gr_gid;
|
||||
} else {
|
||||
// Attempt to parse it as decimal GID.
|
||||
auto number = StringView { arg, strlen(arg) }.to_int();
|
||||
auto number = StringView { arg, strlen(arg) }.to_uint<gid_t>();
|
||||
if (!number.has_value())
|
||||
fatal_error("Invalid group: \033[1m{}", arg);
|
||||
m_gid = number.value();
|
||||
|
|
Loading…
Add table
Reference in a new issue