From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 6C3513AA9819 for ; Sat, 17 Dec 2022 16:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6C3513AA9819 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-x1031.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so9078919pjj.2 for ; Sat, 17 Dec 2022 08:52:56 -0800 (PST) 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=rbVelM/MgOrT6rKBYctYIGNyGIF6O+Yx193ds2IPhs4=; b=ew3Wgqs3EkYXnaE0on/xB9QpkSkyKw85jmYtsOmZbYp5hjv3uLI4yAi/UcC63Qn9z4 MbJTSPB/c1GG5MS4bXTI8Yngi+wFwkag9FF+shyQ8U17vM5mloxflCC3M+IpL+VLtNI6 fE0I+/fy2XDhGmeiOrENV5A/9xap/da1BMNSBqkvPABWVwkQKtwhitIv/eU+5JGeiTWq Le3v3GVbmSltOuv0G7WpuIYBOuECaGoMZKM60dV6pNTeT4NFt7s5lEwzXtt9yVvhwADZ DXBpIDpvrLdeEYh+DSrHDd3zIdCcuirDHoP+wjt3qBpB1Vv+3Yk6puu6riw8VpAmo1CL dSVQ== 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=rbVelM/MgOrT6rKBYctYIGNyGIF6O+Yx193ds2IPhs4=; b=AOHCoaK4Efx0szF9NBLa/0V/HvRN/O9WAvEs8wyH9RC0quA60SHeHeeShOBgOEz9wp 0Jlcf9Z1TEpKa3v+bc7/b4/uXCvmaFcECINFEMVT3/hCSfZLyraSivbEVREIvnplfJqb V+mA4eqdRrJ6c2lIrz1I16+GAjf87Q7kmWIblxq4Gsmp3HBco63+ep25KV7rCEb813UA PAdX7cmJrQ2y1x8aK4wOMATPt6+2O9lCFOZ9ncjnfkmRzycFasM4pRQULquLx67KSzSV dUtx4Z+Wxram25+iFUY0XkivDz3rOHjYG2ANhYmxiRWieG5b0DvCY0UWfwL1EJ8ixoui jWHQ== X-Gm-Message-State: AFqh2koBznF94KJ0ElTDpyp5x9m+fDcsOhG2Al9h5jgs9QmoJmtjhgoB XWCGtGfeMN00HMh8wHu5EipeE/f6NgE= X-Google-Smtp-Source: AMrXdXunI69MiBN9bsNuW0n4mGRf9xYs6kyOqq8aZSRkTlnT5P2zHXuHqlCcF+e7LHLtfd9Y1J+0Hw== X-Received: by 2002:a17:90a:d318:b0:219:23e5:dcbe with SMTP id p24-20020a17090ad31800b0021923e5dcbemr2739906pju.19.1671295975740; Sat, 17 Dec 2022 08:52:55 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id s92-20020a17090a2f6500b002191873187dsm6643229pjd.33.2022.12.17.08.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:52:55 -0800 (PST) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH v2 12/16] libasm/debuginfod: fchmod doesn't present on win32 Date: Sun, 18 Dec 2022 00:52:09 +0800 Message-Id: <20221217165213.152-13-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221217165213.152-1-luoyonggang@gmail.com> References: <20221217165213.152-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 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 = 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