/etc/passwd and symlinks

Paul Fox pgf at brightstareng.com
Thu Nov 8 14:41:32 UTC 2007


ralf wrote:
 > 
 > Also, I don't see why insmod should need the realpath of the object. I 
 > thought the basename of the object file is used as the module name, but 
 > I have also seen few cases where the module name was not the file name, 
 > so that seems to be only a convention and not mandatory.

so you're saying the current code in insmod.c, and even a change to
use the _follow() version of readlink, would be okay, right?  just making
sure i understand you.  :-)

 > I noticed that you test against MAXSYMLINKS only in the case of relative 
 > symlinks. I consider this inconsistent.

oops, you're right.  that's an oversight, which i'll fix.  (note
that the test isn't really guaranteed -- there may be more
undetected symlinks embedded in the middle of the path, since i'm
only checking the tail.  but it will be caught eventually.)

 > 
 > Another question is what the function should do if the target of the 
 > link does not exist. xmalloc_readlink will always return the target 
 > name, whether it exists or not. I don't know whether this behavior would 
 > be useful for xmalloc_readlink_follow or not.

they should probably be consistent.  i can't picture a case where it
wouldn't be okay to return a dangling linkname.  i'll fix this too.

thanks for your comments.

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list