Package: cron
Version: 3.0pl1-137
Severity: normal

When esmtp is invoked by cron (via sendmail), it cannot read ~/.esmtprc because 
HOME is set to /.
Cron should set HOME correctly for sendmail.

I did
# cat /tmp/esmtp.sh
#!/bin/sh
exec strace -v -o /tmp/esmtp.log -e trace=file /tmp/esmtp "$@"
# chmod +x /tmp/esmtp.sh
# cp /usr/bin/esmtp /tmp
# mount --bind /tmp/esmtp.sh /usr/bin/esmtp

and got
execve("/tmp/esmtp", ["/tmp/esmtp", "-FCronDaemon", "-i", "-B8BITMIME", "-oem", 
"root"], ["CONSOLE=/dev/console", "HOME=/", "OLDPWD=/", "runlevel=2", 
"INIT_VERSION=sysvinit-3.00", "TERM=linux", "COLUMNS=128", 
"BOOT_IMAGE=/boot/vmlinuz-5.14.21", "PATH=/usr/bin:/bin", "RUNLEVEL=2", 
"PREVLEVEL=N", "SHELL=/bin/sh", "PWD=/root", "previous=N", "LINES=48"]) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libesmtp.so.6", O_RDONLY|O_CLOEXEC) 
= 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libssl.so.1.1", O_RDONLY|O_CLOEXEC) 
= 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libcrypto.so.1.1", O_RDONLY|O_CLOEXEC) 
= 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 
3
lstat("/.esmtprc", 0x7fff3a42da10)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/.esmtprc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/esmtprc", O_RDONLY) = 3
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16582, si_uid=1000, 
si_status=0, si_utime=0, si_stime=0} ---
+++ exited with 0 +++


-- Package-specific info:
--- EDITOR:


--- /usr/bin/editor:
/usr/bin/nvi

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 43568 Feb 22  2021 /usr/bin/crontab

--- /var/spool/cron:
drwxr-xr-x 3 root root 60 Dec  6 06:09 /var/spool/cron

--- /var/spool/cron/crontabs:
drwx-wx--T 2 root crontab 40 Feb 22  2021 /var/spool/cron/crontabs

--- /etc/cron.d:
drwxr-xr-x 2 root root 80 Dec  6 06:09 /etc/cron.d

--- /etc/cron.daily:
drwxr-xr-x 2 root root 120 Dec  6 07:08 /etc/cron.daily

--- /etc/cron.hourly:
drwxr-xr-x 2 root root 60 Dec  6 06:09 /etc/cron.hourly

--- /etc/cron.monthly:
drwxr-xr-x 2 root root 60 Dec  6 06:09 /etc/cron.monthly

--- /etc/cron.weekly:
drwxr-xr-x 2 root root 60 Dec  6 06:09 /etc/cron.weekly


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.14.21 (SMP w/4 CPU threads)
Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP), LANGUAGE not 
set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages cron depends on:
ii  adduser              3.118
ii  debianutils          5.5-1
ii  init-system-helpers  1.60
ii  libc6                2.32-5
ii  libpam-runtime       1.4.0-10
ii  libpam0g             1.4.0-10
ii  libselinux1          3.3-1+b1
ii  lsb-base             11.1.0
ii  sensible-utils       0.0.17

Versions of packages cron recommends:
ii  esmtp-run [mail-transport-agent]  1.2-18

Versions of packages cron suggests:
pn  anacron        <none>
pn  checksecurity  <none>
ii  logrotate      3.18.1-2

Versions of packages cron is related to:
pn  libnss-ldap   <none>
pn  libnss-ldapd  <none>
pn  libpam-ldap   <none>
pn  libpam-mount  <none>
pn  nis           <none>
pn  nscd          <none>

-- no debconf information

Reply via email to