conf/188109: [patch] ASSERTION FAILED running individual periodic scripts on 10/11 branches

Jason Unovitch jason.unovitch at gmail.com
Mon Mar 31 03:10:01 UTC 2014


The following reply was made to PR conf/188109; it has been noted by GNATS.

From: Jason Unovitch <jason.unovitch at gmail.com>
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: conf/188109: [patch] ASSERTION FAILED running individual periodic
 scripts on 10/11 branches
Date: Sun, 30 Mar 2014 23:03:00 -0400

 This is a multi-part message in MIME format.
 --------------070406080500060600050802
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Two alternate version of patches I worked are attached for ideas if the 
 patch submitted is not acceptable.
 
 - Jason Unovitch
 
 --------------070406080500060600050802
 Content-Type: text/x-patch;
  name="defaults-periodic-2.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="defaults-periodic-2.diff"
 
 Index: periodic.conf
 ===================================================================
 --- periodic.conf	(revision 263916)
 +++ periodic.conf	(working copy)
 @@ -361,9 +361,14 @@
  			esac
  			;;
  		*)
 -			echo "ASSERTION FAILED: Unexpected value for " \
 -			    "\$PERIODIC: '$PERIODIC'" >&2
 -			exit 127
 +			# Execute when undefined (run from shell), else warn and quit
 +			if [ -z "$PERIODIC" ]; then
 +				return 0
 +			else
 +				echo "ASSERTION FAILED: Unexpected value for " \
 +				    "\$PERIODIC: '$PERIODIC'" >&2
 +				exit 127
 +			fi
  			;;
  		esac
  	}
 
 --------------070406080500060600050802
 Content-Type: text/x-patch;
  name="defaults-periodic-3.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="defaults-periodic-3.diff"
 
 Index: periodic.conf
 ===================================================================
 --- periodic.conf	(revision 263916)
 +++ periodic.conf	(working copy)
 @@ -334,38 +334,43 @@
  
  		periodvar=${var%enable}period
  		eval period=\"\$$periodvar\"
 -		case "$PERIODIC" in
 -		"security daily")
 -			case "$period" in
 -			[Dd][Aa][Ii][Ll][Yy]) return 0 ;;
 -			*) return 1 ;;
 +		# Execute when undefined (run from shell), else warn and quit
 +		if [ -z "$PERIODIC" ]; then
 +			return 0
 +		else
 +			case "$PERIODIC" in
 +			"security daily")
 +				case "$period" in
 +				[Dd][Aa][Ii][Ll][Yy]) return 0 ;;
 +				*) return 1 ;;
 +				esac
 +				;;
 +			"security weekly")
 +				case "$period" in
 +				[Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;;
 +				*) return 1 ;;
 +				esac
 +				;;
 +			"security monthly")
 +				case "$period" in
 +				[Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;;
 +				*) return 1 ;;
 +				esac
 +				;;
 +			security)
 +				# Run directly from crontab(5).
 +				case "$period" in
 +				[Nn][Oo]) return 1 ;;
 +				*) return 0 ;;
 +				esac
 +				;;
 +			*)
 +				echo "ASSERTION FAILED: Unexpected value for " \
 +				    "\$PERIODIC: '$PERIODIC'" >&2
 +				exit 127
 +				;;
  			esac
 -			;;
 -		"security weekly")
 -			case "$period" in
 -			[Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;;
 -			*) return 1 ;;
 -			esac
 -			;;
 -		"security monthly")
 -			case "$period" in
 -			[Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;;
 -			*) return 1 ;;
 -			esac
 -			;;
 -		security)
 -			# Run directly from crontab(5).
 -			case "$period" in
 -			[Nn][Oo]) return 1 ;;
 -			*) return 0 ;;
 -			esac
 -			;;
 -		*)
 -			echo "ASSERTION FAILED: Unexpected value for " \
 -			    "\$PERIODIC: '$PERIODIC'" >&2
 -			exit 127
 -			;;
 -		esac
 +		fi
  	}
  
          source_periodic_confs() {
 
 --------------070406080500060600050802--


More information about the freebsd-bugs mailing list