From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OMBnMa/h8GEhdAAAgWs5BA (envelope-from ) for ; Wed, 26 Jan 2022 06:52:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GGD/La/h8GFsWgAAauVa8A (envelope-from ) for ; Wed, 26 Jan 2022 06:52:47 +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 4C78326C28 for ; Wed, 26 Jan 2022 06:52:47 +0100 (CET) Received: from localhost ([::1]:32888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCbEc-00028X-B4 for larch@yhetil.org; Wed, 26 Jan 2022 00:52:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCbDu-00027f-8O for bug-guix@gnu.org; Wed, 26 Jan 2022 00:52:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCbDt-0003hY-Ua for bug-guix@gnu.org; Wed, 26 Jan 2022 00:52:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCbDt-0001OJ-Ry for bug-guix@gnu.org; Wed, 26 Jan 2022 00:52:01 -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: Wed, 26 Jan 2022 05:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53547 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 53547@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16431762985314 (code B ref -1); Wed, 26 Jan 2022 05:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Jan 2022 05:51:38 +0000 Received: from localhost ([127.0.0.1]:50811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCbDW-0001Ne-6z for submit@debbugs.gnu.org; Wed, 26 Jan 2022 00:51:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:34954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCbDV-0001NW-7t for submit@debbugs.gnu.org; Wed, 26 Jan 2022 00:51:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCbDU-00024K-Fz for bug-guix@gnu.org; Wed, 26 Jan 2022 00:51:36 -0500 Received: from out1.migadu.com ([91.121.223.63]:28316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCbDR-0003bZ-LF for bug-guix@gnu.org; Wed, 26 Jan 2022 00:51:36 -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=1643176290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Qme3xTnBb5fFPTaVdJYGxxr2H11e5T2VAq3b3VPNl5k=; b=Qj0xueehbEnlP+hNJ/Wt64V38ylPV3ElY2Wbe8bHa20THsRcqHeRdyHQXJfBpC1emoYsv8 x9KJCffrKSQpdt4BKONcUwy1YLl225aXWShOcFmhRJMfCzonXpvszmAVT9cwe9YZ9buGdC MXRa5zk8t1F7jGwK28s11qLeYi3dzEU= Date: Tue, 25 Jan 2022 21:51:27 -0800 Message-ID: <87mtjjkpsw.fsf@timmydouglas.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=91.121.223.63; envelope-from=mail@timmydouglas.com; helo=out1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Timmy Douglas From: Timmy Douglas via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643176367; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=Qme3xTnBb5fFPTaVdJYGxxr2H11e5T2VAq3b3VPNl5k=; b=qeIniATgQA8YZm2OE1XMrkRGPRwaPm5MA42Ggh3YGPnpSVxwvtzBMqWP4I9Xw6GTVXn825 gxYktn0KLh0lsoJa6ZQ+BFlx4YPIUVoU5fq/hdfPMBRTz22xnFra2tq91oFs8GVO23J4D3 mHgWfPE7dawX7hVNSBoRSTXXVXCglLAOzoLqFXA04xhKbSVitak2V3RAyIFAjdzOFmn8Mj kGJbtwDz4I9Sp2q6qki/4Z4CaxA48JJxPoTF6MYpcSCMoP60sTZ1pLEY1WtYmA8E8fQao2 OCt0J60i2dwcK//RpE+PYQLa7PoG9qkOVGQyD03yYmrQl+0KIBYHj9wH3XmICA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643176367; a=rsa-sha256; cv=none; b=erPClfVzM08TuJvTO7zBVcgfydFV22OcVCVJyYc9+WvW0InUbGbrfYotyWHX2RVrDVSGmf Xgtj7HmmhsWNeCKHPantCPTfLruyPRTSDSZamF5WpS02G0n9jtrOJ962mcGvdMZ9+t9Kun W3wd+BJRq6sTGGQh3XYVjfh2ad/VLcUISG8QgtWmK5Vk0jhbOVJJFn/MvIpGPrR3XOiyBs Ae/E2W/gwMM3ts+QApcKRajsfctMUZzWyHF1Y0spfrddbc/M5jFxEeG7b38tzmpdrI12Af BgazIFpAJUNFAnfRbGJsw/FJMmtNhtoQqDCCqz/tyBGEl9Zjbv6K1DFxujnchA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=Qj0xueeh; 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" X-Migadu-Spam-Score: -3.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=Qj0xueeh; 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" X-Migadu-Queue-Id: 4C78326C28 X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4OL98HrqOSBp 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*/