From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dog.birch.relay.mailchannels.net (dog.birch.relay.mailchannels.net [23.83.209.48]) by sourceware.org (Postfix) with ESMTPS id 5689C385E447 for ; Wed, 19 May 2021 15:23:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5689C385E447 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 56967482BFD; Wed, 19 May 2021 14:04:01 +0000 (UTC) Received: from pdx1-sub0-mail-a61.g.dreamhost.com (100-96-16-68.trex.outbound.svc.cluster.local [100.96.16.68]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E732248310D; Wed, 19 May 2021 14:03:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a61.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.16.68 (trex/6.2.1); Wed, 19 May 2021 14:04:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Scare-Reign: 49d28e7003f69027_1621433041171_234285757 X-MC-Loop-Signature: 1621433041171:3734118050 X-MC-Ingress-Time: 1621433041171 Received: from pdx1-sub0-mail-a61.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTP id A459A7F017; Wed, 19 May 2021 07:03:59 -0700 (PDT) Received: from [192.168.1.111] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTPSA id 719607E676; Wed, 19 May 2021 07:03:57 -0700 (PDT) Subject: Re: [PATCH] ldconfig: Fix memory leaks To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20210511171627.360100-1-siddhesh@sourceware.org> <1ba04d0c-6b76-94e4-4c60-ad2246aa1357@linaro.org> <65de069f-72f6-e8c5-b5e6-1930bdfae607@gotplt.org> <2cf48d15-86b7-4def-fc9f-80e7fd5a5dae@sourceware.org> <8bb09ee0-c85c-1e16-aa56-7a4b57982c71@linaro.org> <50a9c721-1e3f-5b16-1e4c-22fe0be80d3c@sourceware.org> <7915a19a-ef20-f416-f849-83b23faae5c8@linaro.org> X-DH-BACKEND: pdx1-sub0-mail-a61 From: Siddhesh Poyarekar Message-ID: Date: Wed, 19 May 2021 19:33:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <7915a19a-ef20-f416-f849-83b23faae5c8@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3487.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no 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: Wed, 19 May 2021 15:23:52 -0000 On 5/19/21 7:24 PM, Adhemerval Zanella wrote: > It would be straightforward change, but I think there is no much gain in > either supporting a path larger than PATH_MAX (it might fail in later > usages anyway if the full path is used) or trying to add the optimization > of just resolving the PATH. I don't think it can support paths larger than PATH_MAX because the later lstat64 will fail with ENAMETOOLONG. > What I really dislike is that chroot_canon is quite similar to the old > realpath implementation we had, and analyzing its usage I think we can > just resolve the full path ([chroot,path]) with realpath instead of > call chroot_canon. It would require more changes in ldconfig code > though. I think your patch with the changes I suggested ought to be a sufficient minimal change. Do you want to fix up and post? Siddhesh