From owner-freebsd-bugs@FreeBSD.ORG Tue May 19 15:50:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45648106566B for ; Tue, 19 May 2009 15:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2E18FC15 for ; Tue, 19 May 2009 15:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JFo1XA059611 for ; Tue, 19 May 2009 15:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4JFo1xe059610; Tue, 19 May 2009 15:50:01 GMT (envelope-from gnats) Resent-Date: Tue, 19 May 2009 15:50:01 GMT Resent-Message-Id: <200905191550.n4JFo1xe059610@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan `Sec` Zehl Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8196B1065678 for ; Tue, 19 May 2009 15:43:01 +0000 (UTC) (envelope-from sec@42.org) Received: from ice.42.org (v6.42.org [IPv6:2001:608:9::1]) by mx1.freebsd.org (Postfix) with ESMTP id 45CAE8FC15 for ; Tue, 19 May 2009 15:43:00 +0000 (UTC) (envelope-from sec@42.org) Received: by ice.42.org (Postfix, from userid 1000) id 8975122AC4; Tue, 19 May 2009 17:41:22 +0200 (CEST) Message-Id: <20090519154253.8975122AC4@ice.42.org> Date: Tue, 19 May 2009 17:41:22 +0200 (CEST) From: Stefan `Sec` Zehl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: misc/134714: portupgrade deletes user data without question or backup. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan `Sec` Zehl List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 15:50:02 -0000 >Number: 134714 >Category: misc >Synopsis: portupgrade deletes user data without question or backup. >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 19 15:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Stefan `Sec` Zehl >Release: FreeBSD 7.2-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD ice 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #2: Mon Mar 23 23:42:21 CET 2009 root@ice:/usr/obj/usr/src/sys/ICE amd64 >Description: This just happened to me again -- I really think it should be fixed by now. Portupgrade of any port where some of the ports files have been modified deletes these files even though these changes are detected first. The only thing you get is a message like this scrolling by: | pkg_delete: '/usr/local/etc/munin/templates/munin-comparison-day.tmpl' | fails original MD5 checksum - deleted anyway. This message makes me angry every time this happens. If it knows there is something wrong, ask me how to proceed, or at least back up the modified file. Yes, I know that the underlying problem lies with pkg_delete and the "-f" option. I think it is simply wrong for portupgrade to call pkg_delete with "-f" and blindly assume everything is ok. >How-To-Repeat: >Fix: Several options come to my mind. a) Make pkg_delete return via exit code wether changed files were detected and keep the backup in this case. b) Create an option for pkg_delete to only skip dependencies, and let portupgrade fail/ask the user in case this doesn't work. c) Let portupgrade check the output from pkg_delete for these messages and handle the cases itself. >Release-Note: >Audit-Trail: >Unformatted: