From owner-freebsd-hackers Mon Mar 13 16:43:38 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA03228 for hackers-outgoing; Mon, 13 Mar 1995 16:43:38 -0800 Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.97.216]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id QAA03215 for ; Mon, 13 Mar 1995 16:43:36 -0800 Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.6.10/8.6.9) id QAA16032; Mon, 13 Mar 1995 16:36:52 -0800 From: Steven G Kargl Message-Id: <199503140036.QAA16032@troutmask.apl.washington.edu> Subject: Re: install compressed binary patch To: nate@trout.sri.MT.net (Nate Williams) Date: Mon, 13 Mar 1995 16:36:51 -0800 (PST) Cc: freebsd-hackers@freefall.cdrom.com In-Reply-To: <199503140008.RAA03977@trout.sri.MT.net> from "Nate Williams" at Mar 13, 95 05:08:21 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1411 Sender: hackers-owner@FreeBSD.org Precedence: bulk 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 |---------------------|