diff --git a/Makefile.am b/Makefile.am
index 51f23c3c402c1b457c973e387f92ab241597be74..ceaa04f96a4e11ead6dd6d7909c33bb570218599 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -282,6 +282,7 @@ EXTRA_DIST = \
 	autotools/build-bash-completion \
 	autotools/check-python-code \
 	autotools/check-man \
+	autotools/check-tar \
 	autotools/docbook-wrapper \
 	autotools/gen-coverage \
 	autotools/testrunner \
@@ -669,9 +670,17 @@ distcheck-hook:
 	fi
 
 # When building a release, stricter checks should be used
-distcheck-release: export BUILD_RELEASE = 1
+distcheck-release dist-release: export BUILD_RELEASE = 1
 distcheck-release: distcheck
 
+dist-release: dist
+	set -e; \
+	for i in $(DIST_ARCHIVES); do \
+		echo -n "Checking $$i ... "; \
+		autotools/check-tar < $$i; \
+		echo OK; \
+	done
+
 install-exec-local:
 	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
 	  "$(DESTDIR)${localstatedir}/log/ganeti" \
diff --git a/autotools/check-tar b/autotools/check-tar
new file mode 100755
index 0000000000000000000000000000000000000000..d540763f1d7a2603295e5a4ebb96dcc9b2eee09b
--- /dev/null
+++ b/autotools/check-tar
@@ -0,0 +1,60 @@
+#!/usr/bin/python
+#
+
+# Copyright (C) 2010 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+
+"""Script to check tarball generated by Automake.
+
+"""
+
+import sys
+import stat
+import tarfile
+
+
+def ReportError(member, msg):
+  print >>sys.stderr, "%s: %s" % (member.name, msg)
+
+
+def main():
+  tf = tarfile.open(fileobj=sys.stdin)
+
+  success = True
+
+  for member in tf.getmembers():
+    if member.uid != 0:
+      success = False
+      ReportError(member, "Owned by UID %s, not UID 0" % member.uid)
+
+    if member.gid != 0:
+      success = False
+      ReportError(member, "Owned by GID %s, not GID 0" % member.gid)
+
+    if member.mode & (stat.S_IWGRP | stat.S_IWOTH):
+      success = False
+      ReportError(member, "World or group writeable (mode is %o)" % member.mode)
+
+  if success:
+    sys.exit(0)
+
+  sys.exit(1)
+
+
+if __name__ == "__main__":
+  main()