This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix BZ #18660 -- overflow in getusershell


On 15 Aug 2015 11:31, Paul Pluzhnikov wrote:
> P.S. AFAICT, this is nearly impossible to test :-(

it is if we get clever/abusive.  if you change misc/getusershell.c like so:
+#ifndef _LOCAL_PATH_SHELLS
+# define _LOCAL_PATH_SHELLS _PATH_SHELLS
+#endif
-	if ((fp = fopen(_PATH_SHELLS, "rce")) == NULL)
+	if ((fp = fopen(_LOCAL_PATH_SHELLS, "rce")) == NULL)

then add -D_LOCAL_PATH_SHELLS='"$(srcdir)/tst-shells.conf"' to the test's
CPPFLAGS and list misc/getusershell.c directly in the test lines.  that
way your test code will use those funcs directly with your custom shell
path.
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]