Closed jahkeup closed 1 year ago
It seems that the code writing the userdata script to disk isn't ensuring the file is fully written when the module goes to execute the script.
https://github.com/aws/ec2-macos-init/blob/856afa4039a4acc4b4b87ef1c4595c59965f699a/lib/ec2macosinit/userdata.go#L45-L62
The defer file.Close() is the most suspicious here.
defer file.Close()
It seems that the code writing the userdata script to disk isn't ensuring the file is fully written when the module goes to execute the script.
https://github.com/aws/ec2-macos-init/blob/856afa4039a4acc4b4b87ef1c4595c59965f699a/lib/ec2macosinit/userdata.go#L45-L62
The
defer file.Close()
is the most suspicious here.