Greg Steuck wrote:
> Thanks for the patch.
>
> I could see some value in tightening the conditions to always check
> `!= expected`. I don't see enough improvement from separating the error
> case of -1 from the incomplete read case considering the otherwise
> identical behavior.
Like this? The i
Greg Steuck wrote:
> Thanks for the patch.
>
> I could see some value in tightening the conditions to always check
> `!= expected`. I don't see enough improvement from separating the error
> case of -1 from the incomplete read case considering the otherwise
> identical behavior.
Hmm, that is a
Greg Steuck wrote:
> Thanks for the patch.
>
> I could see some value in tightening the conditions to always check
> `!= expected`. I don't see enough improvement from separating the error
> case of -1 from the incomplete read case considering the otherwise
> identical behavior.
I'll refer to ht
Thanks for the patch.
I could see some value in tightening the conditions to always check
`!= expected`. I don't see enough improvement from separating the error
case of -1 from the incomplete read case considering the otherwise
identical behavior.
Lucas writes:
> Bump.
>
>
Bump.
---
commit 92f58b2a1cd576c3e72303004388ab1e9709e327 (ldd-read-rv)
from: Lucas
date: Sat Aug 5 16:34:16 2023 UTC
Check {,p}read return values consistently
Check that read performs a full header read. Explicitly check against -1
for failure
That looks better.
Lucas wrote:
> Theo Buehler wrote:
> > > - if (pread(fd, phdr, size, ehdr.e_phoff) != size) {
> > > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) {
> >
> > did you intend to check for == -1?
> >
> > > warn("read(%s)", name);
> >
> > should that not say
Theo Buehler wrote:
> > - if (pread(fd, phdr, size, ehdr.e_phoff) != size) {
> > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) {
>
> did you intend to check for == -1?
>
> > warn("read(%s)", name);
>
> should that not say pread?
Indeed, thanks for spotting both things
> - if (pread(fd, phdr, size, ehdr.e_phoff) != size) {
> + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) {
did you intend to check for == -1?
> warn("read(%s)", name);
should that not say pread?
"Theo de Raadt" wrote:
> Nope, that is not correct.
>
> errno is not being cleared. It just happens to be zero. Future
> code changes could insert another operation above which would set
> errno, and then this would print a report about that error.
Although I was being sarcastic with """Everyt
Lucas wrote:
> "Theo de Raadt" wrote:
> > What errno is being printed here?
>
> """Everything is alright""" error,
>
> $ : >empty && ./obj/ldd empty
> ldd: read(empty): Undefined error: 0
>
> which would be the same as a short read in the pread below.
Nope, that is not correct.
"Theo de Raadt" wrote:
> What errno is being printed here?
"""Everything is alright""" error,
$ : >empty && ./obj/ldd empty
ldd: read(empty): Undefined error: 0
which would be the same as a short read in the pread below.
Bigger suggestion below, addressing both read and pread.
Lucas wrote:
> Bump.
>
> Lucas wrote:
> > Now with a better subject.
> >
> > I was also wondering about the lack of pledge() other than the newly
> > added one. That goes because dlopen() can do anything?
> >
> > Lucas wrote:
> > > Hi,
> > >
> > > I wanted to understand how the pledge execp
Bump.
Lucas wrote:
> Now with a better subject.
>
> I was also wondering about the lack of pledge() other than the newly
> added one. That goes because dlopen() can do anything?
>
> Lucas wrote:
> > Hi,
> >
> > I wanted to understand how the pledge execpromises commit worked in ldd
> > and we
Now with a better subject.
I was also wondering about the lack of pledge() other than the newly
added one. That goes because dlopen() can do anything?
Lucas wrote:
> Hi,
>
> I wanted to understand how the pledge execpromises commit worked in ldd
> and went to read it, and noticed that there is
14 matches
Mail list logo