summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-08-17 18:07:15 -0700
committerZac Medico <zmedico@gentoo.org>2012-08-17 18:07:15 -0700
commit9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf (patch)
treec482ebf1b4fdf3c0fb5e1ce2846b93ca90e65aed /misc
parent87a769bdab8e54c68260996026c87d3d7845d2e6 (diff)
downloadportage-9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf.tar.gz
portage-9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf.tar.bz2
portage-9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf.zip
emerge-delta-webrsync: check write permission
This will fix bug #176008.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/emerge-delta-webrsync19
1 files changed, 15 insertions, 4 deletions
diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync
index e23316a8e..3b934ffe9 100755
--- a/misc/emerge-delta-webrsync
+++ b/misc/emerge-delta-webrsync
@@ -97,11 +97,22 @@ if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
exit 1
fi
-if [[ ! -d $DISTDIR ]] ; then
- mkdir -p $DISTDIR
+[[ -d ${PORTDIR} ]] || mkdir -p "${PORTDIR}"
+if [[ ! -w ${PORTDIR} ]] ; then
+ eecho "PORTDIR is not writable: ${PORTDIR}"
+ exit 1
+fi
+
+[[ -d ${DISTDIR} ]] || mkdir -p "${DISTDIR}"
+if [[ ! -w ${DISTDIR} ]] ; then
+ eecho "DISTDIR is not writable: ${DISTDIR}"
+ exit 1
fi
-if [[ ! -d $TMPDIR ]]; then
- mkdir -p $TMPDIR
+
+[[ -d ${TMPDIR} ]] || mkdir -p "${TMPDIR}"
+if [[ ! -w ${TMPDIR} ]] ; then
+ eecho "TMPDIR is not writable: ${TMPDIR}"
+ exit 1
fi
cd "$DISTDIR"