<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-09-23 11:52 GMT+03:00 Pino Toscano <span dir="ltr"><<a href="mailto:ptoscano@redhat.com" target="_blank">ptoscano@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 20 September 2016 16:19:30 CEST Matteo Cafasso wrote:<br>
> +  for (index = 0; index < count; index++) {<br>
> +    fsattr = tsk_fs_file_attr_get_idx (fsfile, index);<br>
> +<br>
> +    if (fsattr != NULL && fsattr->flags & TSK_FS_ATTR_NONRES)<br>
> +      tsk_fs_attr_walk (fsattr, flags, attrwalk_callback, (void *) &blkdata);<br>
<br>
</span>The return code of tsk_fs_attr_walk must be checked.<br></blockquote><div><br></div><div>I'll fix.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> +/* Attribute walk, searches the given block within the FS node attributes.<br>
> + *<br>
> + * Return TSK_WALK_CONT on success, TSK_WALK_ERROR on error.<br>
> + */<br>
> +static TSK_WALK_RET_ENUM<br>
> +attrwalk_callback (TSK_FS_FILE *fsfile, TSK_OFF_T offset,<br>
> +                   TSK_DADDR_T blkaddr, char *buf, size_t size,<br>
> +                   TSK_FS_BLOCK_FLAG_ENUM flags, void *data)<br>
> +{<br>
> +  findblk_data *blkdata = (findblk_data *) data;<br>
> +<br>
> +  if (!(flags & TSK_FS_BLOCK_FLAG_SPARSE) && blkaddr == blkdata->block) {<br>
> +    blkdata->found = true;<br>
<br>
</span>If we want to ignore sparse blocks, wouldn't it make sense to pass<br>
TSK_FS_FILE_WALK_FLAG_NOSPARSE as additional flag to tsk_fs_attr_walk<br>
above?<br>
<br>
Also, my concerns about this that I replied in v2 still stand: is the<br>
documentation obsolete, or does it document what is the expected<br>
behaviour? In the former case, then it could be ok to partially<br>
disregard what it said; in the latter, the code should follow what<br>
it describes.<br>
<br>
In any case, you should get in touch with the sleuthkit developers,<br>
and get their feedback about that.<br></blockquote><div><br></div><div>Right, I'll write something on their devs list.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Pino Toscano</font></span><br>______________________________<wbr>_________________<br>
Libguestfs mailing list<br>
<a href="mailto:Libguestfs@redhat.com">Libguestfs@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libguestfs" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libguestfs</a><br></blockquote></div><br></div></div>