From nobody@FreeBSD.org  Fri Apr 11 22:49:23 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id AE8DEBB3
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Apr 2014 22:49:23 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 9BB7117C0
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Apr 2014 22:49:23 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BMnNeK078023
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Apr 2014 22:49:23 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3BMnNmf078017;
	Fri, 11 Apr 2014 22:49:23 GMT
	(envelope-from nobody)
Message-Id: <201404112249.s3BMnNmf078017@cgiserv.freebsd.org>
Date: Fri, 11 Apr 2014 22:49:23 GMT
From: David Boyd <David.Boyd49@twc.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mergemaster -p fails with "/var/tmp/temproot suddenly disappeared"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         188485
>Category:       bin
>Synopsis:       mergemaster -p fails with "/var/tmp/temproot suddenly disappeared"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jilles
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 11 22:50:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Mon Apr 14 22:10:00 UTC 2014
>Originator:     David Boyd
>Release:        10.0-RELEASE-p1
>Organization:
Boyd Consulting Services, LLC
>Environment:
amd64 10.0-RELEASE-p1
>Description:
mergemaster -p fails with message "/var/tmp/temproot suddenly disappeared"

mergemaster issues "find -d ${TEMPROOT} -type d -empty -delete 2> /dev/null" to delete directories under TEMPROOT (defaults to /var/tmp/temproot).

For 10.0-RELEASE this results in temproot being removed.

For earlier releases a warning message about relative paths is redirected to /dev/null but the directory remains.

>How-To-Repeat:
mkdir -p /var/tmp/temproot

ls -ldT /var/tmp/temproot

find -d /var/tmp/temproot -type d -empty -delete

ls -ldT /var/tmp/temproot
>Fix:
in mergemaster near line number 711:

replace: find -d ${TEMPROOT} -type d -empty -delete 2> /dev/null

   with: find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2> /dev/null

This solution is discussed in r253886 to find.

>Release-Note:
>Audit-Trail:

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, David.Boyd49@twc.com
Cc:  
Subject: Re: bin/188485: mergemaster -p fails with &quot;/var/tmp/temproot
 suddenly disappeared&quot;
Date: Sun, 13 Apr 2014 17:03:15 +0200

 In FreeBSD PR bin/188485, you wrote:
 > mergemaster -p fails with message "/var/tmp/temproot suddenly
 > disappeared"
 
 > mergemaster issues "find -d ${TEMPROOT} -type d -empty -delete 2>
 > /dev/null" to delete directories under TEMPROOT (defaults to
 > /var/tmp/temproot).
 
 > For 10.0-RELEASE this results in temproot being removed.
 
 > For earlier releases a warning message about relative paths is
 > redirected to /dev/null but the directory remains.
 
 Thanks for your report.
 
 I cannot reproduce this here (11-CURRENT i386) and in the code it looks
 like this can only happen if IGNORE_FILES contains both etc/group and
 etc/master.passwd, making the temproot empty and making mergemaster do
 nothing.
 
 I certainly made the change to find(1) but I don't see how it breaks a
 previously working use of mergemaster.
 
 Please provide more details.
 
 -- 
 Jilles Tjoelker
State-Changed-From-To: open->patched 
State-Changed-By: jilles 
State-Changed-When: Mon Apr 14 22:02:15 UTC 2014 
State-Changed-Why:  
Committed to head, thanks! 


Responsible-Changed-From-To: freebsd-bugs->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Mon Apr 14 22:02:15 UTC 2014 
Responsible-Changed-Why:  
I committed the change. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188485 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/188485: commit references a PR
Date: Mon, 14 Apr 2014 22:01:53 +0000 (UTC)

 Author: jilles
 Date: Mon Apr 14 22:01:49 2014
 New Revision: 264480
 URL: http://svnweb.freebsd.org/changeset/base/264480
 
 Log:
   mergemaster: Avoid "/var/tmp/temproot disappeared" if there is nothing to
   compare.
   
   Because of the change to find in SVN r253886, the entire temproot would be
   deleted if it became empty, leading to a confusing message "*** FATAL ERROR:
   The temproot directory ${TEMPROOT} has disappeared!"
   
   Note that mergemaster does not do anything useful in this situation anyway
   (e.g. put IGNORE_FILES="/etc/group /etc/master.passwd" in
   /etc/mergemaster.rc and run mergemaster -p).
   
   As noted in that commit, add -mindepth 1.
   
   PR:		bin/188485
   Submitted by:	David Boyd
   MFC after:	1 week
 
 Modified:
   head/usr.sbin/mergemaster/mergemaster.sh
 
 Modified: head/usr.sbin/mergemaster/mergemaster.sh
 ==============================================================================
 --- head/usr.sbin/mergemaster/mergemaster.sh	Mon Apr 14 21:44:34 2014	(r264479)
 +++ head/usr.sbin/mergemaster/mergemaster.sh	Mon Apr 14 22:01:49 2014	(r264480)
 @@ -709,7 +709,7 @@ case "${RERUN}" in
    # and to make the actual comparison faster.
    find ${TEMPROOT}/usr -type l -delete 2>/dev/null
    find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null
 -  find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null
 +  find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2>/dev/null
  
    # Build the mtree database in a temporary location.
    case "${PRE_WORLD}" in
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
