Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anacron Email noification cannot be send #185

Closed
jenslauterbach11 opened this issue Jul 11, 2024 · 1 comment
Closed

Anacron Email noification cannot be send #185

jenslauterbach11 opened this issue Jul 11, 2024 · 1 comment
Labels

Comments

@jenslauterbach11
Copy link

Release 1.7.2 (fedora) an AARCH64 (Raspberry PI 4)

I have configured in anacrontab with MAILTO=root
Nevertheless the email with console output is not send.
It is failing with:
Syntax error in mailbox address "p+?t??" (non-printable character)
...
Tried to mail output of job `cron.weekly', but mailer process (/usr/sbin/sendmail) exited with status 64

The reason seems to be that in runjob.c:launch_job a pointer to a local reference is stored in jr->mailto.
According to documentation the output of getenv might get invalidated when getenv is called again (see posix standard)
I have the feeling that the address might also get invalidated after fork (before fork the mailto address seems still to be valid)
I think strdup should be used to store the result of getenv.
A local workaround by adding strdup in line 365
jr->mailto = strdup(mailto);
seems to solve the problem for me. Unfortunately this will lead to a memory leak as _jr->mailto is never released.

@t8m t8m closed this as completed in fd466b6 Jul 11, 2024
@t8m
Copy link
Member

t8m commented Jul 11, 2024

Fix was merged. Using strdup is fine as the leak is on exit only anyway. The job array is not released either.

@t8m t8m added the bug label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants