postcreate.sh: create /etc/resolv.conf with correct owner and perms

Quoting the bug report:

	If /etc/resolv.conf does not exist (as is the case in funtoo
	containers), then vzctl's scripts will attempt to create it as part of
	the postcreate actions. However, it is created with 0600 permissions,
	which will prevent non-root applications from performing DNS lookups.

	Expected behavior would be to leave /etc/resolv.conf creation to the
	distribution, or create a blank /etc/resolv.conf owned by root:root
	with 0644 perms explicitly.

	This bug is based on Funtoo bug FL-6:
		http://bugs.funtoo.org/browse/FL-6

I was not able to reproduce this bug on my system until I set
umask to 077. So, the solution is to set the sane umask, as we do in
other scripts.

Note that vzctl can be only run by root, so owner of file will be root.

http://bugzilla.openvz.org/2290

Reported-by: Daniel Robbins <drobbins@funtoo.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed