From nobody Thu Nov 19 13:57:59 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jVg602Kflz7139K for ; Thu, 19 Nov 2026 13:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jVg600rkyz4Ybx for ; Thu, 19 Nov 2026 13:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795096680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpKrm2vPxBD4thfZSNV0Sqzy9jrDMellx3+eeJBwUyU=; b=X2fbT5P8xvFKIuVXTyMQs9YdXcsvJxNa/0RjjZU2HOzc//RWeqROtPYrPkIMScozFiBsln UUhbq094qDp2N6oq92ojMKopb3nl+c1TagEVcIb2c0ztY+BnHLs1JqwmbA/X56Id/Aid2J /pkGZBRaQQYTq5fvypZs/7LznoZeCmcKKbqPNqwLG1496DmZInrlmOWqVU0AVBW191UImX X0mw3+YX6zE42Ks/4cJxL+7K9YrdmHpXIS9Gzkv3ak3iI8EikdzZRQwZyXpgL2+jL9t9h7 DlYPOoKXAuPX1ZDoDujh6F7WWC0kA89TszgRDkb+NzwX+cM2vNwQIKiRhCvjVw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795096680; b=VPdrBnMOr0RpKsKhjJbeXJ++Q3OS8B6yLoL8nUEg2Qo5SSmQB6/aAD8MyQqelJ5XcmAVmS PAKlcJgkrCAM6yA351hOx5QBeymXr166nHPS/55FoKhWh8rdh9RbX6wYgUEQLNkH/HYIle eyAMV6PkXV2ObMiozkwI1tMnXQWQJ3KZV3fa3hxhLWywzQaF7jfpsUAQILlENqyzoKunEP 7um6fXV7eqAjR4Cc6kiMDS0F9+bE5UoLg26jmE8rgSGGNJ8TcLfrEs0dJ5GqKCGDigiPys Gf7+dYal/eZYWepzJMpiLsJ5rdQ7+YUwQtR7JnU4JzwvKjlu58n84c+zsTSpHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795096680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpKrm2vPxBD4thfZSNV0Sqzy9jrDMellx3+eeJBwUyU=; b=huZs0x1nOSU7HD2ux+1UTe64tEcspZU75tbfXrmJw7k1UfKsRiWWzQ+KNE4XCUR/KRYi1k xWD0acwehqCtqo/FhJTiB88IFZTe1vFJrvnwoEhO/T+YbbbDmYScvufN8DybOUiGYcDqfh 2/Bx4SwHzIPSsb4MnFFPT1edW4UxNlraJDNkMdsdk/gZTvpjVOSuQPX9bVxHLNOKt8bqOu Iha7yXwxApRnTKmumcIBqbeRVm9uLjXj+qlYvyc9JJA4N0Q6hDfMvcmsesuB1/C3HHI4UA Pf9Sugia9gvY/ehBSVNWbmd6Tle303QzJWBpgHV2jTYil3OUONodqmUfSbo9Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jVg5z6rZDz13Nw for ; Thu, 19 Nov 2026 13:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d89 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 19 Nov 2026 13:57:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 30e3fd1811e3 - main - nuageinit: Split pw line on :s List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30e3fd1811e36ed9dc27db4bdd439a45c3725598 Auto-Submitted: auto-generated Date: Thu, 19 Nov 2026 13:57:59 +0000 Message-Id: <6aff0067.1d89.76a24670@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=30e3fd1811e36ed9dc27db4bdd439a45c3725598 commit 30e3fd1811e36ed9dc27db4bdd439a45c3725598 Author: Ed Maste AuthorDate: 2026-11-13 16:39:05 +0000 Commit: Ed Maste CommitDate: 2026-11-19 13:57:28 +0000 nuageinit: Split pw line on :s Previously we parsed a v7 pw string using "%a+:" in the match pattern, which matches a string of letters preceeding a colon. This would fail for userids ending in a digit or _. Instead, match runs of non-colons using "[^:]*". While here, correct failure string in an existing test. adduser("plop") should fail because adduser requires a table, not a string. Report this as the failure reason, rather than claiming that the faulre was due to an empty value. Reported by: llm-postcr Reviewed by: bapt, dtxdf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61513 --- libexec/nuageinit/nuage.lua | 2 +- libexec/nuageinit/tests/adduser.lua | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 8310c4751ece..5dc8c5d30110 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -326,7 +326,7 @@ local function adduser(pwd) local pwdstr = f:read("*a") f:close() if pwdstr:len() ~= 0 then - return pwdstr:match("%a+:.+:%d+:%d+:.*:(.*):.*") + return pwdstr:match("[^:]*:[^:]*:%d+:%d+:[^:]*:([^:]*):") end if not pwd.gecos then pwd.gecos = pwd.name .. " User" diff --git a/libexec/nuageinit/tests/adduser.lua b/libexec/nuageinit/tests/adduser.lua index cef6be0c0e0c..63c5f14bc555 100644 --- a/libexec/nuageinit/tests/adduser.lua +++ b/libexec/nuageinit/tests/adduser.lua @@ -6,7 +6,7 @@ if n.adduser() then n.err("adduser should not accept empty value") end if n.adduser("plop") then - n.err("adduser should not accept empty value") + n.err("adduser accepted a string (not table)") end local pw = {} pw.name = "impossible_username" @@ -14,3 +14,13 @@ local res = n.adduser(pw) if not res then n.err("valid adduser should return a path") end + +pw = {} +pw.name = "underscore_" +-- Call adduser twice to test both addding and looking up an existing user. +for i = 1, 2 do + local res = n.adduser(pw) + if not res then + n.err("no path returned for username ending with _") + end +end