tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ffsv2 extattr support



Hi,

> > -                       val_len = strlen(argv[0]) + 1;
> > -                       mkbuf(&buf, &buflen, val_len);
> > +                       val_len = strlen(argv[0]);
> > +                       mkbuf(&buf, &buflen, val_len + 1);

Emmanuel Dreyfus:
> I committed this.

On the risk to be obtrusive, how about in line 409:

-                               fwrite(buf, buflen, 1, stdout);
+                               fwrite(buf, error, 1, stdout);

"buflen" is really the wrong variable. "error" is only a misnomer.

The negative effect is that long attribute content shows up in the
content of the next file with shorter content

  $ getextattr user bla /mnt/ffs1/[ax]
  /mnt/ffs1/a     AAAAAAAAAAAAAAAA
  /mnt/ffs1/x     xblaAAAAAAAAAAA

The code path which does

                  strvisx(visbuf, buf, error, flag_vis);

shows correct length:

  $ getextattr -s user bla /mnt/ffs1/[ax]
  /mnt/ffs1/a     "AAAAAAAAAAAAAAAA\000"
  /mnt/ffs1/x     "xbla\000"


Have a nice day :)

Thomas



Home | Main Index | Thread Index | Old Index