From patchwork Mon Oct 5 21:17:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sebor X-Patchwork-Id: 1376865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=sVyVMPs1; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 ozlabs.org (Postfix) with ESMTPS id 4C4thv0m47z9sS8 for ; Tue, 6 Oct 2020 08:17:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABD1E395184B; Mon, 5 Oct 2020 21:17:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABD1E395184B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601932636; bh=YZ/ZvQQf+TaXYFbCfKMv5kYn1OKLg+THJWoNAJ5y9L4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sVyVMPs1yc7lkYEGXo/pY+2bMoEBfwVogYuGmfrFIgzNkg5+7Tl5mhPY9AsKlVKK2 AkWMm9D/He/xXbGQSvGxyqDgqu+6wWVs/S0tlr+J55UYNmZoA5Ng4esnPacSwjUYw/ c0ABrpiugdjB84j0gWafUYnytP81ficMfg+av6Zo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id A324F3857C4E for ; Mon, 5 Oct 2020 21:17:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A324F3857C4E Received: by mail-qt1-x833.google.com with SMTP id e7so10915043qtj.11 for ; Mon, 05 Oct 2020 14:17:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=YZ/ZvQQf+TaXYFbCfKMv5kYn1OKLg+THJWoNAJ5y9L4=; b=PTSXTuuQapIVuRa4OIjq3OCOi45WXpqSy0bd3rZRzXgsTCX6zx2X7c/MCtch+mcV/d B8GTY7UaEjYi0jml6yar7G1/7xavUPyc49ovMaiPe/01/z7zG+9H4uPlBDKmYclceRXm y0jS4M+lO0D635Hgf+Ru3oCBarUJt14/7WkJYK1MC6c9lgWpR2wpG5jiELI79fvV2GbG tFj7Q/JcR4fRPpZgqbX9LvnQ/trQHv8qvZmLiGimp1dxoXzWrYVVZNnUr0ELs0O6dAvQ f+jhbLtfdP/PhD6ik5xrknFSHk+ZFwI6KbUG1mxJq//UrjdRKS/mfVpVUwKp7WHYuPgI Q0CA== X-Gm-Message-State: AOAM531jLeF0ypO2dl0v/j2ZsP27jt1qOw7BJuvhUsuGu0nk6KWiRqSw yE2xYrLsRzLOi9W3YGnCAQa3vrFgb48= X-Google-Smtp-Source: ABdhPJxnYspj2Y6S0r1BxweJwnXiFFZAWOCCyE3RXerQM3UiltwBJx5bEBwXgOqfkq+hbwKMF6YSqg== X-Received: by 2002:ac8:bc9:: with SMTP id p9mr2047687qti.50.1601932633075; Mon, 05 Oct 2020 14:17:13 -0700 (PDT) Received: from [192.168.0.41] (97-118-127-189.hlrn.qwest.net. [97.118.127.189]) by smtp.gmail.com with ESMTPSA id e15sm682969qts.79.2020.10.05.14.17.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Oct 2020 14:17:12 -0700 (PDT) To: GNU C Library Subject: [PATCH] adjust RPC function declarations to match Sun's (BZ 26686) Message-ID: Date: Mon, 5 Oct 2020 15:17:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Martin Sebor via Libc-alpha From: Martin Sebor Reply-To: Martin Sebor Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Building Glibc with the latest GCC 11 shows a number of instances of the new -Warray-parameter. The warning is designed to encourage consistency in the forms of array arguments in redeclarations of the same function (and, ultimately, to enable the detection of out of bounds accesses via such arguments). To avoid the subset of these warnings for the RPC APIs, the attached patch changes the declarations of these functions to match both their definitions and the Oracle RPC documentation. Besides avoiding the -Warray-parameter warnings the effect of this change is for GCC to issue warnings when either the functions are passed an array with fewer than MAXNETNAMELEN + 1 elements, or when the functions themselves access elements outside the array bounds. I tested the patch by building Glibc with GCC and confirming the warnings are gone, and by running the tests and confirming no new failures in the test suite. Martin diff --git a/sunrpc/rpc/auth.h b/sunrpc/rpc/auth.h index e01b077214..6302e6e83b 100644 --- a/sunrpc/rpc/auth.h +++ b/sunrpc/rpc/auth.h @@ -179,12 +179,15 @@ extern AUTH *authdes_pk_create (const char *, netobj *, u_int, * Netname manipulating functions * */ -extern int getnetname (char *) __THROW; -extern int host2netname (char *, const char *, const char *) __THROW; -extern int user2netname (char *, const uid_t, const char *) __THROW; -extern int netname2user (const char *, uid_t *, gid_t *, int *, gid_t *) - __THROW; -extern int netname2host (const char *, char *, const int) __THROW; +extern int getnetname (char [MAXNETNAMELEN + 1]) __THROW; +extern int host2netname (char [MAXNETNAMELEN + 1], const char *, + const char *) __THROW; +extern int user2netname (char [MAXNETNAMELEN + 1], const uid_t, + const char *) __THROW; +extern int netname2user (const char [MAXNETNAMELEN + 1], uid_t *, gid_t *, + int *, gid_t *) __THROW; +extern int netname2host (const char[MAXNETNAMELEN + 1], char *, + const int); /* *