From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GBONFXhaXGXVIgAA9RJhRA:P1 (envelope-from ) for ; Tue, 21 Nov 2023 08:21:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GBONFXhaXGXVIgAA9RJhRA (envelope-from ) for ; Tue, 21 Nov 2023 08:21:28 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F1CC13478A for ; Tue, 21 Nov 2023 08:21:27 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=Ses+88N0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700551288; a=rsa-sha256; cv=none; b=dXcgdixExxyrmS9G8bRHRrVdEqQR4jQWulHX7UmhyOG0Ur/5QJuY6YGOyDJjmFZxqE9r4X nWR+G1EWY/rIJA2VKYvZmUPZyVexOjQtwkrneSl6Ck1KVmKaLf8TvDzLiMyicQXFMKS7vw ALd1AXXYQHPZQTBgdxmg6QgunzG2CVivg2a5v8u3+l1Hns/+TP/nBLK+73VcdP9JvJI0oM L+ZI/N6/0fW3qsLIQa6Ej8pmoFToeU750ZmSM98j29mukl8cNH1Oenwl3ZLIHSDj+cLChT iYn11acQ6nNZERdxo6p0lSBnj1VHo3TNnDfuA6ri5q6h+kTtmo2Ed43O7jRkLQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=Ses+88N0; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700551288; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Dn+0G0OlwGPnrmaPzKpDXtpPFx8ipXRq3/yhWnM4v94=; b=uA1RLe2/ijCBbw6PACArRGgx7X2+7CAvtC8JNNtDfat4W72QtA3wX3tZpFkMkoEXJiA5uh s9o85uGrPful5WPDCzCqUcJVg6si9qQlky4SU2oIH0Tc8ADVHnu3Jx4u5VPcSvidtAcVRl MEXLNC46XdJs8pzZ9bQT86J55PEaxxsgrlqkyz9ek0/XQfvmrBZJFcuKVwdyUSxa+HB+oJ aDsZkZn3ipginuUVEBZcrPFa7rA3DfZ+dCeQmZDrj1VLIHAEbi52fp+4+uQBm4PszSofjT ZyhlYwCTH1OMtGfeVXdkQ8aIpGokW6RJdAp0Tb7WT9vC/oWlXltWzh5ykpskQg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5KtW-0003P7-TA; Tue, 21 Nov 2023 02:10:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5KtU-0003MV-Au for bug-guix@gnu.org; Tue, 21 Nov 2023 02:10:00 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5KtU-0002Ga-1n for bug-guix@gnu.org; Tue, 21 Nov 2023 02:10:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5KtW-0006mE-5y for bug-guix@gnu.org; Tue, 21 Nov 2023 02:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53547: Error sending email with OpenSMTPD, fatal: time_to_text: bsnprintf Resent-From: Timmy Douglas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 21 Nov 2023 07:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53547 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 53547@debbugs.gnu.org Cc: Tobias Geerinckx-Rice X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170055057126006 (code B ref -1); Tue, 21 Nov 2023 07:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Nov 2023 07:09:31 +0000 Received: from localhost ([127.0.0.1]:55092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5Kt1-0006lO-0p for submit@debbugs.gnu.org; Tue, 21 Nov 2023 02:09:31 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5Ksv-0006l7-6h for submit@debbugs.gnu.org; Tue, 21 Nov 2023 02:09:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5Ksn-0003KY-4b for bug-guix@gnu.org; Tue, 21 Nov 2023 02:09:17 -0500 Received: from out-178.mta1.migadu.com ([2001:41d0:203:375::b2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5Ksk-0002DR-4S for bug-guix@gnu.org; Tue, 21 Nov 2023 02:09:16 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timmydouglas.com; s=key1; t=1700550549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Dn+0G0OlwGPnrmaPzKpDXtpPFx8ipXRq3/yhWnM4v94=; b=Ses+88N0pREmbsElkIv4JE0b9ZNdSXYnvc2lMtRNBoGov4M/zOy1RmV50olS7lX/BeJn+z 5NGTfYVWq6xrvck6Unc2CKIILBHFZBGAbS5XSJmer/mPlBiyVHBXYjSXkG0GLzSeB8qybX PA/pNEupEdpPspPB0311VSfT4b/gBjM= In-Reply-To: <87mtjjkpsw.fsf@timmydouglas.com> References: <87mtjjkpsw.fsf@timmydouglas.com> Date: Mon, 20 Nov 2023 23:09:05 -0800 Message-ID: <87jzqba8ha.fsf@timmydouglas.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:41d0:203:375::b2; envelope-from=mail@timmydouglas.com; helo=out-178.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Timmy Douglas From: Timmy Douglas via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: F1CC13478A X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.11 X-Spam-Score: -5.11 X-TUID: UR6LpfqMdRkT Tobias, I noticed you recently updated opensmtpd to 7.4.0 with commit 5e7f27d6ca7be84453e6d4de3d860b700ba3aef7. I was curious if you or anyone else has seen this issue, and if I should try submitting a patch to guix for it. Timmy Douglas writes: > I recently installed opensmtpd and have been trying to send email. It > appears there is an error with the bsnprintf function: > > $ ./sendmail -t > To: timmy > From: me > Subject: hi > > aoeueou > (press ^D) > sendmail: time_to_text: bsnprintf > > I reported this issue here: > https://github.com/OpenSMTPD/OpenSMTPD/issues/1166 > > mcron appears to invoke sendmail with `-t`, which is how I discovered > the issue. > > If anyone is trying to figure out how to setup the setuid on Guix > system, here is my config.scm file (I couldn't find anything online so > maybe this will help): > > (operating-system > ; ... > (append (list (setuid-program > (program (file-append opensmtpd "/sbin/smtpctl")) > (setuid? #f) > (setgid? #t) > (user "root") > (group "smtpq")) > (setuid-program > (program (file-append opensmtpd "/sbin/sendmail")) > (setuid? #f) > (setgid? #t) > (user "root") > (group "smtpq"))) > %setuid-programs)) > > I tried building the latest opensmtpd from git, which required a few > other changes to patch the bug: > > > > diff --git a/usr.sbin/smtpd/smtpc.c b/usr.sbin/smtpd/smtpc.c > index 49750dca..4ed506dc 100644 > --- a/usr.sbin/smtpd/smtpc.c > +++ b/usr.sbin/smtpd/smtpc.c > @@ -114,8 +114,8 @@ parse_tls_options(char *opt) > servname = value; > break; > case -1: > - if (suboptarg) > - fatalx("invalid TLS option \"%s\"", suboptarg); > + //if (suboptarg) > + // fatalx("invalid TLS option \"%s\"", suboptarg); > fatalx("missing TLS option"); > } > } > diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c > index 00c49cb7..3630ef1d 100644 > --- a/usr.sbin/smtpd/smtpctl.c > +++ b/usr.sbin/smtpd/smtpctl.c > @@ -52,6 +52,8 @@ > #endif > #include > > +#include > + > #include "smtpd.h" > #include "parser.h" > #include "log.h" > diff --git a/usr.sbin/smtpd/to.c b/usr.sbin/smtpd/to.c > index 3ea04d89..9928d09b 100644 > --- a/usr.sbin/smtpd/to.c > +++ b/usr.sbin/smtpd/to.c > @@ -176,7 +176,7 @@ const char * > time_to_text(time_t when) > { > struct tm *lt; > - static char buf[40]; > + static char buf[50]; > char *day[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; > char *month[] = {"Jan","Feb","Mar","Apr","May","Jun", > "Jul","Aug","Sep","Oct","Nov","Dec"}; > @@ -193,6 +193,9 @@ time_to_text(time_t when) > #elif defined HAVE_DECL_ALTZONE && defined HAVE_DECL_TIMEZONE > offset = lt->tm_isdst > 0 ? altzone : timezone; > tz = lt->tm_isdst > 0 ? tzname[1] : tzname[0]; > +#else > + offset = 0; > + tz = "GMT"; > #endif > > /* We do not use strftime because it is subject to locale substitution*/