[Toybox] Regarding if() condition in dirtree_add_node

Sandeep Sharma sandeep.jack2756 at gmail.com
Mon May 20 22:36:41 PDT 2013


Hi Rob,

               I have came across a condition in dirtree_add_node(), where
we are reading the link even though symfollow is not set :-

               if (S_ISLNK(st.st_mode) {
               if (0>(linklen = readlinkat(fd, name, buf, 4095))) goto
error;
               buf[linklen++]=0;
               }
              In this senario if we land in readonly links it shouts that
the link is not present, even thogh we are not following links.
              I think condition should be
              if (S_ISLNK(st.st_mode) && symfollow). whats your opinion?

             And one more thing:-
             I am using xreadfile() function present in lib.c but it
is commented. Do you mind uncommenting it?


Regards
Sandeep
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20130521/69da148f/attachment-0004.htm>


More information about the Toybox mailing list