From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BAEDB1F47C for ; Tue, 10 Jan 2023 14:45:56 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=EJ9n1Ln6; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFEgG-0001tS-Ov; Tue, 10 Jan 2023 08:28:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFEfF-0001Xw-FE for bug-gnulib@gnu.org; Tue, 10 Jan 2023 08:27:45 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.218]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFEfD-0003gW-64 for bug-gnulib@gnu.org; Tue, 10 Jan 2023 08:27:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1673357256; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=opDoSnGG5OtVAvQsxRMt7jbyn6eJHEmTSvYDXTm3mRo=; b=EJ9n1Ln6RSMzTSCrI9l+21euZCmfHwLKx8z+HHgG+aW5KAFczMIrjyfaPhS//phmRW ucAYystC66rW4D9SVfNttC8GNdmMFcw1KvPlBfJK9hnxZOk1R+w7Kp2hqMM0X2jF7Fyn xzhFOj5utzo0xj7a/06YHUSoOA4Od2NyrHBVdTKtsLaevAZFlcC3o864tAFTbUXgdO9P B4rTrgTM+AzBCB1ou7OZs585+xPzFcFeGMAeO57M1k+V3fMWqyQQ96SV0QeXEz6yNz+6 Jjl0+C30MZGcXmVWJMiXXdau+sKpLsJiwXd0ytfrdqD7kuHRVCcKxQEnYLX4DWZy/bFm mazg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPF1PduizYKoc/pOf7qwTfJQ2MXcg==" X-RZG-CLASS-ID: mo00 Received: from nimes.localnet by smtp.strato.de (RZmta 48.2.1 AUTH) with ESMTPSA id t05890z0ADRaVKh (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 10 Jan 2023 14:27:36 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: secure_getenv: Fix warning on Android Date: Tue, 10 Jan 2023 14:27:36 +0100 Message-ID: <3743212.hUukIMtRk4@nimes> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.218; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Building a testdir on Android, I see this warning: ../../gllib/secure_getenv.c:34:7: warning: call to undeclared function 'issetugid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] The reason is that the function issetugid is not declared; therefore we should not use it. This patch fixes it. 2023-01-10 Bruno Haible secure_getenv: Fix warning on Android. * m4/secure_getenv.m4 (gl_FUNC_SECURE_GETENV): Test for issetugid using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. * lib/secure_getenv.c: Fix comment regarding issetugid. diff --git a/lib/secure_getenv.c b/lib/secure_getenv.c index 8b2dd5ec17..a0bc0cf817 100644 --- a/lib/secure_getenv.c +++ b/lib/secure_getenv.c @@ -30,7 +30,7 @@ secure_getenv (char const *name) { #if HAVE___SECURE_GETENV /* glibc */ return __secure_getenv (name); -#elif HAVE_ISSETUGID /* OS X, FreeBSD, NetBSD, OpenBSD */ +#elif HAVE_ISSETUGID /* musl, OS X, FreeBSD, NetBSD, OpenBSD, Solaris, Minix */ if (issetugid ()) return NULL; return getenv (name); diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4 index 85104e3488..acb06507cc 100644 --- a/m4/secure_getenv.m4 +++ b/m4/secure_getenv.m4 @@ -1,4 +1,4 @@ -# Look up an environment variable more securely. +# secure_getenv.m4 serial 2 dnl Copyright 2013-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_SECURE_GETENV], AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ AC_CHECK_FUNCS([__secure_getenv]) if test $ac_cv_func___secure_getenv = no; then - AC_CHECK_FUNCS([issetugid]) + gl_CHECK_FUNCS_ANDROID([issetugid], [[#include ]]) fi AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid]) ])