conf/85449: mergemaster default for deleting "stale" rc.d scripts is bad

Kevin Oberman oberman at es.net
Mon Aug 29 19:00:48 GMT 2005


>Number:         85449
>Category:       conf
>Synopsis:       mergemaster default for deleting "stale" rc.d scripts is bad
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 29 19:00:40 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Kevin Oberman
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
ESnet--The Energy Sciences Network
>Environment:
System: FreeBSD puppeteer.es.net 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Sat Aug 27 08:41:06 PDT 2005 oberman at puppeteer.es.net:/usr/obj/usr/src/sys/IBM-T30-D i386


	
>Description:

When files not in the source tree are found in /etc/rc.d, they are
assumed to be stale and the script asks of they should be removed. The
default is to remove them. To make it worse, any response other then
'n' or 'N' (including 'no') will delete the files.

I use profile.sh which must be in /etc/rc.d to function properly and I
am getting tired of inadvertantly deleting it on my current system.

If is better to default to NOT taking destructive actions.
	
>How-To-Repeat:
Run mergemaster(8) with any non-standard file in /etc/rc.d
	
>Fix:
This is sub-optimal as 'yes' will be read as 'n', but at least it is
"safe". If I had a bit more time, I would have taken care of this, as
well. 
--- usr.sbin/mergemaster/mergemaster.sh.orig	Mon Aug 29 11:46:21 2005
+++ usr.sbin/mergemaster/mergemaster.sh	Mon Aug 29 11:46:35 2005
@@ -809,16 +809,16 @@
     case "${AUTO_RUN}" in
     '')
       echo ''
-      echo -n '   *** Delete them now? [y] '
+      echo -n '   *** Delete them now? [n] '
       read DELETE_STALE_RC_FILES
       case "${DELETE_STALE_RC_FILES}" in
-      [nN])
-        echo '      *** Files will not be deleted'
-        ;;
-      *)
+      [yY])
         echo '      *** Deleting ... '
         rm ${STALE_RC_FILES}
         echo '                       done.'
+        ;;
+      *)
+        echo '      *** Files will not be deleted'
         ;;
       esac
       sleep 2

	


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list