From nobody Thu Feb 01 21:26:02 2024 X-Original-To: dev-commits-src-branches@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 4TQsQg3KYwz58hCv; Thu, 1 Feb 2024 21:26:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQsQf6n9fz4VvJ; Thu, 1 Feb 2024 21:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; 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=UpMvYhv9GV//F2+kABSrsM5hdHmftGb4uFWA9yfl+KM=; b=XTiimqampT/Vxb9npF29nYHSw+6vi+S2YLWbS53/MeoAfWDkGsX/LdK4OUdyRo9toUXfgE g6N3pIx5rlVKnFlBSz9/tOYHxSj92/X84NIbvFwF5TYQ0ktQdCs2S5MaL8eaPNSK4fTsLg 4lJFGz5TkBjcXoXZFvXRuMRQKsR9Kat3zcOW8S2jH3mbVbYGLN4pcQGWDZlF+vTz2s54zs 4vjD7/CVzrx4j3yvmXoygNvjO2uMVSe9mwqEAiDsYbVXAseXoMIRuLCjhmn1BBGmtJ87qp TWdNNZfJ2Xo2UOEDrVoPTfSBe9n/kR21hNfm27Q0AFs6/uj+SO86/+6gnmGBNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706822762; 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=UpMvYhv9GV//F2+kABSrsM5hdHmftGb4uFWA9yfl+KM=; b=BNwenkcMn6rhDLLdst2xzLx3iqzpFpc/0gyVbHJTpB/jiPZtT/Q7JZ/MrChHjYjKJyZW+2 9i+HtvncQTkECGlusaROQuKfkqFKHOYGbYfmkKWobKfsReR7+JoebGYIISe43RtxEePIoi HYpo2cMKNC64HeFdIHRgzVHtWUh0hKWhHM8MLTKXPOqopKBsT22c+7V6vJhLf6XdUgSGxF WVAy1TViEPJ6J+RfzBe0TUVAFGJusu8SuRaoFj2/Sjc+QXq8A0+14I2Juj/5H38OpNI/d0 RRKGITPmlqRcrGutW/RL3jjgVvlkU1JoS2i4gTvlFcuQ5NorYSKIUvGBfUhFtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706822762; a=rsa-sha256; cv=none; b=cgxOYYIGWufZHNfqHDbL2kzqt+c5lIm6D4bgkw6CYX/SvZhX/u4duKYpdB+8ejTepV/J1u Fa5uNxL3Dfre1sVqlY0bz6jclBn7lbtzTXsLy4aTF9EnE1g9d6B+sQJuTllB0XXh0R6X6H JghtK/xoU4qWlSGKRJU48+64vAaF3xvd/l+39OXQQKAEzUaCHj1z1951RLkq1pwKF2O98U 9WcZuYQh83Nzr7fvZ8U2+qDJThKr+s6AaCFIzMFjh4wX6S2aX38OGKrQN8+1kPCaw+L0u6 8jJjPkoiZQyHz+FPeXZ5nSgxO6AF6e36Dm7ddg5QmzXxPKSZs88IHUtRJA9dMA== 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 4TQsQf5syRz1HbN; Thu, 1 Feb 2024 21:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 411LQ2rV070237; Thu, 1 Feb 2024 21:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LQ2RE070235; Thu, 1 Feb 2024 21:26:02 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:26:02 GMT Message-Id: <202402012126.411LQ2RE070235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6ceb32fa4a2c - stable/13 - login_cap(3): Document login_getcapenum() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d commit 6ceb32fa4a2ce53e5dac1b4a5208ddc600ecf20d Author: Olivier Certner AuthorDate: 2023-06-20 20:09:57 +0000 Commit: Olivier Certner CommitDate: 2024-02-01 21:22:58 +0000 login_cap(3): Document login_getcapenum() Reviewed by: emaste Approved by: emaste (mentor) MFC after: 3 days Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40685 (cherry picked from commit 97256feb7a65cccac51a03846c5308894a2cb445) Approved by: markj (mentor) --- lib/libutil/login_cap.3 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/libutil/login_cap.3 b/lib/libutil/login_cap.3 index 0281c8428ed5..86142c3b19f9 100644 --- a/lib/libutil/login_cap.3 +++ b/lib/libutil/login_cap.3 @@ -25,6 +25,7 @@ .Nm login_getcapbool , .Nm login_getcaplist , .Nm login_getcapnum , +.Nm login_getcapenum , .Nm login_getcapstr , .Nm login_getcapsize , .Nm login_getcaptime , @@ -60,6 +61,8 @@ .Fn login_getcaptime "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft rlim_t .Fn login_getcapnum "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" +.Ft int +.Fn login_getcapenum "login_cap_t *lc" "const char *cap" "const char * const *values" .Ft rlim_t .Fn login_getcapsize "login_cap_t *lc" "const char *cap" "rlim_t def" "rlim_t error" .Ft int @@ -459,6 +462,31 @@ If the given capability tag cannot be found, the parameter is returned, and if an error occurs, the .Fa error parameter is returned. +.It Fn login_getcapenum +This function returns whether the searched capability is a string with value +among a predefined set passed in argument +.Fa values +as a NULL-terminated array of strings. +.Pp +A non-negative value indicates a match and is the index of the capability's +value in array +.Fa values . +Other possible return values are: +.Bl -tag -width "-4" +.It -4 +Returned if +.Fa lc +or +.Fa cap +are insufficiently initialized or invalid. +.It -3 +Returned on allocation failure (out of memory). +.It -2 +Returned if the capability isn't specified or its value is not a string. +.It -1 +Returned if the capability is specified and a string but its value is not among +.Fa values . +.El .It Fn login_getcapsize .Fn login_getcapsize returns a value representing a size (typically, file or memory)