From owner-freebsd-ports@FreeBSD.ORG Mon Feb 7 09:38:15 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 18ED4106564A; Mon, 7 Feb 2011 09:38:15 +0000 (UTC) (envelope-from florent.thoumie@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id B3A188FC16; Mon, 7 Feb 2011 09:38:14 +0000 (UTC) Received: by yxh35 with SMTP id 35so1714203yxh.13 for ; Mon, 07 Feb 2011 01:38:14 -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:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Ziyjj09I3H2pnyFhchOBxoutinpmTJ1b81GiiKRetZo=; b=JsyE3A202cJNwaMSEdC/PUcbSvumroY68b4MJegGne5Slv39gybdBOhU11HNkZV0OW 1UBfSVFE8zKFx7IcuTf05wWhMFyX10DAzi5fCCNIr/N0iI2eeTX0X37vBij9S3dvexHN d/LKvparpyzHMJjWRinQwHQ/dsySAFaLna0kQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=J7prNg+pH3A7rKd3yw2g7BfJJ3K1ZwQWpfRRnr8XNsYRMx9srj9BO0A1CT/rSgg5RG cBnfT/P/P6pf9q6riXb9xEV6L0FqvXUyF+ISdmdE1mkf0XpzeXa+zcbx/kB8OJz8vKld ozjwkoc8AEdeh/FNzbb2GLtt2PLYWYXTWjBUY= Received: by 10.100.96.5 with SMTP id t5mr9464192anb.258.1297069919508; Mon, 07 Feb 2011 01:11:59 -0800 (PST) MIME-Version: 1.0 Sender: florent.thoumie@gmail.com Received: by 10.100.4.7 with HTTP; Mon, 7 Feb 2011 01:11:39 -0800 (PST) In-Reply-To: <4D4FA4DA.608@FreeBSD.org> References: <4D4FA4DA.608@FreeBSD.org> From: Florent Thoumie Date: Mon, 7 Feb 2011 09:11:39 +0000 X-Google-Sender-Auth: qqnhz6alkSscqrt4r43ZgLfy9ek Message-ID: To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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 09:38:15 -0000 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. For > 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 are= , > 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 later= . --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer