From owner-freebsd-ports@FreeBSD.ORG Mon Feb 7 11:15:12 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA097106566B; Mon, 7 Feb 2011 11:15:12 +0000 (UTC) (envelope-from julien.laffaye@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 465128FC0C; Mon, 7 Feb 2011 11:15:11 +0000 (UTC) Received: by gwj21 with SMTP id 21so1734270gwj.13 for ; Mon, 07 Feb 2011 03:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=298O8F1FvDVlj/7extnGMhr87glTvemATn5UZJ8QMbA=; b=WA0KVAyjMQayLVNEvpVmtuekkexDDh1N4h9NNpVs1pppXjEucThiee+JMpvIJpoVxF VBDd3THZLGu7IloVRLGa6XSdhq+ixyZ6hcSn6rL+Pwj6Qlqm+uDyeR+/73F3SFvt6oNJ /v8z4Y7Kqc59sAt73c0Mdzczk26jbAA2XaavA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XHXNw8J3E4uQZqLlxQ4cmYsn0VjfAvFfyE/l4fvMWOc53d5RYslM2kQ8refwMg3oOo F+7uWHWSglnZayPw/hEANr9pBDhK3xirFzhJSm6G2HW4dlvZQWDRBhmoeM3hXE0sbLLZ VZU+GgfmCpypupVv8Sg6FC178yX+tA567Sl2k= MIME-Version: 1.0 Received: by 10.236.95.41 with SMTP id o29mr5064770yhf.29.1297075473095; Mon, 07 Feb 2011 02:44:33 -0800 (PST) Sender: julien.laffaye@gmail.com Received: by 10.236.105.239 with HTTP; Mon, 7 Feb 2011 02:44:33 -0800 (PST) In-Reply-To: References: <4D4FA4DA.608@FreeBSD.org> Date: Mon, 7 Feb 2011 10:44:33 +0000 X-Google-Sender-Auth: THoRl-EcuT7T-T6ySRQYyMnYHfE Message-ID: From: Julien Laffaye To: Florent Thoumie Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Doug Barton , freebsd-ports@freebsd.org Subject: Re: pkg_info -g not working for unprivileged user + unreadable files X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 11:15:12 -0000 On Mon, Feb 7, 2011 at 9:11 AM, Florent Thoumie wrote: > On Mon, Feb 7, 2011 at 7:52 AM, Doug Barton wrote: >> flz, >> >> In r206043 you converted fexists() in src/lib/libpkg/file.c to use open(= ) >> instead of lstat(). Unfortunately this has the side effect of breaking >> 'pkg_info -g' for unprivileged users with files that have no +r bits. Fo= r >> example: >> >> pkg_info -g sudo-1.7.4.6 >> Information for sudo-1.7.4.6: >> >> Mismatched Checksums: >> pkg_info: /usr/local/bin/sudo doesn't exist >> pkg_info: /usr/local/bin/sudoedit doesn't exist >> pkg_info: /usr/local/bin/sudoreplay doesn't exist >> pkg_info: /usr/local/sbin/visudo doesn't exist > > How can you compute the checksum if you don't have read access? > I understand that the error message should rather be "Cannot open %s". > >> Reverting your change produces the expected behavior. So my questions ar= e, >> why was the change made, what are its benefits, and how can we fix this >> problem? =A0:) > > I'm sure there was a good reason at the time. I'll have a better look lat= er. I guess that it is related to the problem where the symbolic link exists but the file pointed by the symlink does not. Why open() and not stat(), I don't remember. > > -- > Florent Thoumie > flz@FreeBSD.org > FreeBSD Committer > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" >