From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 28282 invoked from network); 2 Dec 1998 07:10:06 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 2 Dec 1998 07:10:06 -0000 Received: from ripspost.aist.go.jp (ripspost.aist.go.jp [150.29.9.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id CAA18160 for ; Wed, 2 Dec 1998 02:07:11 -0500 Received: from bhalpha1.nibh.go.jp ([150.29.66.225]) by ripspost.aist.go.jp (8.9.1/3.7W) with SMTP id QAA22180 for ; Wed, 2 Dec 1998 16:07:09 +0900 (JST) Date: Wed, 2 Dec 1998 16:06:55 +0900 (JST) From: Tom Holroyd X-Sender: tomh@bhalpha1.nibh.go.jp To: axp-list@redhat.com Subject: Re: Is XL300 or EBP41-AN any good? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 1 Dec 1998, Robb Romans wrote: >As a side note, RH 5.2 installed fine, with the updated ramdisk, and the >existing MILO installed from 5.1. Only problem was the fscking date got >set to 2018 on lots of files, even though I started the install from a >running 5.1 system. The cool little script to fix that posted here didn't >work on the symlinks. Right -- utime(2) [and therefore touch(1)] doesn't work on symlinks. Here is a solution: delete and recreate all the bad links. The following program will do the job for one file, and you can invoke it thusly (assuming it's called fixlinkdate): % find / -type l -exec fixlinkdate {} \; #include #include #include #include #include #include int main(int argc, char **argv) { int i, y; char filename[1024]; struct stat link; struct tm *t; if (argc != 2) { fprintf(stderr, "usage: %s filename\n", argv[0]); exit(-1); } /* Get the link's target and other details. */ if ((i = readlink(argv[1], filename, 1023)) < 0) { fprintf(stderr, "%s is not a valid symbolic link\n", argv[1]); exit(-1); } filename[i] = 0; if (lstat(argv[1], &link) < 0) { perror("lstat"); exit(-1); } /* Sanity check. */ t = localtime(&link.st_mtime); y = t->tm_year + 1900; if (y != 2018) { printf("year on %s is %d\n", argv[1], y); exit(1); } /* Delete the symbolic link and recreate it. */ if (unlink(argv[1]) < 0) { perror("unlink"); exit(-1); } if (symlink(filename, argv[1]) < 0) { perror("symlink"); exit(-1); } /* Set the owner back. */ chown(argv[1], link.st_uid, link.st_gid); } Note that this program only recreates links that have a year of 2018, which was the case for my system also. You can obviously change that value to anything.