Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!cs.umn.edu!msi.umn.edu!molenda From: molenda@s1.msi.umn.edu (Jason Molenda) Newsgroups: comp.mail.elm Subject: getting elm to actually use $HOME Summary: includes patch Message-ID: <1991May28.170430.1953@s1.msi.umn.edu> Date: 28 May 91 17:04:30 GMT Organization: The Very Large Group of People Who Wish to Have More Money Lines: 44 The documentation for elm seems to indicate that elm will use the environment variable $HOME when determining where to find the .elm directory (it says "$HOME/.elm/elmrc" if memory serves me correctly). Unfortunately, it actually gets the home directory from the password file. This is a problem if you're trying to have multiple .elm directories under one account (ie when sharing an account with someone). I've modified init.c so that it will first look for the environment variable $HOME to determine the home directory. Failing that, it will look to the password file. Is there some reason why it was not done this way? Is it a possible security risk or somesuch thing? Will it fail miserably under certain cases which I'm not thinking of? I honestly don't know. I know it works the way I expect it to and I'm happy, so I'll be using the patch. If anyone else uses it, it's at your own risk. This patch is for elm 2.3 patchlevel 11. Be in the 'src' subdirectory when patching. *** init.c.orig Tue May 28 11:17:53 1991 --- init.c Tue May 28 11:20:19 1991 *************** *** 139,145 **** exit(1); } strcpy(username, pass->pw_name); ! strcpy(home, pass->pw_dir); if((cp = get_full_name(username)) != NULL) strcpy(full_username, cp); --- 139,149 ---- exit(1); } strcpy(username, pass->pw_name); ! ! if ( (cp = getenv("HOME")) == NULL) ! strcpy(home, pass->pw_dir); ! else ! strcpy(home, cp); if((cp = get_full_name(username)) != NULL) strcpy(full_username, cp); -- Jason Molenda, Tech Support, Iris & News Admin, Minnesota Supercomputer Inst molenda@msi.umn.edu || "You can tune a piano but you can't tuna fish."