From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 6CAA63858D1E for ; Wed, 21 Dec 2022 18:16:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6CAA63858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 261B6300071A; Wed, 21 Dec 2022 19:16:15 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id BDFDB413CD0E; Wed, 21 Dec 2022 19:16:14 +0100 (CET) Message-ID: <07f491d2ae87eb5d20101c96dd1a15f6b95772b9.camel@klomp.org> Subject: Re: [PATCH v2 12/16] libasm/debuginfod: fchmod doesn't present on win32 From: Mark Wielaard To: Yonggang Luo , elfutils-devel@sourceware.org Date: Wed, 21 Dec 2022 19:16:14 +0100 In-Reply-To: <20221217165213.152-13-luoyonggang@gmail.com> References: <20221217165213.152-1-luoyonggang@gmail.com> <20221217165213.152-13-luoyonggang@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-3038.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,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 List-Id: Hi, On Sun, 2022-12-18 at 00:52 +0800, Yonggang Luo via Elfutils-devel wrote: > index 8873fcc8..7a67a440 100644 > --- a/debuginfod/debuginfod-client.c > +++ b/debuginfod/debuginfod-client.c > @@ -1708,9 +1708,11 @@ debuginfod_query_server (debuginfod_client *c, > tvs[0].tv_usec =3D tvs[1].tv_usec =3D 0; > (void) futimes (fd, tvs); /* best effort */ > =20 > +#if !defined(_WIN32) > /* PR27571: make cache files casually unwriteable; dirs are > already 0700 */ > (void) fchmod(fd, 0400); > - =20 > +#endif > + > /* rename tmp->real */ > rc =3D rename (target_cache_tmppath, target_cache_path); > if (rc < 0) > diff --git a/libasm/asm_end.c b/libasm/asm_end.c > index c06d2366..54540bc1 100644 > --- a/libasm/asm_end.c > +++ b/libasm/asm_end.c > @@ -512,12 +512,14 @@ asm_end (AsmCtx_t *ctx) > if (result !=3D 0) > return result; > =20 > +#if !defined(_WIN32) > /* Make the new file globally readable and user/group- > writable. */ > if (fchmod (ctx->fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | > S_IROTH) !=3D 0) > { > __libasm_seterrno (ASM_E_CANNOT_CHMOD); > return -1; > } > +#endif I don't like the __WIN32 define checks. Is fchmod really not available?? It seems it is a standard Posix function. Can we have a configure check for it then? Thanks, Mark