From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 B73061F45D for ; Sat, 21 Mar 2020 23:15:26 +0000 (UTC) Received: from localhost ([::1]:41694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFnKv-0007Or-7y for normalperson@yhbt.net; Sat, 21 Mar 2020 19:15:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36216) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFnKp-0007OX-PI for bug-gnulib@gnu.org; Sat, 21 Mar 2020 19:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFnKn-0005as-0v for bug-gnulib@gnu.org; Sat, 21 Mar 2020 19:15:18 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50626) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jFnKm-0005Xb-QH for bug-gnulib@gnu.org; Sat, 21 Mar 2020 19:15:16 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 57C961600CC; Sat, 21 Mar 2020 16:15:12 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oJmOCFH_mxER; Sat, 21 Mar 2020 16:15:11 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5DBFC1600CD; Sat, 21 Mar 2020 16:15:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id tJzj4E4_wqAa; Sat, 21 Mar 2020 16:15:11 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2E6391600CC; Sat, 21 Mar 2020 16:15:11 -0700 (PDT) Subject: Re: rpl_unlink sets errno to EPERM on malloc failure To: =?UTF-8?Q?Tim_R=c3=bchsen?= References: <6e8ef102-a270-91f4-12e4-6a42e3ebbebf@gmx.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <156fab0e-2e6f-bf6a-dcf4-e0b283ad8ef1@cs.ucla.edu> Date: Sat, 21 Mar 2020 16:15:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <6e8ef102-a270-91f4-12e4-6a42e3ebbebf@gmx.de> Content-Type: multipart/mixed; boundary="------------2F5A248CF1961CD554E5BBDA" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------2F5A248CF1961CD554E5BBDA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 3/20/20 4:54 AM, Tim R=C3=BChsen wrote: > Is this EPERM intended ? No, it's clearly a typo. Thanks for reporting it. I installed the attache= d. --------------2F5A248CF1961CD554E5BBDA Content-Type: text/x-patch; charset=UTF-8; name="0001-unlink-fix-malloc-errno-typo.patch" Content-Disposition: attachment; filename="0001-unlink-fix-malloc-errno-typo.patch" Content-Transfer-Encoding: quoted-printable >From 3e89c500a2f17a8a7a278390d48419990ce24bc8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 21 Mar 2020 16:13:28 -0700 Subject: [PATCH] unlink: fix malloc errno typo MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Problem reported by Tim R=C3=BChsen in: https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html * lib/unlink.c (rpl_unlink): Don=E2=80=99t mask malloc errno. --- ChangeLog | 7 +++++++ lib/unlink.c | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0019334ca..9b2a112eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-03-21 Paul Eggert + + unlink: fix malloc errno typo + Problem reported by Tim R=C3=BChsen in: + https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html + * lib/unlink.c (rpl_unlink): Don=E2=80=99t mask malloc errno. + 2020-03-16 Bruno Haible =20 *printf-posix: Fix m4 error (regression from 2020-03-08). diff --git a/lib/unlink.c b/lib/unlink.c index b7daa7cd3..5e0f4e177 100644 --- a/lib/unlink.c +++ b/lib/unlink.c @@ -65,10 +65,7 @@ rpl_unlink (char const *name) /* Trailing NUL will overwrite the trailing slash. */ char *short_name =3D malloc (len); if (!short_name) - { - errno =3D EPERM; - return -1; - } + return -1; memcpy (short_name, name, len); while (len && ISSLASH (short_name[len - 1])) short_name[--len] =3D '\0'; --=20 2.17.1 --------------2F5A248CF1961CD554E5BBDA--