This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] cygcheck: follow symbolic links
On Thu, 16 Feb 2006, Corinna Vinschen wrote:
> On Feb 13 13:44, Igor Peshansky wrote:
> > As promised in <http://cygwin.com/ml/cygwin/2006-02/msg00071.html>, the
> > attached patch teaches cygcheck to follow symlinks when looking for
> > executables, and also flags scripts. Sorry, had legal delays in sending
> > this (as you can see, I had this working since 02/03). Comments welcome.
> > Igor
>
> A few comments.
Thanks for looking at it and for the comments.
> - Most of your patch should go into path.cc so it can be reused, for
> instance in strace.
Agreed -- that's why I put that TODO in there. :-) Should I move it in
the next iteration of the patch?
> - Your readlink lacks checking the file attributes. Shortcut symlinks
> require a R/O attribute to be valid, old-style symlinks require the
> SYSTEM attribute.
Ouch. Will fix, thanks.
> - Couldn't you just reuse the readlink implementation in ../cygwin/path.cc
> as is, to avoid having to different implementations?
Umm, most of that code is very general purpose, and has too much extra
stuff in it. I basically used part of it (symlink_info::check_shortcut)
for my implementation. I wanted something lightweight and easy to
understand (also, the code in path.cc doesn't check for PE headers, so I
had to write that part anyway).
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"