Path: utzoo!utgpu!water!watmath!uunet!labrea!agate!eos!ames!zorch!pacbell!att!ihnp4!ihopa!ihop3!ihtlt!kosman!magnus!mml From: mml@magnus.UUCP (Mike Levin) Newsgroups: unix-pc.sources Subject: (Correct Version) UUCICO time bug fix Keywords: uucico, time-zone, bug Message-ID: <225@magnus.UUCP> Date: 28 Jun 88 10:06:05 GMT Reply-To: mml@magnus.UUCP (Mike Levin) Organization: Silent Radio, Los Angeles Lines: 102 This is the (corrected) version of a program which fixes the bug on the unix-pc regarding getting erroneous time-stamps on mail, uucp, etc. The (incorrect) version I posted a little while ago was cancelled (I sent the *test* version, which does other funny things). The reason that a number of people have (recently) complained about "being an hour off" and other such things is simply that since uucico is started directly from the /etc/passwd file, it doesn't get started by a shell. And the *only* place the TimeZone (TZ) variable ever gets set is in the Login program used to start shells. So, the kernal's time-zone (EST5EDT) is what ends up getting passed to uucico, and uucico (correctly?) says EDT! So, if a site is in say, Chicago, it would appear to be an hour off. A site in LA is 3 hours off. I think you get the idea. . . This program intercepts the startup of uucico, reads the /etc/TZ file, and puts the TimeZone into the environment. Then, it starts up uucico. That's all it does. Really. Read it (it's real short). Good Luck! Mike Levin The following little program should be installed as: /usr/lib/uucp/uucico.TZ This littled program should be saved with the *exact* same ownerships and permissions as uucico. The entries in /etc/passwd for uucico startups should be changed from /usr/lib/uucp/uucico to /usr/lib/uucp/uucico.TZ #----CUT-----SNIP----TRIM----SHAVE----REMOVE----EXTRACT---OR WHATEVER---- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh'MANIFEST' <<'END_OF_FILE' XuucicoTZ.c 1 This is the only file you need! ! END_OF_FILE if test 47 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test -f 'uucicoTZ.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'uucicoTZ.c'\" else echo shar: Extracting \"'uucicoTZ.c'\" \(348 characters\) sed "s/^X//" >'uucicoTZ.c' <<'END_OF_FILE' X#include Xmain() X { X char NEW_TZ[21],SET_TZ[24]; X int err,flags,putenv(),open(),read(); X X err = read( (open("/etc/TZ",O_RDONLY)), NEW_TZ, 20); X strcpy(SET_TZ,"TZ="); X strcat(SET_TZ,NEW_TZ); X if (err >= 0) putenv(SET_TZ); X else printf("Time Zone may be incorrect-- Couldn't read /etc/TZ\n"); X execl("/usr/lib/uucp/uucico","uucico",0); X } X END_OF_FILE if test 348 -ne `wc -c <'uucicoTZ.c'`; then echo shar: \"'uucicoTZ.c'\" unpacked with wrong size! fi # end of 'uucicoTZ.c' fi echo shar: End of archive 1 \(of 1\). cp /dev/null ark1isdone MISSING="" for I in 1 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have the archive. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- +---+ P L E A S E R E S P O N D T O: +---+ * * * * * * * * * * | Mike Levin, Silent Radio Los Angeles (magnus)| I never thought I'd be LOOKING | Path {csun|kosman|mtune|srhqla}!magnus!levin | for something to say! ! ! +----------------------------------------------+------------------------------+