Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Mar 1995 16:36:51 -0800 (PST)
From:      Steven G Kargl  <kargl@troutmask.apl.washington.edu>
To:        nate@trout.sri.MT.net (Nate Williams)
Cc:        freebsd-hackers@freefall.cdrom.com
Subject:   Re: install compressed binary patch
Message-ID:  <199503140036.QAA16032@troutmask.apl.washington.edu>
In-Reply-To: <199503140008.RAA03977@trout.sri.MT.net> from "Nate Williams" at Mar 13, 95 05:08:21 pm

next in thread | previous in thread | raw e-mail | index | archive | help
According to Nate Williams:
> 
> But..
> 
> > + 	/*
> > + 	 * Compression must have been successful, if we get here.
> > + 	 * So, build a filename for the gzipped file
> > + 	 */
> > + 	if (strlen(to_name) < MAXPATHLEN - 3)
> > + 		strcpy(gz_name, to_name);
> > + 	strcat(gz_name, ".gz");
> 
> What happens if strlen(to_name) >= MAXPATHLEN -3?

I thought about this for about a second.  The correct thing to do would be
to declare gz_name as char *, then malloc the needed size of memory,
then free the memory on exit.  I was a little lazy.

> Also, wouldn't it be better to copy the file into a temporary directory,
> gzip it, and then install the gzipped executable rather than the symlink
> solution?  We don't need multiple copies of the file lying around IMHO.

Actually, I misunderstood how the gzip psuedo-device works.  Apparently,
a sym link isn't needed at all.  If we remove the sym link stuff, then
multiple copies shouldn't be lying around.   My gzip addition is at the
end of the install procedure.  Ordinarily, the file is moved to its 
destination unless -c is given.  gzip compresses the file and if successful
removes the original.

-- 
Steven G. Kargl            | Phone: 206-685-4677 |
Applied Physics Laboratory | Fax:   206-543-6785 |
University of Washington   |---------------------|
1013 NE 40th St            | FreeBSD 2.1-current |
Seattle, WA 98105          |---------------------|



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503140036.QAA16032>