From 93277d9b0841de3009bad4065b734ca7f760d6f4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 21 Jul 2026 10:26:14 +0200 Subject: [PATCH] parseNumeric: require non-empty values follow-up to 841c83ee0d9315e5f4379361afe493c7e020c8c8 and 743614ec8aec7c62839dd3acf615da4e4de560d6. Now that optional user-values are handled through parseGroupArg and parseUserArg (both of which gracefully handle empty values), we can make parseNumeric strict, and produce an error when trying to parse an empty string. Signed-off-by: Sebastiaan van Stijn --- user/user.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/user/user.go b/user/user.go index bdde6fc..e747767 100644 --- a/user/user.go +++ b/user/user.go @@ -243,9 +243,6 @@ func GetExecUserPath(userSpec string, defaults *ExecUser, passwdPath, groupPath // // See https://github.com/containerd/containerd/commit/de1341c201ffb0effebbf51d00376181968c8779 func parseNumeric(val string) (int, bool, error) { - if val == "" { - return 0, false, nil - } id, err := strconv.Atoi(val) if err != nil { if errors.Is(err, strconv.ErrSyntax) {