On 2026-03-18, Kastus Shchuka <[email protected]> wrote:
> On Mon, Mar 16, 2026 at 06:33:54AM -0700, Kastus Shchuka wrote:
>> On Mon, Mar 16, 2026 at 11:18:07AM +0100, [email protected] wrote:
>> > hi everyone
>> > 
>> > since i got no replies on the bugs mailing list[0], i was wondering if
>> > it also stopped working for others or if i am doing something wrong here
>> > 
>> > /etc/daily runs `calendar -a` and it stopped sending emails for me
>> 
>> I observe the same behavior after installing patch 21--no emails are sent 
>> from calendar
>> invocation from /etc/daily or manual run of "doas calendar -a"
>> 
> I wonder if it breaks here in io.c:
>
>     386         /* set output to a temporary file, so if no output don't send 
> ma    386 il */
>     387         return(tmpfile());
>
> As tmppath is no longer available in pledge(2), I guess calendar
> should use unveil(2) with path "/tmp" and permissions "rwc".
>
> Simple recompiling of calendar as suggested in OpenBSD 7.8 errata 021, March 
> 10, 2026
> is not enough to keep "calendar -a" functionality.

an additional change is necessary, this has been applied to -current
but not in patches at present

Index: calendar.c
===================================================================
RCS file: /cvs/src/usr.bin/calendar/calendar.c,v
diff -u -p -r1.37.26.1 -r1.42
--- calendar.c  27 Feb 2026 20:31:13 -0000      1.37.26.1
+++ calendar.c  16 Mar 2026 17:19:27 -0000      1.42
@@ -128,8 +128,14 @@ main(int argc, char *argv[])
        if (doall) {
                if (unveil("/tmp", "rwc") == -1)
                        err(1, "unveil /tmp");
+               if (unveil("/dev/null", "rw") == -1)
+                       err(1, "unveil /dev/null");
                if (unveil("/", "r") == -1)
                        err(1, "unveil /");
+               if (unveil(_PATH_SENDMAIL, "x") == -1)
+                       err(1, "unveil " _PATH_SENDMAIL);
+               if (unveil(_PATH_CPP, "x") == -1)
+                       err(1, "unveil " _PATH_CPP);
                if (pledge("stdio rpath wpath cpath fattr getpw id proc exec",
                    NULL) == -1)
                        err(1, "pledge");

Reply via email to