src/winsup/utils ChangeLog cygcheck.cc cygpath ...

Andy Koppe andy.koppe@gmail.com
Sat Aug 28 13:45:00 GMT 2010


> CVSROOT:        /cvs/src
> Module name:    src
>
> Modified files:
>        winsup/utils   : ChangeLog cygcheck.cc cygpath.cc ldh.cc
>                         locale.cc mkgroup.c mkpasswd.c module_info.cc
>                         path.cc ps.cc regtool.cc strace.cc
> Added files:
>        winsup/utils   : loadlib.h
>
> Log message:
>        * loadlib.h: New header implementing safe LoadLibrary calls.
>        Include throughout files using LoadLibrary function.
>        * cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via
>        GetModuleHandle, rather than using LoadLibrary.
>        * cygpath.cc (get_long_name): Ditto.
>        (do_sysfolders): Append .dll suffix in LoadLibrary call.
>        * ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES
>        to avoid loading malicious library code.
>        * locale.cc (print_locale_with_codeset): Change way to retrieve
>        kernel32.dll path.

I'm not convinced about the approach of #defining LoadLibrary, because
it's very easy to forget to include loadlib.h, and there's no way to
tell from just looking at a LoadLibrary("bla") call whether it's safe.

Andy



More information about the Cygwin-developers mailing list