Small bug fix for ec2-scripts/ec2_fetchkey

Colin Percival cperciva at freebsd.org
Thu Feb 12 12:49:29 UTC 2015


On 02/12/15 04:42, Bradley T. Hughes wrote:
> I noticed a small bug in ec2_fetchkey: it needs a '$' to expand ec2_fetchkey_user when grepping through /etc/passwd.

Oops!  Thanks, I've fixed this locally and I'll roll a new distfile and
update the port soon.

Colin Percival

> 
> diff --git a/ec2_fetchkey b/ec2_fetchkey
> --- a/ec2_fetchkey
> +++ b/ec2_fetchkey
> @@ -24,7 +24,7
>  ec2_fetchkey_run()
>  {
>  	# If the user does not exist, create it.
> -	if ! grep -q "^{ec2_fetchkey_user}:" /etc/passwd; then
> +	if ! grep -q "^${ec2_fetchkey_user}:" /etc/passwd; then
>  		echo "Creating user ${ec2_fetchkey_user}"
>  		pw useradd ${ec2_fetchkey_user} -m -G wheel
>  	fi
> 
> --
> Bradley T. Hughes
> bradleythughes at fastmail.fm
> 
> _______________________________________________
> freebsd-cloud at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-cloud
> To unsubscribe, send any mail to "freebsd-cloud-unsubscribe at freebsd.org"
> 
> 

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid


More information about the freebsd-cloud mailing list