Message ID | 20231012153508.2057768-1-josimmon@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7049385DC03 for <patchwork@sourceware.org>; Thu, 12 Oct 2023 15:35:28 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 241003858404 for <libc-alpha@sourceware.org>; Thu, 12 Oct 2023 15:35:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 241003858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697124914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yxctkqUAeNwVUh0d20xCQAkTAn8jm8v1Qzs+ptnUj6U=; b=FvBlpOjbGTs+2AgUZP+QsRmJZUChmiw90GYzvRAY5jI3J7wmoFJjv5XGlOFKeCmCyqcpAU TC0vHm+d108w1q4409eztBQhJU0LNANAulh1WEwtDT3uLZ4UDXpFdhZtYeukGOgddKlbaE lefvy1M8J2Y6GV9RUyiHXfUt4oydkVE= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-426-90IC2E1EMriqG5d1mVCXhQ-1; Thu, 12 Oct 2023 11:35:13 -0400 X-MC-Unique: 90IC2E1EMriqG5d1mVCXhQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-77415adf76fso116822285a.1 for <libc-alpha@sourceware.org>; Thu, 12 Oct 2023 08:35:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697124912; x=1697729712; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yxctkqUAeNwVUh0d20xCQAkTAn8jm8v1Qzs+ptnUj6U=; b=lIQNXeyRYRtKzkVXdOBdi/ceONuOYMBcSv+Aock+YtANNrav3uko44W+PQ9qeQA0em l0WGq29WhIkXhTofWi6da+4cIZ1yZMFBVbrIIVrDKHPJ/DVTZ6wmuIg+qvS9Ph3ha5PA xGhCsCy6dC1tLAlY3VKhUnu+8lNwOz+Pz5akEqF4yN9vDqox5WWkabggpm6meBJAyLl8 f4EZjMRySFYFKyOpNOkjD29CjCe4PMFg+arYjXZTdHpZ3IxuCLHtXs2gFjuqBpZhy1Q8 9e5AOss5YCxpzD1n1PfRF/djTm5IG14Yjkyf0xVWQJXt7cjlR6y7NySRkwPpZLFpOMdp SafQ== X-Gm-Message-State: AOJu0YzL3HeP+4E++lGog2qrRG2L/WaMJtYrNKqD5ZKFGr3FjjNfl0U+ yFqnRSpwsJP1Gn+KF3eWUpQiS4YsYb/vlyZvmiW30YULtdKRD8J41wFLmpLpVP+caUNwu95mJa1 404m7EPzZnb/4AOVdivU0GRYcgGAQk355HkzITe1y+I6WKcMo+XkmP4I6xmNMF0EeAIZjusbZNf H9SO8f X-Received: by 2002:a05:620a:1377:b0:76f:93e:4b30 with SMTP id d23-20020a05620a137700b0076f093e4b30mr23830030qkl.67.1697124912738; Thu, 12 Oct 2023 08:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG78Kjh+qhgPVM6cqrWaFqYz2reKCJhNn2uAfDxyz5SAwaJ7t58oH9K/UZwhTgsSCd7gEkbOw== X-Received: by 2002:a05:620a:1377:b0:76f:93e:4b30 with SMTP id d23-20020a05620a137700b0076f093e4b30mr23830015qkl.67.1697124912412; Thu, 12 Oct 2023 08:35:12 -0700 (PDT) Received: from oak.redhat.com (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id c2-20020a05620a134200b00767c961eb47sm6109816qkl.43.2023.10.12.08.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 08:35:12 -0700 (PDT) From: Joe Simmons-Talbott <josimmon@redhat.com> To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott <josimmon@redhat.com> Subject: [PATCH 0/2] posix: Add group_member2 and deprecate group_member Date: Thu, 12 Oct 2023 11:34:39 -0400 Message-ID: <20231012153508.2057768-1-josimmon@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org |
Series |
posix: Add group_member2 and deprecate group_member
|
|
Message
Joe Simmons-Talbott
Oct. 12, 2023, 3:34 p.m. UTC
Add group_member2 which uses a scratch_buffer rather than alloca and returns -1 on error and sets errno. Replace the alloca usage in group_member with a scratch_buffer and call __fortify_fail when allocation fails. Deprecate group_member for Linux. Joe Simmons-Talbott (2): posix/group_member: Add group_member2 with error return. posix: Deprecate group_member for Linux include/unistd.h | 1 + posix/Makefile | 4 +++ posix/group_member.c | 32 ++++++++++++++++++++ posix/group_member.h | 29 ++++++++++++++++++ posix/tst-group_member.c | 41 +++++++++++++++++++++++++ posix/tst-group_member2.c | 42 ++++++++++++++++++++++++++ posix/unistd.h | 6 ++-- sysdeps/unix/sysv/linux/group_member.h | 27 +++++++++++++++++ 8 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 posix/group_member.h create mode 100644 posix/tst-group_member.c create mode 100644 posix/tst-group_member2.c create mode 100644 sysdeps/unix/sysv/linux/group_member.h
Comments
On Thu, 12 Oct 2023, Joe Simmons-Talbott wrote: > Add group_member2 which uses a scratch_buffer rather than alloca and > returns -1 on error and sets errno. Replace the alloca usage in > group_member with a scratch_buffer and call __fortify_fail when > allocation fails. Deprecate group_member for Linux. How was this tested? It's missing a Versions update so I wouldn't have expected the tests to link (also missing an addition of group_member.h to the list of installed headers in posix/Makefile, abilist updates for all architectures and a NEWS update for the new user-visible function; since group_member isn't documented in the manual, it's probably reasonable that it doesn't add documentation for group_member2). If group_member.h isn't intended to be a public API itself (if user code isn't intended to do #include <group_member.h>) then it should be bits/group_member.h instead with appropriate tests that it's only included from <unistd.h> and not directly from user code.
On Thu, Oct 12, 2023 at 04:59:51PM +0000, Joseph Myers wrote: > On Thu, 12 Oct 2023, Joe Simmons-Talbott wrote: > > > Add group_member2 which uses a scratch_buffer rather than alloca and > > returns -1 on error and sets errno. Replace the alloca usage in > > group_member with a scratch_buffer and call __fortify_fail when > > allocation fails. Deprecate group_member for Linux. > > How was this tested? It's missing a Versions update so I wouldn't have > expected the tests to link (also missing an addition of group_member.h to > the list of installed headers in posix/Makefile, abilist updates for all > architectures and a NEWS update for the new user-visible function; since > group_member isn't documented in the manual, it's probably reasonable that > it doesn't add documentation for group_member2). > > If group_member.h isn't intended to be a public API itself (if user code > isn't intended to do #include <group_member.h>) then it should be > bits/group_member.h instead with appropriate tests that it's only included > from <unistd.h> and not directly from user code. Sorry, this was from me combining two git branches and one wasn't ready to submit yet. Thanks for pointing out what was missing. I'll post a v2 with the missing parts soon. What are folk's thoughts on whether to make group_member.h public or not? I don't have strong feelings either way. Thanks, Joe