When running qpsmtpd under `setuidgid` (from daemontools) it doesn't
reset ENV{HOME} so it tries to write to /root/tmp.
root # setuidgid smtpd echo $HOME
/root
I'm not a daemontools expert, is this expected? This is my run file and
the change I needed to make it work:
dave $ cat run
#!/bin/sh
exec /usr/bin/setuidgid smtpd /home/smtpd/smtpd/qpsmtpd -u smtpd -c 64
-m 128 2>&1
--- lib/Qpsmtpd/Utils.pm.orig 2005-06-06 18:27:03.055895116 -0700
+++ lib/Qpsmtpd/Utils.pm 2005-05-31 03:24:47.000000000 -0700
@@ -6,7 +6,7 @@
$path =~ s{^~([^/]*)} {
$1
? (getpwnam($1))[7]
- : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7])
+ : (getpwuid($>))[7]
}ex;
return $path;
}
What is the correct way of doing this?
Thanks,
ds