From owner-freebsd-bugs@freebsd.org Mon Nov 6 05:28:59 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB6AE4B0E9 for ; Mon, 6 Nov 2017 05:28:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47FA715C for ; Mon, 6 Nov 2017 05:28:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vA65SxO7086523 for ; Mon, 6 Nov 2017 05:28:59 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223461] [FIX] 200.backup-passwd does not filter passwords properly Date: Mon, 06 Nov 2017 05:28:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mail@fbsd.e4m.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 05:28:59 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223461 Bug ID: 223461 Summary: [FIX] 200.backup-passwd does not filter passwords properly Product: Base System Version: 11.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: mail@fbsd.e4m.org If /etc/periodic/daily/200.backup-passwd finds difference in master.passwd.= bak and master.passwd.bak2, it tries to filter out encrypted passwords so they don't get sent by mail. However, this does not work for lines without the += /- prefix from diff. Here, toor changed but root was left alone: Backup passwd and group files: ... passwd diffs: --- /var/backups/master.passwd.bak 2017-11-04 12:31:02.788214000 +0100 +++ /etc/master.passwd 2017-11-05 13:23:53.606509000 +0100 @@ -1,7 +1,7 @@ # $FreeBSD: stable/11/etc/master.passwd 299365 2016-05-10 12:47:36Z bcr $ # root:$6$4wTiD2ItHpuB....:0:0:std:0:0:Charlie &:/root:/bin/zsh -toor:(password):0:0:std:0:0:Bourne-again Superuser:/root:/bin/sh +toor:(password):0:0:std:0:0:Bourne-again Superuser:/root:/bin/sh daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin operator:*:2:5::0:0:System &:/:/usr/sbin/nologin bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin Fix: make the leading +/- optional by using sed 's/^\([-+]\{0,1\}[^-+:]*\):[^:]*:/\1:(password):/' or use a modern RE: sed -E 's/^([-+]?[^-+:]*):[^:]*:/\1:(password):/' Possibly, it can even be changed to: sed -E 's/^([-+]?[^:]*):[^:]*:/\1:(password):/' but I am not sure about that (maybe that would give bad interaction with NIS or whatever)... --=20 You are receiving this mail because: You are the assignee for the bug.=