From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 20EA13857808 for ; Sun, 10 Jan 2021 20:52:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 20EA13857808 Received: by mail-il1-x136.google.com with SMTP id e7so1048658ili.2 for ; Sun, 10 Jan 2021 12:52:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N67txfZGTz8KQlQU1ekiDmf5LAKhVXtYFa8YTnGRWsQ=; b=P6yR/Z2JCgYT5gYJuhS1S0lPjp7BaVkmOyfR0ijOTkgCQg0hsqupnlvVnnLWA3k8MT oFjyvN2GHu0tZuGDeMpoJmUAMd+zl7xoH6Ms2b3Thb6hCPtXMzwjHZjZUbA2lfN0Ge1a XNDAIt4ItMLpAdDtmGPlkHjmwA8e1sqGSx+367ZdXDQnMpHWBvJ+ExVZniOY2idOhZxh tizJjM9//2VGi2eny9Epf4cBe/8Ntlou2nodsNATqfFbuYn6hKeiNJ8Tsvs+y8Tiy2yK riHvVEgWciJbmdw6xHcaE1OSSCHzLs+UH3iky9cfuE1htAOCI5YOPqbAfot68eMSgJIX PBMQ== X-Gm-Message-State: AOAM531J3pWZPhVTRSMllOqsg1iBylwW3WxpPU+MHbh+ZDe6Ov7OxlwH pXMyTls7BvxFyim8YR50MG6pmpXfo6c= X-Google-Smtp-Source: ABdhPJySVMi7p1JOahgJS+c1JIzENci80BL4nbH44HyoK9Si97mcXSRZi3pvPV8f+Zewmgh1n6YrOg== X-Received: by 2002:a92:77c9:: with SMTP id s192mr12550708ilc.75.1610311948570; Sun, 10 Jan 2021 12:52:28 -0800 (PST) Received: from [192.168.0.41] (184-96-239-30.hlrn.qwest.net. [184.96.239.30]) by smtp.gmail.com with ESMTPSA id z4sm9809465ioh.32.2021.01.10.12.52.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jan 2021 12:52:28 -0800 (PST) Subject: Re: [PATCH] correct readlinkat attribute access (BZ #27024) From: Martin Sebor To: GNU C Library References: Message-ID: <4e3b1dce-ed69-ada4-3e97-16560c4886d2@gmail.com> Date: Sun, 10 Jan 2021 13:52:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 20:52:30 -0000 I committed & pushed this in g:2cd361b511. Martin On 1/7/21 5:49 PM, Martin Sebor wrote: > The mode in the new attribute access added in g:06febd8c670 > to readlinkat() for the third argument is wrong: it's read_only > but the function writes into the object.  The mode should be > write_only. > > The trivial patch below corrects this mistake.  Unless there > are objections I'll go ahead and commit it in the next few days. > > Martin > > diff --git a/posix/unistd.h b/posix/unistd.h > index 1306aded46..3f22763379 100644 > --- a/posix/unistd.h > +++ b/posix/unistd.h > @@ -831,7 +831,7 @@ extern int symlinkat (const char *__from, int __tofd, >  /* Like readlink but a relative PATH is interpreted relative to FD.  */ >  extern ssize_t readlinkat (int __fd, const char *__restrict __path, >                            char *__restrict __buf, size_t __len) > -     __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, > 4)); > +     __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, > 3, 4)); >  #endif > >  /* Remove the link NAME.  */