From nobody Wed Nov 20 10:04:08 2024 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 4XtcQc4Z41z5dXrl; Wed, 20 Nov 2024 10:04:08 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XtcQc45FGz4f38; Wed, 20 Nov 2024 10:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732097048; 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=ASVuRViwQuk+wdM0XALj4jurUjBowScpZBQ+xM79raA=; b=mq6S9M1szDCrFVujgwIynJ98DW4iGi1URkgru5wDSh1OzprEXG8mxww4s5vIzMYNhbN5I5 cF0bVnHIfU0YaCRlx9VRy/3v9HpbOen86Br6pskupLCK98wjNtT/8v87YmuNUaBLXvbEiD euesogBH63RrhzhKpJtFZkn2E7SEDl/ACQHJYgCFL1aSx3nKPJn7TlTTGXfsi/EnVb+z1W D0MJ6q+P5/M9lHLKu91cX8LlYNeHGz4iqzge3LNqeACzZSCmS8yIbpdRntkIBmmLnleSiA SKRDl26u8KGXILwBEheejskKFrsDNF93jgC8lLQwG5RsPW+U+W7qA9Wh+uPmmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732097048; 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=ASVuRViwQuk+wdM0XALj4jurUjBowScpZBQ+xM79raA=; b=hkcPzGxOT+pGY4XEdDCYjRc209pz+5URHfkL3TnMOQ2LK2b4UVWxdM6b77JMF4gsEW86Wk d4vg+2YCDK0OmBzYOuZldDCF6hcUCTTwoI0Hfb6V1w+wWTcV5HQeJnQ2Lf21H3J1JGh+Ka vMZinLUWq/QFyNBwfCqgW8MLua+QbL4B2pxMiQUXAeFlTd078Vf+K08bgJLYAdL9Fe3bvI 3UmAVTJJM4R2dIoV6+dSbCr4qY3ZKmyIBclGZKoyH4cC1NGhrC2i67UKT8NwLjsuTB0aZ+ Lr7UeRcX4bjBA+gUialJXMMF4ZTbtBKpFtIMFGsxo9Wyna90va9MlLmdNs92+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732097048; a=rsa-sha256; cv=none; b=xe8dLAa099lwi42L7anOwfpxxG6QqJ5Zk1MqtF2JZvtg60bHPGC2ekXnBOXt2Tw33xOy/x JfUq2fYVx4LiuprTA5skLlL5yaysezOAseCQbjF6f6bYq9QjKNI5QmtkhoakuqifE7Dsh4 kDTFMsOmEFra2cqFxPcEUeRblCxjQFLJFIH9Lk+2NWMOVnFnzEKs8FAOxGz0WAbYwI0730 XyrZQTeU75+jBzKSBH9ixEkoY9Uby4/4J2bbwg+ds848Ve8lffb4JMxrg0LHEUhMBgU6KK To5BlYGnFljRZHyfICHAZFcdK5lDphbqy21iwMhHPC+ewAHNZv8zeQZm/DfWqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XtcQc3hV5zqh8; Wed, 20 Nov 2024 10:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AKA485W022668; Wed, 20 Nov 2024 10:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AKA48tI022665; Wed, 20 Nov 2024 10:04:08 GMT (envelope-from git) Date: Wed, 20 Nov 2024 10:04:08 GMT Message-Id: <202411201004.4AKA48tI022665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3e2a7a2cbeb2 - main - nuageinit: add test about encrypted passwords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e2a7a2cbeb272b891c6931f2ae54ee6e5ec2c7d Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3e2a7a2cbeb272b891c6931f2ae54ee6e5ec2c7d commit 3e2a7a2cbeb272b891c6931f2ae54ee6e5ec2c7d Author: Baptiste Daroussin AuthorDate: 2024-11-20 10:02:55 +0000 Commit: Baptiste Daroussin CommitDate: 2024-11-20 10:02:55 +0000 nuageinit: add test about encrypted passwords While here fix fc34a2463c16fd47acbc8e5c3bbbb6b2ce1b1469 where the adduser_passwd.lua file was not added --- libexec/nuageinit/tests/adduser_passwd.lua | 20 ++++++++++++++++++++ libexec/nuageinit/tests/nuage.sh | 3 +++ 2 files changed, 23 insertions(+) diff --git a/libexec/nuageinit/tests/adduser_passwd.lua b/libexec/nuageinit/tests/adduser_passwd.lua new file mode 100644 index 000000000000..e2d9395d679d --- /dev/null +++ b/libexec/nuageinit/tests/adduser_passwd.lua @@ -0,0 +1,20 @@ +#!/usr/libexec/flua + +local n = require("nuage") + +local pw = {} +pw.name = "foo" +pw.plain_text_passwd = "bar" +local res = n.adduser(pw) +if not res then + n.err("valid user should return a path") +end + +local pw2 = {} +pw2.name = "foocrypted" +-- barcrypted +pw2.passwd = "$6$ZY8faYcEfyoEZnNX$FuAZA2SKhIfYLebhEtbmjptQNrenr6mJhji35Ru.zqdaa6G/gkKiHoQuh0vYZTKrjaykyohR8W4Q5ZF56yt8u1" +res = n.adduser(pw2) +if not res then + n.err("valid user should return a path") +end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index a5451561202f..f2753d6d91e6 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -60,6 +60,9 @@ adduser_passwd_body() passhash=`awk -F ':' '/^foo:/ {print $2}' etc/master.passwd` atf_check -s exit:0 -o inline:$passhash \ $(atf_get_srcdir)/crypt $passhash "bar" + passhash=`awk -F ':' '/^foocrypted:/ {print $2}' etc/master.passwd` + atf_check -s exit:0 -o inline:$passhash \ + $(atf_get_srcdir)/crypt $passhash "barcrypted" } addgroup_body()