From nobody Wed Sep 28 21:06:43 2022 X-Original-To: dev-commits-src-main@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 4Md8F01rFDz4V4TH; Wed, 28 Sep 2022 21:06:44 +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 4Md8F01Cxmz3DGQ; Wed, 28 Sep 2022 21:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664399204; 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=A5N0hoIcHq1LEc505x9yBaHKa+J/W5F/eVrXJ4m8ElM=; b=EA4AJeLjCpZ/eR6s17xPc2OAItD6G5v4zd84spP2K6lM/RoY4wrjh7/x+pIrMQxlgrLstf 8funENYT19ye7Ip5Hg5+aYecaSeIOB9zblmWr8LOLUgw+Utg2Vf+xhELrDB1t/2sPnJNL5 XwP9rQu2xrdR7v7Kny9d3vgOaGFMriaHPQCHYnMkuErbPlaJWes+UeFRDDVfbmXgerOwUp R37o3gjzh0mANPvkOWVY2ED/0rbjZ92+6WXTote60Oap2e3BwzPh5KetABve6lQ+xD3kU4 K9yrrYhYl23pie9thUJahnxIweZL9JnSgHVcODU5wo+JRjZUCV6NEZwo4Ec/nQ== 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 4Md8F00BFbzbWH; Wed, 28 Sep 2022 21:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28SL6hNh037490; Wed, 28 Sep 2022 21:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28SL6h4j037489; Wed, 28 Sep 2022 21:06:43 GMT (envelope-from git) Date: Wed, 28 Sep 2022 21:06:43 GMT Message-Id: <202209282106.28SL6h4j037489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a2e41a585b3a - main - libc rpc: Fix mismatches in prototypes for array bounds. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2e41a585b3a8a54e09831ea476ccaa56142c1ae Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664399204; 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=A5N0hoIcHq1LEc505x9yBaHKa+J/W5F/eVrXJ4m8ElM=; b=HdUlV/Y5AviYe2tTW058+5Vu2cv0yf95b+thssc3QGsZp3C7bls2cL3JfVXOfBf2hl1LV/ qd6nbWe7quucmtXoxvdY8SxFpXexdETfw2aoICNqcph7zmY/A+oCFjP/7d4BV6S/StMqU6 voa+ljWrNFlfbci9Mk/j7HLLPiTXCPlx0T65ysnCjxc49knjjENeyF00b6gBYgbImyCp3w TfZ85ihUPVm22BrLioFHjfA5LUglOhEYk1f+40NJjARb5kDj1YqIVDRJN6WkK1EJm6GDm0 CiLNZh6C/tephh8Mm7uwLhAjvE///1bNl1AC/MRona+tJzxLMYx2atuw05Nmzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664399204; a=rsa-sha256; cv=none; b=sDTt8sw7KHgl8FarHFb3wYdFuMnJEBSWrqlnjv14JBZ87HfI4Jz1UI1Af1Ed/Yq3yRehG1 cQlu88hTzJt4vg+OcJ8LWIrrDrndzoN0p+7ztpmUTYmG8KX2S3Se8k81wLffMq+q1PTaof mgZ6/rkmghWcEC9lhftyx9Nx6FgqTqejL4niNbc/a7KW3xtX0SnHtEQCvqRaqhU7400wzn d/sCCSI6aL3n8J70W803E7gEFNKbxC9mA/XlCeS+ht5H+N+OZfoK2nCb3i0nECg1co7AKz 0mYLVP9Cthzc3+eiOsVcrrTh+w6FzFty7Mx1kIrHIhLmQe6sMhgKQqJz6xwb1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e41a585b3a8a54e09831ea476ccaa56142c1ae commit a2e41a585b3a8a54e09831ea476ccaa56142c1ae Author: John Baldwin AuthorDate: 2022-09-28 21:01:36 +0000 Commit: John Baldwin CommitDate: 2022-09-28 21:01:36 +0000 libc rpc: Fix mismatches in prototypes for array bounds. Various RPC functions used a bare pointer in function prototypes to describe fixed-length buffer arguments but used a fixed-length array in the function definition. The manual page for these functions describes the parameters as being fixed-length buffers, so update the prototypes to match the definitions. Reviewed by: imp, emaste Reported by: GCC -Warray-parameter Differential Revision: https://reviews.freebsd.org/D36757 --- include/rpc/auth.h | 11 ++++++----- lib/libc/rpc/netnamer.c | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/rpc/auth.h b/include/rpc/auth.h index bf0d76c046c6..8773e7115d12 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -279,11 +279,12 @@ __END_DECLS * Netname manipulation routines. */ __BEGIN_DECLS -extern int getnetname(char *); -extern int host2netname(char *, const char *, const char *); -extern int user2netname(char *, const uid_t, const char *); -extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); -extern int netname2host(char *, char *, const int); +extern int getnetname(char [MAXNETNAMELEN + 1]); +extern int host2netname(char [MAXNETNAMELEN + 1], const char *, const char *); +extern int user2netname(char [MAXNETNAMELEN + 1], const uid_t, const char *); +extern int netname2user(char [MAXNETNAMELEN + 1], uid_t *, gid_t *, int *, + gid_t *); +extern int netname2host(char [MAXNETNAMELEN + 1], char *, const int); extern void passwd2des ( char *, char * ); __END_DECLS diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c index 591f6d5c91e5..8062c446dffe 100644 --- a/lib/libc/rpc/netnamer.c +++ b/lib/libc/rpc/netnamer.c @@ -64,7 +64,7 @@ static char *NETID = "netid.byname"; static char *NETIDFILE = "/etc/netid"; static int getnetid( char *, char * ); -static int _getgroups( char *, gid_t * ); +static int _getgroups( char *, gid_t [NGRPS] ); /* * Convert network-name into unix credential