[arch-projects] [dbscripts] [PATCH] sourceballs: fix ACL issues on nymeria

Jan Alexander Steffens (heftig) jan.steffens at gmail.com
Tue Mar 19 14:53:38 EDT 2013


From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>

ACLs from the WORKDIR were used, leading to problems as these weren't
world-readable. Fix follows ftpdir-cleanup.

Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
---
 cron-jobs/ftpdir-cleanup | 9 ---------
 cron-jobs/sourceballs    | 4 ++--
 db-functions             | 9 +++++++++
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index e1294bd..8f5cb3c 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -3,15 +3,6 @@
 . "$(dirname $0)/../config"
 . "$(dirname $0)/../db-functions"
 
-# just like mv -f, but we touch the file and then copy the content so
-# default ACLs in the target dir will be applied
-mv_acl() {
-	rm -f "$2"
-	touch "$2"
-	cat "$1" >"$2" || return 1
-	rm -f "$1"
-}
-
 clean_pkg() {
 	local pkg
 	local target
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index 6f75ccc..be66e99 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -90,7 +90,7 @@ for repo in ${PKGREPOS[@]}; do
 			pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null
 			makepkg --nocolor --allsource --ignorearch --skippgpcheck --config "${dirname}/makepkg.conf" >"${WORKDIR}/${pkgbase}.log" 2>&1
 			if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then
-				mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}"
+				mv_acl "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}/${pkgbase}-${pkgver}${SRCEXT}"
 				# Avoid creating the same source package for every arch
 				echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs"
 				newpkgs[${#newpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}"
@@ -127,7 +127,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
 	for old_pkg in ${old_pkgs[@]}; do
 		msg2 "${old_pkg}"
 		if ! ${SOURCE_CLEANUP_DRYRUN}; then
-			mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}"
+			mv_acl "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
 			touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}"
 		fi
 	done
diff --git a/db-functions b/db-functions
index b3a4293..4a9a42a 100644
--- a/db-functions
+++ b/db-functions
@@ -15,6 +15,15 @@ restore_umask () {
 	umask $UMASK >/dev/null
 }
 
+# just like mv -f, but we touch the file and then copy the content so
+# default ACLs in the target dir will be applied
+mv_acl() {
+	rm -f "$2"
+	touch "$2"
+	cat "$1" >"$2" || return 1
+	rm -f "$1"
+}
+
 # set up general environment
 WORKDIR=$(mktemp -d "${TMPDIR}/${0##*/}.XXXXXXXXXX")
 if [ -n "${SVNUSER}" ]; then
-- 
1.8.2



More information about the arch-projects mailing list