From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id A4441384B127 for ; Thu, 20 Oct 2022 18:27:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4441384B127 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1035.google.com with SMTP id pb15so189107pjb.5 for ; Thu, 20 Oct 2022 11:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mIdr76GQnVv1kPXeEqpGA2avdLxHyd8TIFB6X5Np+AI=; b=OAEJh466LM9hM50YzVaP66YOEXawvF1EbjDH7N7dZxV81EbiabVJxR1ct34urWtfC0 kNAOffqqnog2Kqh3bJ4XNxIzCDZyS441oRauDRGJ8xNaOD6vriajMkOG1qARKstqdJ7P 1YsSWj6WDjcCeOtZZjwVJ+JxYhaMad8wpa3rwIgeOyZmsEsHvNm2iDkRS54bS+w7cg89 yf7WxNuSI5tF5lkobZqybB/GR147fH+Ca1fQ975uI86y1rO4/k+at9jJ0Homqd+kQxn/ I/mRhusx9HT5SfqDA3ml3gzNU+wxKzGqCCA4yjQLyCknhvMkhaXVqWClWutu9iZVmTWn cnTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mIdr76GQnVv1kPXeEqpGA2avdLxHyd8TIFB6X5Np+AI=; b=fDEJN9L3a1Izw/ccg010HAkOjpBjWiMNET5IaVGZnpZ0qL6h1RY1G8WdiI93PYLiqt UzCWvfw4theowVoDLFVJbbOuBk/uCjVVBlaWcVcDmx9OxVm57YzCOF9qR/QjBpttnIqG QWWyVvlTUrLDYVz5EdYT8rPLNKO2Cr6jexqfBkCYLHy33v0NKDMJy4v3qb7jZ1b7eo0W TitYdGTwA1Xn0HANzAp34EqemhdqLVZN19vUS6y8NovSThco9nG8rwEOyeXCn6kqqX29 MS2fM3EgTiFonrPuPpxY5WPnpc5bpfLRiaoQAcvyU5Zc0flLIw54FUoJTneohBaL8Wbn V18A== X-Gm-Message-State: ACrzQf3AUPGsa4bgBhFh7fCQKwfX8+yMV4ZNbXyUM+x9mZRUTM5Im9Jx oQ+BZY7Fk41de373gymBZLel7wi4ns0XFg== X-Google-Smtp-Source: AMsMyM7JDD1smTmiPpYWwStwAeVpGeudoUlaWb+/cd8mR/FZQgQMqxwu9aOd7kMfxbMtXPwOIZ4MtA== X-Received: by 2002:a17:90b:4b0f:b0:211:41f:1c72 with SMTP id lx15-20020a17090b4b0f00b00211041f1c72mr7665997pjb.25.1666290432358; Thu, 20 Oct 2022 11:27:12 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id w15-20020a17090a460f00b00202fbd9c21dsm115067pjg.48.2022.10.20.11.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 11:27:11 -0700 (PDT) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH 23/25] libasm/debuginfod: fchmod doesn't present on win32 Date: Fri, 21 Oct 2022 02:26:02 +0800 Message-Id: <20221020182603.815-24-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221020182603.815-1-luoyonggang@gmail.com> References: <20221020182603.815-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,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: Signed-off-by: Yonggang Luo --- debuginfod/debuginfod-client.c | 4 +++- libasm/asm_end.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 2a14d9d9..4b7f837b 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -1405,9 +1405,11 @@ debuginfod_query_server (debuginfod_client *c, tvs[0].tv_usec = tvs[1].tv_usec = 0; (void) futimes (fd, tvs); /* best effort */ +#if !defined(_WIN32) /* PR27571: make cache files casually unwriteable; dirs are already 0700 */ (void) fchmod(fd, 0400); - +#endif + /* rename tmp->real */ rc = 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 != 0) return result; +#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) != 0) { __libasm_seterrno (ASM_E_CANNOT_CHMOD); return -1; } +#endif /* Rename output file. */ if (rename (ctx->tmp_fname, ctx->fname) != 0) -- 2.36.1.windows.1