Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2011 10:44:33 +0000
From:      Julien Laffaye <jlaffaye@freebsd.org>
To:        Florent Thoumie <flz@freebsd.org>
Cc:        Doug Barton <dougb@freebsd.org>, freebsd-ports@freebsd.org
Subject:   Re: pkg_info -g not working for unprivileged user + unreadable files
Message-ID:  <AANLkTimUFVpqW7bqFcs0kQPR3zKRxJ8jCsu_-D=Wc%2BcM@mail.gmail.com>
In-Reply-To: <AANLkTinvc5gins3MzMGmXLX=SfZ0eUQEvmrRdwjcgTxA@mail.gmail.com>
References:  <4D4FA4DA.608@FreeBSD.org> <AANLkTinvc5gins3MzMGmXLX=SfZ0eUQEvmrRdwjcgTxA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 7, 2011 at 9:11 AM, Florent Thoumie <flz@freebsd.org> wrote:
> On Mon, Feb 7, 2011 at 7:52 AM, Doug Barton <dougb@freebsd.org> 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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimUFVpqW7bqFcs0kQPR3zKRxJ8jCsu_-D=Wc%2BcM>