Bur reported in the Debian BTS by Adam Heath 5 years ago, still applies. If twm is called without $HOME set, it can't find the users home directory, so can't look there for config files. [23:06:56,385,Twm-Log] can't find user's HOME, looking for config file in current directory. I've straced and ltraced twm, and it calls getenv("HOME"), but not getpwent. Gimp, in this same situation, does properly find the user's home directory. This particular user is not logged in. Su was used to change to the user, and start the process.
According to getpwnam(3) [1] using HOME is the right thing to do. So I suggest to close this bug without source changes. [1] http://www.kernel.org/doc/man-pages/online/pages/man3/getpwnam.3.html#NOTES
Debian reference http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=129933
Comment #1. Not a bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.