From nobody Thu May 12 18:52:40 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 49DCE1ACF091 for ; Thu, 12 May 2022 18:52:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KzgrS6bV6z3qsq for ; Thu, 12 May 2022 18:52:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C309113D4A for ; Thu, 12 May 2022 18:52:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24CIqe8J076675 for ; Thu, 12 May 2022 18:52:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24CIqeW1076674 for bugs@FreeBSD.org; Thu, 12 May 2022 18:52:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 252095] syslogd not sending hostname to loghost Date: Thu, 12 May 2022 18:52:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bdrewery@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652381561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbxWYtpREWDunyXsaGFJxJL8gvZlVHPaPP9GJpqLE7Y=; b=oMFtLvyIUKLZe0Bfiq/UxHQFaHvcK1I+tQGaJxu1aVoQ02ptyCRhJRFZQwqEsA+F2Jth23 h3DeWfhqmOuGi7kuqTK8dxmo+mhfHFAFP26GRrNPT0O1zRsSHMyqvNuXYVzSY/plN7rIUt lKkeH+HsDmhfuRttgB+PFJLLoiEH0Fs+LhCULSGd/l4elIiNkKRsE9CovWgrL1c7ErMbkk TfJPI7DqUZ+c9sVmTcMzDEe54iyZu8sIkidTGxkMbJdSRZjRThK/7x+5dE/SO7jl4o4HUj CM3PIDOwi+uYDIWyf2dUikWy2jLtPvms8BKqQgTeAmTOmkdj4htl/KfPb8riXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652381561; a=rsa-sha256; cv=none; b=O5Yiotz49r2NfPl48ad3WoX6rdH7MqClL24xGKkEGpa47jg21CdOq/S0d382Czgl2ccX1+ UZhJRimw7+TUwzeKUa1eygibGKxXHt7hF/klJEp1z3lymBJhUPdbZoyvzSIEWR+djZPRjt PFYeMDPCeLZuB5HAaZdvAfDsUulejxhoFh4XzFiBkNPfeUpnJnKq1RruNYGhE9dgHfmD82 v8NuMr/9WDkzB8g+27m/rwrMBZIOESCikSrLIqGVYz3P8/R5VQi11rvtzfgtkf3AeJtT/F +GfxTo8zgzcaSz1WOIgKEirp9NlTQok1lMZIBk3Vngvuyd17dBs2QSPG26E81g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252095 Bryan Drewery changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bdrewery@FreeBSD.org --- Comment #1 from Bryan Drewery --- The problem is that logger((1) uses capsicum now which ends up forwarding t= he entire message to syslog(3) which then adds its own hostname. syslog(3) does not support passing a hostname. If using logger -h then capsicum is disabled and the hostname is sent in a direct socket. static void=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 logmessage(int pri, const char *timestamp, const char *hostname,=20=20=20= =20=20=20=20=20=20 const char *tag, struct socks *sk, ssize_t nsock, const char *buf)=20= =20=20 {=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 char *line;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 int len, i, lsent;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 // nsock !=3D 0 when -h is given=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 if (nsock =3D=3D 0) {=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 cap_syslog(capsyslog, pri, "%s", buf);=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 return;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 }=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 // no capsicum, use custom format with hostname if ((len =3D asprintf(&line, "<%d>%s %s %s: %s", pri, timestamp,= =20=20=20 hostname, tag, buf)) =3D=3D -1)=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 errx(1, "asprintf");=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 lsent =3D -1;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 for (i =3D 0; i < nsock; i++) {=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 lsent =3D sendto(sk[i].sk_sock, line, len, 0,=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 sstosa(&sk[i].sk_addr), sk[i].sk_addrlen); --=20 You are receiving this mail because: You are the assignee for the bug.=