*BSD News Article 98737


Return to BSD News archive

Newsgroups: comp.bugs.2bsd
Path: euryale.cc.adfa.oz.au!platinum.sge.net!como.dpie.gov.au!news.gan.net.au!act.news.telstra.net!vic.news.telstra.net!news.mira.net.au!pumpkin.pangea.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.new-york.net!wlbr!moe.2bsd.com!sms
From: sms@moe.2bsd.com (Steven M. Schultz)
Subject: Wrong version of strsep can be placed in libc.a (#377)
Organization: 2BSD, Simi Valley CA USA
Message-ID: <ECK8zL.48@moe.2bsd.com>
Date: Sun, 29 Jun 1997 23:23:45 GMT
Lines: 151
Xref: euryale.cc.adfa.oz.au comp.bugs.2bsd:805

Subject: Wrong version of strsep can be placed in libc.a (#377)
Index:	libc/gen/Makefile 2.11BSD

Description:
	The wrong, nonrecursive, version of strsep(3) can be placed in
	libc.a if the library is manually updated.

Repeat-By:
	cd /usr/src/lib/libc/gen
	make
	ar r /lib/libc.a
	ranlib /lib/libc.a

Fix:
	The problem is that the version of strsep.c in libc/gen is the old
	one which should have been deleted and removed from the gen/Makefile
	when the 4.4BSD version was placed in libc/string/strsep.c

	If libc.a is built using the top level Makefile in lib/libc
	then the correct version of strsep(3) will be used because 'string/'
	comes after 'gen/'.  However if only the gen/ part of the library is 
	being updated then the wrong version of strsep.c will be compiled
	and inserted into the library.

	The fix is small but important.  To apply the update cut where
	indicated and save to a file (/tmp/377).  Then:

		cd /tmp
		sh 377
		sh 377.rm
		patch -p0 < 377.patch
		cd /usr/src/lib/libc/string
		make
		ar r /lib/libc.a *.o
		cd profiled
		ar r /usr/lib/libc_p.a *.o
		cd ..
		make clean
		ranlib /lib/libc.a /usr/lib/libc_p.a

	As always this and previous updates to 2.11BSD are available via
	anonymous FTP to either FTP.IIPO.GTEGSC.COM or MOE.2BSD.COM in the
	directory /pub/2.11BSD.

-------------------------cut here-------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	377.rm
#	377.patch
# This archive created: Sun Jun 29 16:13:19 1997
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f '377.rm'
then
	echo shar: "will not over-write existing file '377.rm'"
else
sed 's/^X//' << \SHAR_EOF > '377.rm'
X#!/bin/sh
X
Xrm -f /usr/lib/libc/gen/strsep.c
SHAR_EOF
chmod 755 '377.rm'
fi
if test -f '377.patch'
then
	echo shar: "will not over-write existing file '377.patch'"
else
sed 's/^X//' << \SHAR_EOF > '377.patch'
X*** /VERSION.old	Sun Jun 29 13:47:31 1997
X--- /VERSION	Sun Jun 29 16:10:35 1997
X***************
X*** 1,4 ****
X! Current Patch Level: 376
X  Date: June 29, 1997
X  
X  2.11 BSD
X--- 1,4 ----
X! Current Patch Level: 377
X  Date: June 29, 1997
X  
X  2.11 BSD
X*** /usr/src/lib/libc/gen/Makefile.old	Fri Jun 27 19:46:46 1997
X--- /usr/src/lib/libc/gen/Makefile	Sun Jun 29 15:54:50 1997
X***************
X*** 3,9 ****
X  # All rights reserved.  The Berkeley software License Agreement
X  # specifies the terms and conditions for redistribution.
X  #
X! #	@(#)Makefile	5.7.7 (2.11BSD) 1997/06/27
X  #
X  # Several routines have been rewritten in assembly language for the VAX and
X  # the PDP. If you are not running on a VAX or PDP, you should use the
X--- 3,9 ----
X  # All rights reserved.  The Berkeley software License Agreement
X  # specifies the terms and conditions for redistribution.
X  #
X! #	@(#)Makefile	5.7.8 (2.11BSD) 1997/06/29
X  #
X  # Several routines have been rewritten in assembly language for the VAX and
X  # the PDP. If you are not running on a VAX or PDP, you should use the
X***************
X*** 28,34 ****
X  	sleep.c strcasecmp.c strftime.c swab.c sysctl.c syslog.c system.c \
X  	syserrlst.c \
X  	telldir.c time.c timezone.c ttyname.c ttyslot.c ualarm.c usleep.c \
X! 	valloc.c strdup.c strsep.c uname.c wait.c wait3.c waitpid.c
X  STDOBJ=	abort.o alarm.o atoi.o atol.o calloc.o closedir.o crypt.o \
X  	ctime.o ctype_.o daemon.o devname.o disklabel.o err.o \
X  	execvp.o fakcu.o \
X--- 28,34 ----
X  	sleep.c strcasecmp.c strftime.c swab.c sysctl.c syslog.c system.c \
X  	syserrlst.c \
X  	telldir.c time.c timezone.c ttyname.c ttyslot.c ualarm.c usleep.c \
X! 	valloc.c strdup.c uname.c wait.c wait3.c waitpid.c
X  STDOBJ=	abort.o alarm.o atoi.o atol.o calloc.o closedir.o crypt.o \
X  	ctime.o ctype_.o daemon.o devname.o disklabel.o err.o \
X  	execvp.o fakcu.o \
X***************
X*** 44,50 ****
X  	sleep.o strcasecmp.o strftime.o swab.o sysctl.o syslog.o system.o \
X  	syserrlst.o \
X  	telldir.o time.o timezone.o ttyname.o ttyslot.o ualarm.o usleep.o \
X! 	valloc.o strdup.o strsep.o uname.o wait.o wait3.o waitpid.o
X  
X  TAGSFILE=tags
X  
X--- 44,50 ----
X  	sleep.o strcasecmp.o strftime.o swab.o sysctl.o syslog.o system.o \
X  	syserrlst.o \
X  	telldir.o time.o timezone.o ttyname.o ttyslot.o ualarm.o usleep.o \
X! 	valloc.o strdup.o uname.o wait.o wait3.o waitpid.o
X  
X  TAGSFILE=tags
X  
X***************
X*** 298,304 ****
X  usleep.o: /usr/include/signal.h
X  valloc.o: valloc.c
X  strdup.o: strdup.c /usr/include/sys/types.h /usr/include/stdio.h
X- strsep.o: strsep.c /usr/include/stdio.h
X  uname.o: uname.c /usr/include/sys/param.h /usr/include/sys/localopts.h
X  uname.o: /usr/include/machine/machparam.h /usr/include/sys/types.h
X  uname.o: /usr/include/signal.h /usr/include/sys/types.h
X--- 298,303 ----
SHAR_EOF
chmod 640 '377.patch'
fi
exit 0
#	End of shell archive